Trait XcmPaymentApiV1
pub trait XcmPaymentApiV1<Block>where
Block: Block,{
// Required methods
fn query_acceptable_payment_assets(
xcm_version: u32,
) -> Result<Vec<VersionedAssetId>, Error>;
fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, Error>;
fn query_weight_to_asset_fee(
weight: Weight,
asset: VersionedAssetId,
) -> Result<u128, Error>;
fn query_delivery_fees(
destination: VersionedLocation,
message: VersionedXcm<()>,
) -> Result<VersionedAssets, Error>;
}
Expand description
A trait of XCM payment API.
API provides functionality for obtaining:
- the weight required to execute an XCM message,
- a list of acceptable
AssetId
s for message execution payment, - the cost of the weight in the specified acceptable
AssetId
. - the fees for an XCM message delivery.
To determine the execution weight of the calls required for
[xcm::latest::Instruction::Transact
] instruction, TransactionPaymentCallApi
can be used.
Required Methods§
fn query_acceptable_payment_assets(
xcm_version: u32,
) -> Result<Vec<VersionedAssetId>, Error>
fn query_acceptable_payment_assets( xcm_version: u32, ) -> Result<Vec<VersionedAssetId>, Error>
fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, Error>
fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, Error>
fn query_weight_to_asset_fee(
weight: Weight,
asset: VersionedAssetId,
) -> Result<u128, Error>
fn query_weight_to_asset_fee( weight: Weight, asset: VersionedAssetId, ) -> Result<u128, Error>
Converts a weight into a fee for the specified AssetId
.
§Arguments
weight
: convertibleWeight
.asset
:VersionedAssetId
.
fn query_delivery_fees(
destination: VersionedLocation,
message: VersionedXcm<()>,
) -> Result<VersionedAssets, Error>
fn query_delivery_fees( destination: VersionedLocation, message: VersionedXcm<()>, ) -> Result<VersionedAssets, Error>
Get delivery fees for sending a specific message
to a destination
.
These always come in a specific asset, defined by the chain.
§Arguments
message
: The message that’ll be sent, necessary because most delivery fees are based on the size of the message.destination
: The destination to send the message to. Different destinations may use different senders that charge different fees.
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.