Macro catenis_api_client::json_obj
source · macro_rules! json_obj {
($($json:tt)+) => { ... };
}
Expand description
Helper for defining custom non-fungible token metadata properties.
Pass a JSON literal as the single input parameter, and the macro will return the corresponding
Option<
JsonObject
>
value.
Example
use catenis_api_client::{
json_obj,
api::{
IntoJsonObj,
NewNonFungibleTokenMetadata,
}
};
let new_nf_token_metadata = NewNonFungibleTokenMetadata {
name: String::from("TestNFToken_1"),
description: Some(String::from("First non-fungible token issued for test")),
custom: json_obj!({
"sensitiveProps": {
"senseProp1": "XYZ",
"senseProp2": "456"
},
"propNum": 5,
"propStr": "ABC",
"propBool": true
}),
};