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

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

23 releases (major breaking)

20.0.0 Sep 26, 2024
19.0.0 Jul 18, 2024
18.0.0 Jul 12, 2024
17.0.0 Jun 24, 2024
0.1.0-dev.2 Jul 27, 2023
Download history 289/week @ 2024-07-03 672/week @ 2024-07-10 558/week @ 2024-07-17 642/week @ 2024-07-24 631/week @ 2024-07-31 474/week @ 2024-08-07 561/week @ 2024-08-14 910/week @ 2024-08-21 553/week @ 2024-08-28 450/week @ 2024-09-04 609/week @ 2024-09-11 458/week @ 2024-09-18 713/week @ 2024-09-25 628/week @ 2024-10-02 637/week @ 2024-10-09 1052/week @ 2024-10-16

3,142 downloads per month
Used in 5 crates (4 directly)

Apache-2.0

2.5MB
42K 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 SignedExtension (ChargeAssetTxPayment).

License: Apache-2.0

Release

Polkadot SDK stable2409

Dependencies

~18–33MB
~551K SLoC