Crate pallet_asset_tx_payment
source ·Expand description
§Asset Transaction Payment Pallet
This pallet allows runtimes that include it to pay for transactions in assets other than the main 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 FungiblesAdapter
(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
).
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_tx_payment
Structs§
- Require the transactor pay for themselves and maybe include a tip to gain additional priority in the queue. Allows paying via both
Currency
as well asfungibles::Balanced
. - Implements the asset transaction for a balance to asset converter (implementing [
ConversionToAssetBalance
]) and a credit handler (implementingHandleCredit
).
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§
- Allows specifying what to do with the withdrawn asset fees.
- Handle withdrawing, refunding and depositing of transaction fees.