#pallet #substrate #blockchain

no-std pallet-asset-conversion-tx-payment

Pallet to manage transaction payments in assets by converting them to native assets

25 releases (major breaking)

new 21.1.0 Mar 27, 2025
20.0.0 Sep 26, 2024
19.0.0 Jul 18, 2024
18.0.0 Jul 12, 2024
0.1.0-dev.2 Jul 27, 2023

#422 in Magic Beans

Download history 28952/week @ 2024-12-08 21819/week @ 2024-12-15 5976/week @ 2024-12-22 11905/week @ 2024-12-29 21369/week @ 2025-01-05 32347/week @ 2025-01-12 30675/week @ 2025-01-19 25973/week @ 2025-01-26 29050/week @ 2025-02-02 33158/week @ 2025-02-09 33237/week @ 2025-02-16 10694/week @ 2025-02-23 3624/week @ 2025-03-02 4664/week @ 2025-03-09 2797/week @ 2025-03-16 3493/week @ 2025-03-23

14,761 downloads per month
Used in 19 crates (4 directly)

Apache-2.0

3MB
47K SLoC

pallet-asset-conversion-tx-payment

Asset Conversion Transaction Payment Pallet

This pallet allows runtimes that include it to pay for transactions in assets other than the native token of the chain.

Overview

It does this by extending transactions to include an optional AssetId that specifies the asset to be used for payment (defaulting to the native token on None). It expects an OnChargeAssetTransaction implementation analogously to pallet-transaction-payment. The included AssetConversionAdapter (implementing OnChargeAssetTransaction) determines the fee amount by converting the fee calculated by pallet-transaction-payment into the desired asset.

Integration

This pallet wraps FRAME's transaction payment pallet and functions as a replacement. This means you should include both pallets in your construct_runtime macro, but only include this pallet's TransactionExtension (ChargeAssetTxPayment).

License: Apache-2.0

Release

Polkadot SDK Stable 2412

Dependencies

~20–35MB
~588K SLoC