0x0::transfer_allowlist_domain

TransferAllowlistDomain tracks allowlist objects which can be used for transferring a collection's NFT.

Important

This domain is used for discovery by off-chain applications. It is not authoritative and it's the responsibility of the collection creator to keep it up to date.

Structs

transfer_allowlist_domain::TransferAllowlistDomain has store

Fields:

Name Type Description
allowlists vec_set::VecSet<object::ID>

TransferAllowlistDomain tracks allowlists which authorize transfer of NFTs.

This information is useful for off chain applications - discovery.

transfer_allowlist_domain::Witness has drop

Witness used to authenticate witness protected endpoints

Methods

public fun empty(): 
    transfer_allowlist_domain::TransferAllowlistDomain

Creates an empty TransferAllowlistDomain object

public fun from_id(id: object::ID): 
    transfer_allowlist_domain::TransferAllowlistDomain

Creates a TransferAllowlistDomain object with a single allowlist

public fun add_id<C>(
    _witness: witness::Witness<C>,
    collection: &mut collection::Collection<C>,
    al: &mut transfer_allowlist::Allowlist,
)

Adds new allowlist to TransferAllowlistDomain. Now, off chain clients can use this information to discover the ID and use it in relevant txs.

public fun remove_id<C>(
    _witness: witness::Witness<C>,
    collection: &mut collection::Collection<C>,
    id: object::ID,
)

Removes existing allowlist from TransferAllowlistDomain.

public entry fun add_id_with_cap<C>(
    _cap: &transfer_allowlist::CollectionControlCap<C>,
    collection: &mut collection::Collection<C>,
    al: &mut transfer_allowlist::Allowlist,
)

Like [add_id] but as an endpoint

public entry fun remove_id_with_cap<C>(
    _cap: &transfer_allowlist::CollectionControlCap<C>,
    collection: &mut collection::Collection<C>,
    id: object::ID,
)

Like [remove_id] but as an endpoint

public fun borrow_allowlists(
    domain: &transfer_allowlist_domain::TransferAllowlistDomain,
): &vec_set::VecSet<object::ID>

Returns the list of IDs defined on the TransferAllowlistDomain

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

Borrows TransferAllowlistDomain from Collection

Panics

Panics if TransferAllowlistDomain is not registered on Collection.

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

Asserts that TransferAllowlistDomain is defined on the Collection

Panics

Panics if TransferAllowlistDomain is not defined on the Collection.