rgbstd/interface/
mod.rs

1// RGB standard library for working with smart contracts on Bitcoin & Lightning
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Written in 2019-2023 by
6//     Dr Maxim Orlovsky <orlovsky@lnp-bp.org>
7//
8// Copyright (C) 2019-2023 LNP/BP Standards Association. All rights reserved.
9//
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14//     http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21
22//! RGB contract interface provides a mapping between identifiers of RGB schema-
23//! defined contract state and operation types to a human-readable and
24//! standardized wallet APIs.
25
26mod iface;
27mod iimpl;
28mod contract;
29mod builder;
30pub mod rgb20;
31pub mod rgb21;
32pub mod rgb25;
33mod suppl;
34
35pub use builder::{BuilderError, ContractBuilder, TransitionBuilder};
36pub use contract::{ContractIface, FungibleAllocation, OutpointFilter, TypedState};
37pub use iface::{
38    ArgMap, ArgSpec, AssignIface, ExtensionIface, GenesisIface, GlobalIface, Iface, IfaceId,
39    OwnedIface, Req, TransitionIface, ValencyIface,
40};
41pub use iimpl::{IfaceImpl, IfacePair, ImplId, NamedField, NamedType, SchemaIfaces};
42pub use rgb20::{rgb20, rgb20_stl, Rgb20, LIB_ID_RGB20, LIB_NAME_RGB20};
43pub use rgb21::{rgb21, rgb21_stl, Rgb21, LIB_ID_RGB21, LIB_NAME_RGB21};
44pub use rgb25::{rgb25, rgb25_stl, Rgb25, LIB_ID_RGB25, LIB_NAME_RGB25};
45pub use suppl::{ContractSuppl, OwnedStateSuppl, SupplId, TickerSuppl, VelocityHint};
46
47#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, Default)]
48#[derive(StrictType, StrictEncode, StrictDecode)]
49#[strict_type(lib = crate::LIB_NAME_RGB_STD, tags = repr, into_u8, try_from_u8)]
50#[cfg_attr(
51    feature = "serde",
52    derive(Serialize, Deserialize),
53    serde(crate = "serde_crate", rename_all = "camelCase")
54)]
55#[repr(u8)]
56#[non_exhaustive]
57pub enum VerNo {
58    #[default]
59    #[display("v1")]
60    V1 = 0,
61}