referrerpolicy=no-referrer-when-downgrade

Trait xcm_runtime_apis::fees::XcmPaymentApi

source ·
pub trait XcmPaymentApi<Block: BlockT>: Core<Block> {
    // Provided methods
    fn query_acceptable_payment_assets(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        xcm_version: Version,
    ) -> Result<Result<Vec<VersionedAssetId>, Error>, ApiError> { ... }
    fn query_xcm_weight(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        message: VersionedXcm<()>,
    ) -> Result<Result<Weight, Error>, ApiError> { ... }
    fn query_weight_to_asset_fee(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        weight: Weight,
        asset: VersionedAssetId,
    ) -> Result<Result<u128, Error>, ApiError> { ... }
    fn query_delivery_fees(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        destination: VersionedLocation,
        message: VersionedXcm<()>,
    ) -> Result<Result<VersionedAssets, Error>, ApiError> { ... }
}
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 AssetIds 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.

Provided Methods§

source

fn query_acceptable_payment_assets( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, xcm_version: Version, ) -> Result<Result<Vec<VersionedAssetId>, Error>, ApiError>

Returns a list of acceptable payment assets.

§Arguments
  • xcm_version: Version.
source

fn query_xcm_weight( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, message: VersionedXcm<()>, ) -> Result<Result<Weight, Error>, ApiError>

Returns a weight needed to execute a XCM.

§Arguments
  • message: VersionedXcm.
source

fn query_weight_to_asset_fee( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, weight: Weight, asset: VersionedAssetId, ) -> Result<Result<u128, Error>, ApiError>

Converts a weight into a fee for the specified AssetId.

§Arguments
  • weight: convertible Weight.
  • asset: VersionedAssetId.
source

fn query_delivery_fees( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, destination: VersionedLocation, message: VersionedXcm<()>, ) -> Result<Result<VersionedAssets, Error>, ApiError>

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.

Trait Implementations§

source§

impl<Block: BlockT> RuntimeApiInfo for dyn XcmPaymentApi<Block>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§