1

i am working on substrate i have created a custom token using pallet_assets,how can i configure the transaction_fee using the custom token i have seen the pallet_assets_transaction payment which say's

i have added pallet_asset_tx_payment to my runtime Config and construct_runtime & SignedExtension

After above implementation when i try to transfer the assets from account A to account B the fees is getting deducted from the native token.

i tried to add into pallet_transaction_payment::Config for Runtime can i do something like this?

type OnChargeTransaction = FungiblesAdapter<Balances,()>;

or is there any other way to do this? i have taken the reference from here but it did't work for me.

2
  • Can you elaborate a bit more on "it didn't work"? Apr 17, 2023 at 7:19
  • there was lots of errors,and i am not sure that is it the right way to do that Apr 17, 2023 at 7:21

1 Answer 1

2

Since you are not providing a lot of information it is hard to help you, but let me give you the main configurations you have to make in your runtime/src/lib.rs:

  1. For paying fees with custom token you'd want the pallet-asset-tx-payment in stead of the pallet-transaction-payment (native token). You can implement it like its done in Statemint.

  2. Adding it as a SignedExtension, like so.

  3. Adding it in the construct_runtime, like so.

9

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.