Trait frame_support::traits::AccountTouch

source ·
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,
    ) -> DispatchResult;
}
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§

source

type Balance

The type for currency units of the deposit.

Required Methods§

source

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

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

source

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

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

source

fn touch( asset: AssetId, who: &AccountId, depositor: &AccountId, ) -> DispatchResult

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

Object Safety§

This trait is not object safe.

Implementors§

source§

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

§

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

source§

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

§

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