0x0::metadata

Structs

metadata::Metadata<C> has store, key

Fields:

Name Type Description
id object::UID
metadata nft::Nft<C>

Metadata object

Methods

public fun new_unregulated<C>(
    metadata: nft::Nft<C>,
    ctx: &mut tx_context::TxContext,
): metadata::Metadata<C>

Create Metadata with unregulated supply

Does not require that collection itself is unregulated as Metadata supply is independently regulated.

public entry fun create_unregulated<C>(
    metadata: nft::Nft<C>,
    ctx: &mut tx_context::TxContext,
)

Create Metadata with unregulated supply and transfer to transaction sender

Does not require that collection itself is unregulated as Metadata supply is independently regulated.

public fun new_regulated<C>(
    metadata: nft::Nft<C>,
    supply: u64,
    ctx: &mut tx_context::TxContext,
): metadata::Metadata<C>

Create Metadata with unregulated supply

Does not require that collection itself is regulated as Metadata supply is independently regulated.

public entry fun create_regulated<C>(
    metadata: nft::Nft<C>,
    supply: u64,
    ctx: &mut tx_context::TxContext,
)

Create Metadata with regulated supply and transfer to transaction sender

Does not require that collection itself is regulated as Metadata supply is independently regulated.

public fun is_regulated<C>(
    metadata: &metadata::Metadata<C>,
): bool

Returns whether Metadata has a regulated supply

public fun borrow_metadata<C>(
    metadata: &metadata::Metadata<C>,
): &nft::Nft<C>

Returns the Metadata Nft

public fun borrow_supply<C>(
    metadata: &metadata::Metadata<C>,
): &supply::Supply

Returns the Metadata supply

Panics

Panics if Metadata supply is unregulated

public entry fun freeze_supply<C>(
    metadata: &mut metadata::Metadata<C>,
)

Freeze Metadata supply

public fun delegate_regulated<C>(
    mint_cap: mint_cap::RegulatedMintCap<C>,
    metadata: &mut metadata::Metadata<C>,
    ctx: &mut tx_context::TxContext,
): loose_mint_cap::LooseMintCap<C>

Delegates metadata minting rights while maintaining Collection and Metadata level supply invariants.

The argument of RegulatedMintCap implies that supply is at least controlled at the Collection level.

Panics

Panics if Metadata supply is exceeded if Metadata is regulated.

public fun delegate_unregulated<C>(
    mint_cap: mint_cap::UnregulatedMintCap<C>,
    metadata: &mut metadata::Metadata<C>,
    ctx: &mut tx_context::TxContext,
): loose_mint_cap::LooseMintCap<C>

Delegates metadata minting rights while maintaining Collection and Metadata level supply invariants.

The argument of RegulatedMintCap implies that supply is unregulated at the Collection level.

public fun assert_regulated<C>(
    metadata: &metadata::Metadata<C>,
)

Asserts that Metadata has a regulated supply

public fun assert_unregulated<C>(
    metadata: &metadata::Metadata<C>,
)

Asserts that Metadata has a regulated supply