# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 # See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json title: "XCM fee payment API" doc: - audience: Runtime Dev description: | A runtime API was added for estimating the fees required for XCM execution and delivery. This is the basic building block needed for UIs to accurately estimate fees. An example implementation is shown in the PR. Ideally it's simple to implement, you only need to call existing parts of your XCM config. The API looks like so: ```rust fn query_acceptable_payment_assets(xcm_version: Version) -> Result, Error>; fn query_xcm_weight(message: VersionedXcm) -> Result; fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result; fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result; ``` The first three relate to XCM execution fees, given an XCM, you can query its weight, then which assets are acceptable for buying weight and convert weight to a number of those assets. The last one takes in a destination and a message you want to send from the runtime you're executing this on, it will give you the delivery fees. crates: - name: xcm-fee-payment-runtime-api - name: rococo-runtime - name: westend-runtime