36 releases (major breaking)
| 30.0.0 | May 21, 2026 |
|---|---|
| 29.0.0 | May 3, 2026 |
| 28.0.0 | Mar 28, 2026 |
| 27.0.1 | Jan 22, 2026 |
| 0.1.0-dev.2 | Jul 27, 2023 |
#3 in #asset-id
20,656 downloads per month
Used in 36 crates
(6 directly)
3MB
53K
SLoC
Asset Conversion Transaction Payment Pallet
This pallet allows runtimes that include it to pay for transactions in assets other than the chain's native asset.
Overview
This pallet provides a TransactionExtension with an optional AssetId that specifies the
asset to be used for payment (defaulting to the native token on None). It expects an
OnChargeAssetTransaction implementation analogous to pallet-transaction-payment. The
included SwapAssetAdapter (implementing OnChargeAssetTransaction) determines the
fee amount by converting the fee calculated by pallet-transaction-payment in the native
asset into the amount required of the specified asset.
Pallet API
This pallet does not have any dispatchable calls or storage. It 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).
Terminology
- Native Asset or Native Currency: The asset that a chain considers native, as in its default for transaction fee payment, deposits, inflation, etc.
- Other assets: Other assets that may exist on chain, for example under the Assets pallet.
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
Dependencies
~28–42MB
~722K SLoC