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§
Required Methods§
sourcefn deposit_required(asset: AssetId) -> Self::Balance
fn deposit_required(asset: AssetId) -> Self::Balance
The deposit amount of a native currency required for touching an account of the asset
.
sourcefn should_touch(asset: AssetId, who: &AccountId) -> bool
fn should_touch(asset: AssetId, who: &AccountId) -> bool
Check if an account for a given asset should be touched to meet the existence requirements.
sourcefn touch(
asset: AssetId,
who: &AccountId,
depositor: &AccountId,
) -> DispatchResult
fn touch( asset: AssetId, who: &AccountId, depositor: &AccountId, ) -> DispatchResult
Create an account for who
of the asset
with a deposit taken from the depositor
.