Trait frame_support::traits::tokens::nonfungibles::Destroy
source · [−]pub trait Destroy<AccountId>: Inspect<AccountId> {
type DestroyWitness;
fn get_destroy_witness(
class: &Self::ClassId
) -> Option<Self::DestroyWitness>;
fn destroy(
class: Self::ClassId,
witness: Self::DestroyWitness,
maybe_check_owner: Option<AccountId>
) -> Result<Self::DestroyWitness, DispatchError>;
}
Expand description
Trait for providing the ability to destroy classes of nonfungible assets.
Associated Types
type DestroyWitness
type DestroyWitness
The witness data needed to destroy an asset.
Required methods
fn get_destroy_witness(class: &Self::ClassId) -> Option<Self::DestroyWitness>
fn get_destroy_witness(class: &Self::ClassId) -> Option<Self::DestroyWitness>
Provide the appropriate witness data needed to destroy an asset.
fn destroy(
class: Self::ClassId,
witness: Self::DestroyWitness,
maybe_check_owner: Option<AccountId>
) -> Result<Self::DestroyWitness, DispatchError>
fn destroy(
class: Self::ClassId,
witness: Self::DestroyWitness,
maybe_check_owner: Option<AccountId>
) -> Result<Self::DestroyWitness, DispatchError>
Destroy an existing fungible asset.
class
: TheClassId
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 asset.
If successful, this function will return the actual witness data from the destroyed asset. This may be different than the witness data provided, and can be used to refund weight.