Skip to content

Commit

Permalink
update metadata struct comments
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Sep 6, 2023
1 parent 06279c5 commit 51b14d9
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions neps/nep-0393.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,22 +264,35 @@ All time related attributes are defined in milliseconds (as per NEP-171).
```rust
/// ContractMetadata defines contract wide attributes, which describes the whole contract.
pub struct ContractMetadata {
pub spec: String, // required, essentially a version like "sbt-1.0.0"
pub name: String, // required, ex. "Mosaics"
pub symbol: String, // required, ex. "MOSAIC"
pub icon: Option<String>, // Data URL
pub base_uri: Option<String>, // Centralized gateway known to have reliable access to decentralized storage assets referenced by `reference` or `media` URLs
pub reference: Option<String>, // URL to a JSON file with more info
pub reference_hash: Option<Base64VecU8>, // Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included.
/// Version with namespace, example: "sbt-1.0.0". Required.
pub spec: String,
/// Issuer Name, required, ex. "Mosaics"
pub name: String,
/// Issuer symbol which can be used as a token symbol, eg Ⓝ, ₿, BTC, MOSAIC ...
pub symbol: String,
/// Icon content (SVG) or a link to an Icon. If it doesn't start with a scheme (eg: https://)
/// then `base_uri` should be prepended.
pub icon: Option<String>,
/// URI prefix which will be prepended to other links which don't start with a scheme
/// (eg: ipfs:// or https:// ...).
pub base_uri: Option<String>,
/// JSON or an URL to a JSON file with more info. If it doesn't start with a scheme
/// (eg: https://) then base_uri should be prepended.
pub reference: Option<String>,
/// Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included.
pub reference_hash: Option<Base64VecU8>,
}

/// TokenMetadata defines attributes for each SBT token.
pub struct TokenMetadata {
pub class: ClassId, // token class. Required. Must be non zero.
pub issued_at: Option<u64>, // When token was issued or minted, Unix epoch in milliseconds
pub expires_at: Option<u64>, // When token expires, Unix epoch in milliseconds
pub reference: Option<String>, // URL to an off-chain JSON file with more info.
pub reference_hash: Option<Base64VecU8>, // Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included.
pub issued_at: Option<u64>, // When token was issued or minted, Unix time in milliseconds
pub expires_at: Option<u64>, // When token expires, Unix time in milliseconds
/// JSON or an URL to a JSON file with more info. If it doesn't start with a scheme
/// (eg: https://) then base_uri should be prepended.
pub reference: Option<String>,
/// Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included.
pub reference_hash: Option<Base64VecU8>,
}


Expand Down

0 comments on commit 51b14d9

Please sign in to comment.