rgbp/lib.rs
1// Wallet Library for RGB smart contracts
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Designed in 2019-2025 by Dr Maxim Orlovsky <orlovsky@lnp-bp.org>
6// Written in 2024-2025 by Dr Maxim Orlovsky <orlovsky@lnp-bp.org>
7//
8// Copyright (C) 2019-2024 LNP/BP Standards Association, Switzerland.
9// Copyright (C) 2024-2025 LNP/BP Laboratories,
10// Institute for Distributed and Cognitive Systems (InDCS), Switzerland.
11// Copyright (C) 2025 RGB Consortium, Switzerland.
12// Copyright (C) 2019-2025 Dr Maxim Orlovsky.
13// All rights under the above copyrights are reserved.
14//
15// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
16// in compliance with the License. You may obtain a copy of the License at
17//
18// http://www.apache.org/licenses/LICENSE-2.0
19//
20// Unless required by applicable law or agreed to in writing, software distributed under the License
21// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
22// or implied. See the License for the specific language governing permissions and limitations under
23// the License.
24
25#![cfg_attr(docsrs, feature(doc_auto_cfg))]
26// #![cfg_attr(not(feature = "std"), no_std)]
27#![cfg_attr(feature = "async", allow(async_fn_in_trait))]
28
29#[cfg(all(
30 feature = "async",
31 any(
32 feature = "resolver-esplora",
33 feature = "resolver-electrum",
34 /*feature = "resolver-bitcoinrpc"*/
35 )
36))]
37compile_error!("async feature must not be used with non-async resolvers");
38#[cfg(all(feature = "async", feature = "fs"))]
39compile_error!("async feature must not be used with fs feature");
40
41extern crate alloc;
42#[macro_use]
43extern crate amplify;
44#[cfg(feature = "serde")]
45#[macro_use]
46extern crate serde;
47extern crate core;
48pub extern crate rgbdescr as descriptors;
49
50mod utxoset;
51mod owner;
52mod coinselect;
53mod runtime;
54mod info;
55pub mod resolvers;
56
57pub use coinselect::CoinselectStrategy;
58pub use info::{CodexInfo, ContractInfo};
59#[cfg(feature = "fs")]
60pub use owner::file::FileHolder;
61pub use owner::{Holder, MultiHolder, Owner, OwnerProvider};
62#[cfg(feature = "fs")]
63pub use runtime::file::{ConsignmentStream, RgbpRuntimeDir, Transfer};
64pub use runtime::{FinalizeError, PayError, Payment, RgbRuntime, TransferError};
65pub use utxoset::{MemUtxos, UtxoSet};