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
type Balance
The type for currency units of the deposit.
Required Methods§
fn 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
.
fn 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.
fn touch(
asset: AssetId,
who: &AccountId,
depositor: &AccountId,
) -> Result<(), DispatchError>
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
.