pub fn _metadata(
    metadata_key: StorageKey<StorageMetadata>,
    asset: AssetId,
    key: String,
) -> Option<Metadata> 
Expand description

Returns metadata for a specific asset and key pair.

Arguments

  • metadata_key: [StorageKey] - The storage location for metadata.
  • asset: [AssetId] - The asset for the metadata to be read.
  • metadata: [Option] - The metadata which to be read.
  • key: [String] - The key for the metadata to be read.

Number of Storage Accesses

  • Reads: 2

Example

use standards::src7::Metadata;
use sway_libs::asset::metadata::*;
use std::string::String;

storage {
    metadata: StorageMetadata = StorageMetadata {}
}

fn foo(asset: AssetId, key: String) {
    let result: Option<Metadata> = _metadata(storage.metadata, asset, key);
}