referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::traits::AccountTouch

pub trait AccountTouch<AssetId, AccountId> {
    type Balance;

    // Required methods
    fn deposit_required(asset: AssetId) -> Self::Balance;
    fn should_touch(asset: AssetId, who: &AccountId) -> bool;
    fn touch(
        asset: AssetId,
        who: &AccountId,
        depositor: &AccountId,
    ) -> Result<(), DispatchError>;
}
Expand description

Trait for touching/creating an asset account with a deposit taken from a designated depositor specified by the client.

Ensures that transfers to the touched account will succeed without being denied by the account creation requirements. For example, it is useful for the account creation of non-sufficient assets when its system account may not have the free consumer reference required for it. If there is no risk of failing to meet those requirements, the touch operation can be a no-op, as is common for native assets.

Required Associated Types§

type Balance

The type for currency units of the deposit.

Required Methods§

fn deposit_required(asset: AssetId) -> Self::Balance

The deposit amount of a native currency required for touching an account of the asset.

fn should_touch(asset: AssetId, who: &AccountId) -> bool

Check if an account for a given asset should be touched to meet the existence requirements.

fn touch( asset: AssetId, who: &AccountId, depositor: &AccountId, ) -> Result<(), DispatchError>

Create an account for who of the asset with a deposit taken from the depositor.

Object Safety§

This trait is not object safe.

Implementors§

§

impl<Left, Right, Criterion, AssetKind, AccountId> AccountTouch<AssetKind, AccountId> for polkadot_sdk_frame::traits::tokens::fungible::UnionOf<Left, Right, Criterion, AssetKind, AccountId>
where Left: Inspect<AccountId> + AccountTouch<(), AccountId, Balance = <Left as Inspect<AccountId>>::Balance>, Right: Inspect<AccountId> + AccountTouch<<Right as Inspect<AccountId>>::AssetId, AccountId, Balance = <Left as Inspect<AccountId>>::Balance>, Criterion: Convert<AssetKind, Either<(), <Right as Inspect<AccountId>>::AssetId>>, AssetKind: AssetId,

§

type Balance = <Left as Inspect<AccountId>>::Balance

§

impl<Left, Right, Criterion, AssetKind, AccountId> AccountTouch<AssetKind, AccountId> for polkadot_sdk_frame::traits::tokens::fungibles::UnionOf<Left, Right, Criterion, AssetKind, AccountId>
where Left: Inspect<AccountId> + AccountTouch<<Left as Inspect<AccountId>>::AssetId, AccountId>, Right: Inspect<AccountId> + AccountTouch<<Right as Inspect<AccountId>>::AssetId, AccountId, Balance = <Left as AccountTouch<<Left as Inspect<AccountId>>::AssetId, AccountId>>::Balance>, Criterion: Convert<AssetKind, Either<<Left as Inspect<AccountId>>::AssetId, <Right as Inspect<AccountId>>::AssetId>>, AssetKind: AssetId,

§

type Balance = <Left as AccountTouch<<Left as Inspect<AccountId>>::AssetId, AccountId>>::Balance