Expand description
§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.
Re-exports§
pub use weights::WeightInfo;
pub use pallet::*;
Modules§
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - Autogenerated weights for
pallet_asset_conversion_tx_payment
Structs§
- Require payment for transaction inclusion and optionally include a tip to gain additional priority in the queue.
- Means to withdraw, correct and deposit fees in the asset accepted by the system.
Enums§
- Used to pass the initial payment info from pre- to post-dispatch.
- The info passed between the prepare and post-dispatch steps for the
ChargeAssetTxPayment
extension. - The info passed between the validate and prepare steps for the
ChargeAssetTxPayment
extension.
Traits§
- Handle withdrawing, refunding and depositing of transaction fees.