0x0::metadata_bag

Structs

metadata_bag::Witness has drop

metadata_bag::MetadataBagDomain<C> has store, key

Fields:

Name Type Description
id object::UID
table object_table::ObjectTable<object::ID, metadata::Metadata<C>>

MetadataBagDomain object

Methods

public fun new_metadata_bag<C>(
    ctx: &mut tx_context::TxContext,
): metadata_bag::MetadataBagDomain<C>

Create a MetadataBagDomain object

public fun init_metadata_bag<C, W>(
    witness: &W,
    collection: &mut collection::Collection<C>,
    ctx: &mut tx_context::TxContext,
)

Create a MetadataBagDomain object and register on Collection

public fun contains_metadata<C>(
    metadata_bag: &metadata_bag::MetadataBagDomain<C>,
    metadata_id: object::ID,
): bool

Returns whether Metadata with ID is registered on MetadataBagDomain

public fun borrow_metadata<C>(
    metadata_bag: &metadata_bag::MetadataBagDomain<C>,
    metadata_id: object::ID,
): &metadata::Metadata<C>

Borrows Metadata from MetadataBagDomain

Panics

Panics if Metadata does not exist on MetadataBagDomain.

public entry fun add_metadata<C>(
    _mint_cap: &mint_cap::MintCap<C>,
    metadata_bag: &mut metadata_bag::MetadataBagDomain<C>,
    metadata: metadata::Metadata<C>,
)

Add Metadata to MetadataBagDomain

public entry fun freeze_metadata_supply<C>(
    collection: &mut collection::Collection<C>,
    metadata_id: object::ID,
)

Freeze Metadata supply in Collection

public fun is_archetypal<C>(
    collection: &collection::Collection<C>,
): bool

Return whether Collection has defined an metadata MetadataBagDomain

public fun add_metadata_bag<C, W>(
    witness: &W,
    collection: &mut collection::Collection<C>,
    metadata_bag: metadata_bag::MetadataBagDomain<C>,
)

Add MetadataBagDomain to Collection

public fun borrow_metagada_bag<C>(
    collection: &collection::Collection<C>,
): &metadata_bag::MetadataBagDomain<C>

Borrows MetadataBagDomain from Collection

Panics

Panics if Collection does not have a MetadataBagDomain.

public entry fun add_metadata_to_collection<C>(
    _mint_cap: &mint_cap::MintCap<C>,
    collection: &mut collection::Collection<C>,
    metadata: metadata::Metadata<C>,
)

Add Metadata to Collection

Panics

Panics if Collection does not have a MetadataBagDomain.

public fun delegate_regulated<C>(
    mint_cap: mint_cap::RegulatedMintCap<C>,
    collection: &mut collection::Collection<C>,
    metadata_id: object::ID,
    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 MetadataBagDomain is not registered on Collection or Metadata does not exist.

public fun delegate_unregulated<C>(
    mint_cap: mint_cap::UnregulatedMintCap<C>,
    collection: &mut collection::Collection<C>,
    metadata_id: object::ID,
    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 MetadataBagDomain is not registered on Collection or Metadata does not exist.

public fun assert_archetypal<C>(
    collection: &collection::Collection<C>,
)

Asserts that Collection has a defined MetadataBagDomain

public fun assert_metadata<C>(
    metadata_bag: &metadata_bag::MetadataBagDomain<C>,
    metadata_id: object::ID,
)

Asserts that Metadata with ID is registered on MetadataBagDomain