referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::traits::tokens::fungibles::Refund

pub trait Refund<AccountId> {
    type AssetId: AssetId;
    type Balance: Balance;

    // Required methods
    fn deposit_held(
        id: Self::AssetId,
        who: AccountId,
    ) -> Option<(AccountId, Self::Balance)>;
    fn refund(id: Self::AssetId, who: AccountId) -> Result<(), DispatchError>;
}
Expand description

Trait for refunding the existence deposit of a target asset account.

The existence deposit might by necessary and present in cases where the asset held by the account is insufficient for the required storage, or when the system cannot provide a consumer reference for any reason.

Required Associated Types§

type AssetId: AssetId

Means of identifying one asset class from another.

type Balance: Balance

Scalar type for representing deposit balance of an account.

Required Methods§

fn deposit_held( id: Self::AssetId, who: AccountId, ) -> Option<(AccountId, Self::Balance)>

Returns the amount of account deposit and depositor address, if any.

fn refund(id: Self::AssetId, who: AccountId) -> Result<(), DispatchError>

Return the deposit (if any) of a target asset account.

Object Safety§

This trait is not object safe.

Implementors§

§

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

§

type AssetId = AssetKind

§

type Balance = <Right as Refund<AccountId>>::Balance

§

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

§

type AssetId = AssetKind

§

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