Skip to content

XcmPaymentApi::query_delivery_fees() should allow querying fee using custom asset #7061

Open
@acatangiu

Description

@acatangiu

The current XcmPaymentApi::query_delivery_fees() strictly returns fee required in native assets.

fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result<VersionedAssets, Error>;

But the delivery fee can also be paid using assets other than native.

I suggest enhancing the API with an optional asset specifier so that users/dapps can directly query the fee in their desired asset:

- fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result<VersionedAssets, Error>;
+ fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>, asset: Option<VersionedAssetId>) -> Result<VersionedAssets, Error>;

or to be aligned with XcmPaymentApi::query_weight_to_asset_fee()

- fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result<VersionedAssets, Error>;
+ fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>, asset: VersionedAssetId) -> Result<u128, Error>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.T6-XCMThis PR/Issue is related to XCM.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions