Module stardust::irc27
- Struct Irc27Metadata
- Function version
- Function media_type
- Function uri
- Function name
- Function collection_name
- Function royalties
- Function issuer_name
- Function description
- Function attributes
- Function non_standard_fields
- Function destroy
use iota::url;
use iota::vec_map;
use std::ascii;
use std::fixed_point32;
use std::option;
use std::string;
use std::vector;
Struct Irc27Metadata
The IRC27 NFT metadata standard schema.
public struct Irc27Metadata has store
Fields
- version: std::string::String
- Version of the metadata standard. 
- media_type: std::string::String
- The media type (MIME) of the asset. - Examples- Image files: image/jpeg,image/png,image/gif, etc.
- Video files: video/x-msvideo(avi),video/mp4,video/mpeg, etc.
- Audio files: audio/mpeg,audio/wav, etc.
- 3D Assets: model/obj,model/u3d, etc.
- Documents: application/pdf,text/plain, etc.
 
- Image files: 
- uri: iota::url::Url
- URL pointing to the NFT file location. 
- name: std::string::String
- Alphanumeric text string defining the human identifiable name for the NFT. 
- collection_name: std::option::Option<std::string::String>
- The human-readable collection name of the NFT. 
- royalties: iota::vec_map::VecMap<address, std::fixed_point32::FixedPoint32>
- Royalty payment addresses mapped to the payout percentage. Contains a hash of the 32 bytes parsed from the BECH32 encoded IOTA address in the metadata, it is a legacy address. Royalties are not supported by the protocol and needed to be processed by an integrator. 
- issuer_name: std::option::Option<std::string::String>
- The human-readable name of the NFT creator. 
- description: std::option::Option<std::string::String>
- The human-readable description of the NFT. 
- attributes: iota::vec_map::VecMap<std::string::String, std::string::String>
- Additional attributes which follow OpenSea Metadata standards. 
- non_standard_fields: iota::vec_map::VecMap<std::string::String, std::string::String>
- Legacy non-standard metadata fields. 
Function version
Get the metadata's version.
public fun version(irc27: &stardust::irc27::Irc27Metadata): &std::string::String
Implementation
public fun version(irc27: &Irc27Metadata): &String {
&irc27.version
}
Function media_type
Get the metadata's media_type.
public fun media_type(irc27: &stardust::irc27::Irc27Metadata): &std::string::String
Implementation
public fun media_type(irc27: &Irc27Metadata): &String {
&irc27.media_type
}
Function uri
Get the metadata's uri.
public fun uri(irc27: &stardust::irc27::Irc27Metadata): &iota::url::Url
Implementation
public fun uri(irc27: &Irc27Metadata): &Url {
&irc27.uri
}
Function name
Get the metadata's name.
public fun name(irc27: &stardust::irc27::Irc27Metadata): &std::string::String
Implementation
public fun name(irc27: &Irc27Metadata): &String {
&irc27.name
}
Function collection_name
Get the metadata's collection_name.
public fun collection_name(irc27: &stardust::irc27::Irc27Metadata): &std::option::Option<std::string::String>
Implementation
public fun collection_name(irc27: &Irc27Metadata): &Option<String> {
&irc27.collection_name
}
Function royalties
Get the metadata's royalties.
public fun royalties(irc27: &stardust::irc27::Irc27Metadata): &iota::vec_map::VecMap<address, std::fixed_point32::FixedPoint32>
Implementation
public fun royalties(irc27: &Irc27Metadata): &VecMap<address, FixedPoint32> {
&irc27.royalties
}
Function issuer_name
Get the metadata's issuer_name.
public fun issuer_name(irc27: &stardust::irc27::Irc27Metadata): &std::option::Option<std::string::String>
Implementation
public fun issuer_name(irc27: &Irc27Metadata): &Option<String> {
&irc27.issuer_name
}
Function description
Get the metadata's description.
public fun description(irc27: &stardust::irc27::Irc27Metadata): &std::option::Option<std::string::String>
Implementation
public fun description(irc27: &Irc27Metadata): &Option<String> {
&irc27.description
}
Function attributes
Get the metadata's attributes.
public fun attributes(irc27: &stardust::irc27::Irc27Metadata): &iota::vec_map::VecMap<std::string::String, std::string::String>
Implementation
public fun attributes(irc27: &Irc27Metadata): &VecMap<String, String> {
&irc27.attributes
}
Function non_standard_fields
Get the metadata's non_standard_fields.
public fun non_standard_fields(irc27: &stardust::irc27::Irc27Metadata): &iota::vec_map::VecMap<std::string::String, std::string::String>
Implementation
public fun non_standard_fields(irc27: &Irc27Metadata): &VecMap<String, String> {
&irc27.non_standard_fields
}
Function destroy
Permanently destroy a Irc27Metadata object.
public fun destroy(irc27: stardust::irc27::Irc27Metadata)
Implementation
public fun destroy(irc27: Irc27Metadata) {
let Irc27Metadata {
version: _,
media_type: _,
uri: _,
name: _,
collection_name: _,
royalties: _,
issuer_name: _,
description: _,
attributes: _,
non_standard_fields: _,
} = irc27;
}