1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use super::*;
use crate::*;
use radix_engine_common::data::scrypto::model::Own;
use sbor::rust::fmt::Debug;
use sbor::rust::prelude::*;

pub const METADATA_BLUEPRINT: &str = "Metadata";

pub const METADATA_CREATE_IDENT: &str = "create";

#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor, ManifestSbor)]
pub struct MetadataCreateInput {}

pub type MetadataCreateOutput = Own;

pub const METADATA_CREATE_WITH_DATA_IDENT: &str = "create_with_data";

#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor, ManifestSbor)]
pub struct MetadataCreateWithDataInput {
    pub data: MetadataInit,
}

pub type MetadataCreateWithDataOutput = Own;

pub const METADATA_SET_IDENT: &str = "set";

#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor, ManifestSbor)]
pub struct MetadataSetInput {
    pub key: String,
    pub value: MetadataValue,
}

pub type MetadataSetOutput = ();

pub const METADATA_LOCK_IDENT: &str = "lock";

#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor, ManifestSbor)]
pub struct MetadataLockInput {
    pub key: String,
}

pub type MetadataLockOutput = ();

pub const METADATA_GET_IDENT: &str = "get";

#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor, ManifestSbor)]
pub struct MetadataGetInput {
    pub key: String,
}

pub type MetadataGetOutput = Option<MetadataValue>;

pub const METADATA_REMOVE_IDENT: &str = "remove";

#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor, ManifestSbor)]
pub struct MetadataRemoveInput {
    pub key: String,
}

pub type MetadataRemoveOutput = bool;