Transfer

Trait Transfer 

Source
pub trait Transfer {
    type Balance;
    type Sender;
    type Beneficiary;
    type AssetKind;
    type RemoteFeeAsset;
    type Id: FullCodec + MaxEncodedLen + TypeInfo + Clone + Eq + PartialEq + Debug + Copy;
    type Error: Debug;

    // Required methods
    fn transfer(
        from: &Self::Sender,
        to: &Self::Beneficiary,
        asset_kind: Self::AssetKind,
        amount: Self::Balance,
        remote_fee: Option<Self::RemoteFeeAsset>,
    ) -> Result<Self::Id, Self::Error>;
    fn check_transfer(id: Self::Id) -> PaymentStatus;
}
Expand description

Is intended to be implemented using a fungible impl, but can also be implemented with XCM/Asset and made generic over assets.

It is similar to the frame_support::traits::tokens::Pay, but it offers a variable source account for the payment.

Required Associated Types§

Source

type Balance

The type by which we measure units of the currency in which we make payments.

Source

type Sender

The type by which identify the payer involved in the transfer.

This is usually and AccountId or a Location.

Source

type Beneficiary

The type by which we identify the beneficiary involved in the transfer.

This is usually and AccountId or a Location.

Source

type AssetKind

The type for the kinds of asset that are going to be paid.

The unit type can be used here to indicate there’s only one kind of asset to do payments with. When implementing, it should be clear from the context what that asset is.

Source

type RemoteFeeAsset

Asset that is used to pay the xcm execution fees on the remote chain.

Source

type Id: FullCodec + MaxEncodedLen + TypeInfo + Clone + Eq + PartialEq + Debug + Copy

An identifier given to an individual payment.

Source

type Error: Debug

An error which could be returned by the Pay type

Required Methods§

Source

fn transfer( from: &Self::Sender, to: &Self::Beneficiary, asset_kind: Self::AssetKind, amount: Self::Balance, remote_fee: Option<Self::RemoteFeeAsset>, ) -> Result<Self::Id, Self::Error>

Make a payment and return an identifier for later evaluation of success in some off-chain mechanism (likely an event, but possibly not on this chain).

Source

fn check_transfer(id: Self::Id) -> PaymentStatus

Check how a payment has proceeded. id must have been previously returned by pay for the result of this call to be meaningful.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§