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§
Sourcetype Sender
type Sender
The type by which identify the payer involved in the transfer.
This is usually and AccountId or a Location.
Sourcetype Beneficiary
type Beneficiary
The type by which we identify the beneficiary involved in the transfer.
This is usually and AccountId or a Location.
Sourcetype AssetKind
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.
Sourcetype RemoteFeeAsset
type RemoteFeeAsset
Asset that is used to pay the xcm execution fees on the remote chain.
Required Methods§
Sourcefn 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 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).
Sourcefn check_transfer(id: Self::Id) -> PaymentStatus
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.