31 major breaking releases

new 34.0.0 May 23, 2024
33.0.0 May 1, 2024
32.0.0 Apr 8, 2024
31.0.0 Mar 18, 2024
0.0.0 Nov 21, 2022

#859 in Magic Beans

Download history 277/week @ 2024-01-30 338/week @ 2024-02-06 1141/week @ 2024-02-13 1696/week @ 2024-02-20 1356/week @ 2024-02-27 585/week @ 2024-03-05 717/week @ 2024-03-12 1075/week @ 2024-03-19 742/week @ 2024-03-26 625/week @ 2024-04-02 807/week @ 2024-04-09 660/week @ 2024-04-16 623/week @ 2024-04-23 756/week @ 2024-04-30 539/week @ 2024-05-07 797/week @ 2024-05-14

2,772 downloads per month
Used in 40 crates (5 directly)

Apache-2.0

2.5MB
46K SLoC

pallet-asset-tx-payment

Asset 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 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 SignedExtension (ChargeAssetTxPayment).

License: Apache-2.0


lib.rs:

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 SignedExtension (ChargeAssetTxPayment).

Dependencies

~18–33MB
~550K SLoC