Skip to content

Commit 717b5ef

Browse files
committed
RGB21 type library
1 parent 34accd7 commit 717b5ef

File tree

10 files changed

+1067
-13
lines changed

10 files changed

+1067
-13
lines changed

Cargo.lock

Lines changed: 193 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ name = "ifaces"
2323
amplify = "4.8.0"
2424
strict_encoding = "~2.8.1"
2525
strict_types = "~2.8.2"
26+
bp-consensus = "0.12.0-beta.5"
2627
serde = { version = "1.0", optional = true, features = ["derive"] }
2728

2829
[features]
2930
default = []
3031
all = ["stl", "serde"]
31-
stl = ["strict_types/armor"]
32-
serde = ["dep:serde", "strict_encoding/serde"]
32+
stl = ["strict_types/armor", "bp-consensus/stl"]
33+
serde = ["dep:serde", "strict_encoding/serde", "bp-consensus/serde"]
3334

3435
[target.'cfg(target_arch = "wasm32")'.dependencies]
3536
wasm-bindgen = "0.2"

src/bin/rgb-interfaces-stl.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// or implied. See the License for the specific language governing permissions and limitations under
1919
// the License.
2020

21-
use ifaces::rgb_contract_stl;
21+
use ifaces::{rgb21_stl, rgb_contract_stl};
2222
use strict_types::parse_args;
2323

2424
fn main() {
@@ -39,4 +39,20 @@ fn main() {
3939
),
4040
)
4141
.expect("unable to write to the file");
42+
43+
let lib = rgb21_stl();
44+
lib.serialize(
45+
format,
46+
dir.as_ref(),
47+
"0.12.0",
48+
Some(
49+
"
50+
RGB21 smart contract interface
51+
Author: Dr Maxim Orlovsky <orlovsky@ubideco.org>
52+
Copyright (C) 2019-2025 RGB Consortium members & contributors.
53+
All rights reserved.
54+
License: Apache-2.0",
55+
),
56+
)
57+
.expect("unable to write to the file");
4258
}

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ extern crate strict_encoding;
2929
extern crate serde;
3030

3131
mod fungible;
32+
mod nft;
3233
mod types;
3334
mod names;
3435

3536
pub use fungible::*;
3637
pub use names::{AssetName, Details, Ticker};
37-
pub use types::{rgb_contract_stl, CommonTypes, LIB_ID_RGB_INTERFACES};
38+
pub use nft::*;
39+
pub use types::{rgb21_stl, rgb_contract_stl, CommonTypes, Rgb21Types, LIB_ID_RGB21, LIB_ID_RGB_INTERFACES};
3840

3941
pub const LIB_NAME_RGB_CONTRACT: &str = "RGBContract";
42+
pub const LIB_NAME_RGB21: &str = "RGB21";

src/names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl AssetName {
6868
pub fn from_strict_val_unchecked(value: &StrictVal) -> Self { Self::from_str(&value.unwrap_string()).unwrap() }
6969
}
7070

71-
#[derive(Wrapper, Clone, Ord, PartialOrd, PartialEq, Eq, From)]
71+
#[derive(Wrapper, Clone, Ord, PartialOrd, PartialEq, Eq, Hash, Debug, From)]
7272
#[wrapper(Deref, Display, FromStr)]
7373
#[derive(StrictDumb, StrictType, StrictEncode, StrictDecode)]
7474
#[strict_type(lib = LIB_NAME_RGB_CONTRACT)]

0 commit comments

Comments
 (0)