You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Send Transaction Paying Fees with Different Tokens
29998
+
description: This tutorial demonstrates how to send a DOT transfer transaction while paying the fees using a different token on the Asset Hub.
29999
+
---
30000
+
30001
+
# Send Transaction Paying Fees with Different Tokens
30002
+
30003
+
## Introduction
30004
+
30005
+
The Asset Hub provides a powerful feature that allows users to pay transaction fees using alternative tokens instead of the native token of the chain.
30006
+
30007
+
This tutorial demonstrates how to send a DOT transfer transaction while paying the fees using a different token (USDT in this example) on the Asset Hub.
30008
+
30009
+
## Environment Setup
30010
+
30011
+
Let's set up the development environment for this tutorial:
30012
+
30013
+
1. Create a new directory and initialize the project:
This creates a transaction that transfers 3 DOT to Bob's address while keeping Alice's account alive.
30146
+
30147
+
### Sign and Submit with Alternative Fee Payment
30148
+
30149
+
The key part of this tutorial is specifying an alternative asset for fee payment. This is done through the `asset` parameter in the `signAndSubmit` options:
Block: #9645060 0x57710514f168b5c444c8e47b1e1a31dd9e7bc7e9a51d8d25ccdbc6053e159f6b [tx index 2]
30283
+
Events:
30284
+
- Assets
30285
+
- Balances
30286
+
- Assets
30287
+
- AssetConversion
30288
+
- Balances
30289
+
- Balances
30290
+
- AssetTxPayment
30291
+
- System
30292
+
</pre>
30293
+
</div>
30294
+
30295
+
The key events to look for are:
30296
+
30297
+
- **Assets**: The asset was transferred
30298
+
- **Balances**: The fees were paid using the alternative asset
30299
+
- **AssetConversion**: The fees were converted to the alternative asset
30300
+
- **AssetTxPayment**: The fees were paid using the alternative asset
30301
+
- **System**: The transaction was successful
30302
+
30303
+
## Conclusion
30304
+
30305
+
Paying transaction fees with alternative tokens on Asset Hub provides significant flexibility for users and applications.
30306
+
30307
+
The key takeaway is understanding how to specify alternative assets using the XCM location format, which opens up possibilities for building applications that can operate entirely using specific token ecosystems while still leveraging the full power of the network.
Copy file name to clipboardExpand all lines: llms.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,7 @@
178
178
- [PAPI Account Watcher Tutorial](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/dapps/remark-tutorial.md): Build a CLI app that listens to on-chain events using the Polkadot API and responds to specific messages for a given account.
179
179
- [Tutorials](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/index.md): Explore step-by-step tutorials for building in Polkadot, from parachain deployment and testing to cross-chain asset creation and XCM channel management.
180
180
- [Interoperability Tutorials](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/interoperability/index.md): Explore tutorials on interoperability for Polkadot SDK-based blockchains, covering cross-chain communication and integration techniques.
181
+
- [Send Transaction Paying Fees with Different Tokens](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/interoperability/pay-tx-with-different-fees.md): This tutorial demonstrates how to send a DOT transfer transaction while paying the fees using a different token on the Asset Hub.
181
182
- [Replay and Dry Run XCMs](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/interoperability/replay-and-dry-run-xcms.md): Replay and dry-run XCMs using Chopsticks with full logging enabled. Diagnose issues, trace message flow, and debug complex cross-chain interactions.
182
183
- [Tutorials for Managing XCM Channels](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/interoperability/xcm-channels/index.md): Learn step-by-step how to establish unidirectional and bidirectional HRMP channels between parachains and system parachains using XCM.
183
184
- [Opening HRMP Channels Between Parachains](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/interoperability/xcm-channels/para-to-para.md): Learn how to open HRMP channels between parachains on Polkadot. Discover the step-by-step process for establishing uni- and bidirectional communication.
0 commit comments