Skip to content

Commit d2175da

Browse files
committed
Remove tutorial and code snippets for paying transaction fees with different tokens
1 parent 8949721 commit d2175da

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

.snippets/code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction-output.html renamed to .snippets/code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction-output.html

File renamed without changes.

.snippets/code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction.ts renamed to .snippets/code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction.ts

File renamed without changes.

tutorials/interoperability/.nav.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ nav:
55
- xcm-transfers
66
- 'Replay and Dry Run XCMs': replay-and-dry-run-xcms.md
77
- 'XCM Fee Estimation': xcm-fee-estimation.md
8-
- 'Pay Transaction Fees with Different Tokens': pay-tx-with-different-fees.md

tutorials/polkadot-sdk/system-chains/asset-hub/.nav.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ nav:
44
- 'Register a Local Asset': register-local-asset.md
55
- 'Register a Foreign Asset': register-foreign-asset.md
66
- 'Convert Assets': 'asset-conversion.md'
7+
- 'Send a Transaction Paying Fees with Different Tokens': send-tx-paying-fees-with-different-tokens.md

tutorials/interoperability/pay-tx-with-different-fees.md renamed to tutorials/polkadot-sdk/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Before running the script, you'll need to fork the Asset Hub locally using Chops
6666
chopsticks -c polkadot-asset-hub
6767
```
6868
69-
This command will fork the Asset Hub chain and make it available at `ws://localhost:8000`.
69+
This command forks the Asset Hub chain, making it available at `ws://localhost:8000`. By running `polkadot-asset-hub`, you're using the Asset Hub fork with the configuration specified in the [`polkadot-asset-hub.yml`](https://github.com/AcalaNetwork/chopsticks/blob/master/configs/polkadot-asset-hub.yml){target=_blank} file. This configuration defines the Alice account with USDT assets. If you want to use a different chain, ensure the account you're using has the necessary assets.
7070
7171
## Implementation
7272
@@ -77,23 +77,23 @@ Now let's implement the fee payment transaction step by step.
7777
Add the following imports to your `fee-payment-transaction.ts` file:
7878

7979
```typescript title="fee-payment-transaction.ts"
80-
--8<-- "code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction.ts:1:12"
80+
--8<-- "code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction.ts:1:12"
8181
```
8282

8383
### Define Constants
8484

8585
Define the constants for your transaction:
8686

8787
```typescript title="fee-payment-transaction.ts"
88-
--8<-- "code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction.ts:14:16"
88+
--8<-- "code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction.ts:14:16"
8989
```
9090

9191
### Create Signer
9292

9393
Create a signer using Alice's development account:
9494
9595
```typescript title="fee-payment-transaction.ts"
96-
--8<-- "code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction.ts:18:29"
96+
--8<-- "code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction.ts:18:29"
9797
```
9898
9999
This function will return a signer that can be used to sign the transaction.
@@ -103,15 +103,15 @@ This function will return a signer that can be used to sign the transaction.
103103
Create the client connection to the local Asset Hub:
104104
105105
```typescript title="fee-payment-transaction.ts"
106-
--8<-- "code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction.ts:31:37"
106+
--8<-- "code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction.ts:31:37"
107107
```
108108
109109
### Create the Transaction
110110
111111
Create a standard DOT transfer transaction:
112112
113113
```typescript title="fee-payment-transaction.ts"
114-
--8<-- "code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction.ts:39:42"
114+
--8<-- "code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction.ts:39:42"
115115
```
116116
117117
This creates a transaction that transfers 3 DOT to Bob's address while keeping Alice's account alive.
@@ -121,7 +121,7 @@ This creates a transaction that transfers 3 DOT to Bob's address while keeping A
121121
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:
122122
123123
```typescript title="fee-payment-transaction.ts"
124-
--8<-- "code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction.ts:44:69"
124+
--8<-- "code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction.ts:44:69"
125125
```
126126
127127
This specifies that the fees should be paid using the USDT asset.
@@ -133,28 +133,22 @@ The full code for the complete implementation is the following:
133133
??? code "Complete Code"
134134
135135
```typescript title="fee-payment-transaction.ts"
136-
--8<-- "code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction.ts"
136+
--8<-- "code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction.ts"
137137
```
138138
139139
## Running the Script
140140
141-
1. Make sure Chopsticks is running with the Asset Hub fork:
141+
To run the script:
142142
143-
```bash
144-
chopsticks -c polkadot-asset-hub
145-
```
146-
147-
2. Run the script:
148-
149-
```bash
150-
npx ts-node fee-payment-transaction.ts
151-
```
143+
```bash
144+
npx ts-node fee-payment-transaction.ts
145+
```
152146
153147
## Expected Output
154148
155149
When you run the script successfully, you should see output similar to:
156150
157-
--8<-- "code/tutorials/interoperability/pay-tx-with-different-fees/fee-payment-transaction-output.html"
151+
--8<-- "code/tutorials/polkadot-sdk/parachains/system-chains/asset-hub/send-tx-paying-fees-with-different-tokens/fee-payment-transaction-output.html"
158152
159153
The key events to look for are:
160154

0 commit comments

Comments
 (0)