Skip to main content

Module 0x107a::irc27

use 0x1::fixed_point32; use 0x1::option; use 0x1::string; use 0x2::url; use 0x2::vec_map;

Struct Irc27Metadata

The IRC27 NFT metadata standard schema.

struct Irc27Metadata has store

Fields
version: string::String

Version of the metadata standard.

media_type: 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.
uri: url::Url

URL pointing to the NFT file location.

name: string::String

Alphanumeric text string defining the human identifiable name for the NFT.

collection_name: option::Option<string::String>

The human-readable collection name of the NFT.

royalties: vec_map::VecMap<address, 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: option::Option<string::String>

The human-readable name of the NFT creator.

description: option::Option<string::String>

The human-readable description of the NFT.

attributes: vec_map::VecMap<string::String, string::String>

Additional attributes which follow OpenSea Metadata standards.

non_standard_fields: vec_map::VecMap<string::String, string::String>

Legacy non-standard metadata fields.

Function version

Get the metadata's version.

public fun version(irc27: &irc27::Irc27Metadata): &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: &irc27::Irc27Metadata): &string::String

Implementation

public fun media_type(irc27: &Irc27Metadata): &String { &irc27.media_type }

Function uri

Get the metadata's uri.

public fun uri(irc27: &irc27::Irc27Metadata): &url::Url

Implementation

public fun uri(irc27: &Irc27Metadata): &Url { &irc27.uri }

Function name

Get the metadata's name.

public fun name(irc27: &irc27::Irc27Metadata): &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: &irc27::Irc27Metadata): &option::Option<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: &irc27::Irc27Metadata): &vec_map::VecMap<address, 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: &irc27::Irc27Metadata): &option::Option<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: &irc27::Irc27Metadata): &option::Option<string::String>

Implementation

public fun description(irc27: &Irc27Metadata): &Option<String> { &irc27.description }

Function attributes

Get the metadata's attributes.

public fun attributes(irc27: &irc27::Irc27Metadata): &vec_map::VecMap<string::String, 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: &irc27::Irc27Metadata): &vec_map::VecMap<string::String, 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: 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; }