use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cw721_updatable::Expiration; #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct Account { username: Option, profile: Option, account_type: Option, verfication_hash: Option, } #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct Website { url: Option, domain: Option, verfication_hash: Option, } #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct Metadata { pub name: Option, // e.g. for interoperability with external marketplaces pub description: Option, // e.g. ibid. pub image: Option, // e.g. ibid. pub expiry: Option, pub domain: Option, pub subdomains: Vec, pub accounts: Vec, pub websites: Vec, } fn example_metadata() { let subdomains = vec![ "game".to_string(), "dapp".to_string(), "market".to_string() ]; let accounts = vec![ Account { username: Some("drew.taylor@chainofinsight.com".to_string()), profile: None, account_type: Some("email".to_string()), verfication_hash: None, // XXX: Only "self attestations" for now }, Account { username: Some("@chainofinsight".to_string()), profile: Some("twitter.com/chainofinsight".to_string()), account_type: Some("twitter".to_string()), verfication_hash: None, } ]; let websites = vec![ Website { url: Some("drewstaylor.com".to_string()), domain: Some("drewstaylor.arch".to_string()), verfication_hash: None, }, Website { url: Some("game.drewstaylor.com".to_string()), domain: Some("game.drewstaylor.arch".to_string()), verfication_hash: None, }, Website { url: Some("dapp.drewstaylor.com".to_string()), domain: Some("dapp.drewstaylor.arch".to_string()), verfication_hash: None, }, Website { url: Some("market.drewstaylor.com".to_string()), domain: Some("market.drewstaylor.arch".to_string()), verfication_hash: None, } ]; let metadata_extension = Some(Metadata { name: Some("drewstaylor.arch".into()), description: Some("default token description".into()), image: Some("ipfs://QmZdPdZzZum2jQ7jg1ekfeE3LSz1avAaa42G6mfimw9TEn".into()), domain: Some("drewstaylor.arch".into()), expiry: Some(Expiration::AtHeight(1234567)), subdomains: subdomains, accounts: accounts, websites: websites, }); dbg!(metadata_extension); } fn main() { example_metadata(); }