referrerpolicy=no-referrer-when-downgrade
frame_support::traits::tokens::nonfungibles

Trait Destroy

Source
pub trait Destroy<AccountId>: Inspect<AccountId> {
    type DestroyWitness;

    // Required methods
    fn get_destroy_witness(
        collection: &Self::CollectionId,
    ) -> Option<Self::DestroyWitness>;
    fn destroy(
        collection: Self::CollectionId,
        witness: Self::DestroyWitness,
        maybe_check_owner: Option<AccountId>,
    ) -> Result<Self::DestroyWitness, DispatchError>;
}
Expand description

Trait for providing the ability to destroy collections of nonfungible items.

Required Associated Types§

Source

type DestroyWitness

The witness data needed to destroy an item.

Required Methods§

Source

fn get_destroy_witness( collection: &Self::CollectionId, ) -> Option<Self::DestroyWitness>

Provide the appropriate witness data needed to destroy an item.

Source

fn destroy( collection: Self::CollectionId, witness: Self::DestroyWitness, maybe_check_owner: Option<AccountId>, ) -> Result<Self::DestroyWitness, DispatchError>

Destroy an existing fungible item.

  • collection: The CollectionId to be destroyed.
  • witness: Any witness data that needs to be provided to complete the operation successfully.
  • maybe_check_owner: An optional account id that can be used to authorize the destroy command. If not provided, we will not do any authorization checks before destroying the item.

If successful, this function will return the actual witness data from the destroyed item. This may be different than the witness data provided, and can be used to refund weight.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

impl<T: Config<I>, I: 'static> Destroy<<T as Config>::AccountId> for Pallet<T, I>