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
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.
Provided Methods§
sourcefn query_acceptable_payment_assets(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
xcm_version: Version,
) -> Result<Result<Vec<VersionedAssetId>, Error>, ApiError>
fn query_acceptable_payment_assets( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, xcm_version: Version, ) -> Result<Result<Vec<VersionedAssetId>, Error>, ApiError>
sourcefn query_xcm_weight(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
message: VersionedXcm<()>,
) -> Result<Result<Weight, Error>, ApiError>
fn query_xcm_weight( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, message: VersionedXcm<()>, ) -> Result<Result<Weight, Error>, ApiError>
sourcefn 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_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
: convertibleWeight
.asset
:VersionedAssetId
.
sourcefn query_delivery_fees(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
destination: VersionedLocation,
message: VersionedXcm<()>,
) -> Result<Result<VersionedAssets, Error>, ApiError>
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.