Skip to content

Commit f853a15

Browse files
committed
Update content
1 parent fedd3ee commit f853a15

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

.snippets/code/develop/toolkit/interoperability/paraspell/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ async function transfer() {
4343

4444
const result = await tx.signAndSubmit(signer);
4545
console.log(inspect(result, { colors: true, depth: null }));
46+
process.exit(0);
4647
}
4748

4849
async function dryRunTransfer() {
@@ -63,6 +64,7 @@ async function dryRunTransfer() {
6364
.dryRun();
6465

6566
console.log(inspect(tx, { colors: true, depth: null }));
67+
process.exit(0);
6668
}
6769

6870
dryRunTransfer();
@@ -80,6 +82,7 @@ async function verifyED() {
8082
.verifyEdOnDestination();
8183

8284
console.log(`ED verification ${isValid ? 'successful' : 'failed'}.`);
85+
process.exit(0);
8386
}
8487

8588
verifyED();
@@ -97,6 +100,7 @@ async function XcmTransferInfo() {
97100
.getTransferInfo();
98101

99102
console.log('Transfer Info:', info);
103+
process.exit(0);
100104
}
101105

102106
XcmTransferInfo();

develop/toolkit/interoperability/paraspell-xcm-sdk/transfer-tokens-between-parachains.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ description: A step-by-step guide to building, verifying, and executing a transf
77

88
## Introduction
99

10-
This guide walks you through transferring tokens between two parachains using the [ParaSpell XCM SDK](https://paraspell.github.io/docs/){target=\_blank}. This example uses [Asset Hub](/polkadot-protocol/architecture/system-chains/asset-hub/){target=\_blank} and the [People Chain](/polkadot-protocol/architecture/system-chains/people/){target=\_blank}, but the same approach applies to transfers between any parachain.
10+
This guide walks you through transferring tokens between two parachains using the [ParaSpell XCM SDK](https://paraspell.github.io/docs/){target=\_blank}. This example uses [Asset Hub](/polkadot-protocol/architecture/system-chains/asset-hub/){target=\_blank} and the [People Chain](/polkadot-protocol/architecture/system-chains/people/){target=\_blank}, but the same approach can apply to transfers between other parachains.
1111

1212
For development purposes, this guide will use the [Polkadot TestNet](/develop/networks/#paseo){target=\_blank}, so the transferred token will be PAS.
1313

14-
You’ll learn how to:
14+
In this guide, you’ll learn how to:
1515

1616
- Build an XCM transfer transaction using ParaSpell XCM SDK.
1717
- Perform a dry run to validate the transfer.
@@ -24,7 +24,7 @@ You’ll learn how to:
2424
- Knowledge of the [fundamentals of Polkadot](/polkadot-protocol/parachain-basics/){target=\_blank}
2525
- Basic understanding of [XCM](/develop/interoperability/intro-to-xcm/){target=\_blank}
2626
- Basic familiarity with JavaScript/TypeScript
27-
- Install [bun](https://bun.com/docs/installation){target=\_blank}, a fast JavaScript/TypeScript runtime and package manager
27+
- Install [bun](https://bun.com/docs/installation){target=\_blank}, a JavaScript/TypeScript package manager
2828

2929
## Initialize Your Project
3030

@@ -69,7 +69,7 @@ In this example, you will transfer 10 PAS tokens from Paseo's Asset Hub to Paseo
6969
Add the ParaSpell transaction code to your `index.ts` file:
7070

7171
```ts title="index.ts"
72-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:29:46'
72+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:29:47'
7373
```
7474

7575
Do not execute it just yet. You will perform a dry run of this transaction first to ensure it works as expected.
@@ -81,7 +81,7 @@ Dry runs simulate the transaction without broadcasting it, allowing you to confi
8181
Add the following dry run code to your `index.ts` script:
8282

8383
```ts title="index.ts"
84-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:48:68'
84+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:49:70'
8585
```
8686
Go ahead and run the script.
8787

@@ -98,9 +98,9 @@ The result of the dry run will be similar to this:
9898
Check if the recipient account meets the [Existential Deposit (ED)](/polkadot-protocol/glossary/#existential-deposit){target=\_blank} requirement before sending by using [`verifyEdOnDestination`](https://paraspell.github.io/docs/sdk/xcmUtils.html#verify-ed-on-destination){target=\_blank}:
9999

100100
```ts title="index.ts"
101-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:70:85'
101+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:72:88'
102102
```
103-
Comment out the `dryRunTransfer()` and execute the code by running:
103+
Comment out the `dryRunTransfer()` and execute the `verifyED()` by running:
104104

105105
```bash
106106
bun run index.ts
@@ -117,10 +117,10 @@ Before sending an XCM transaction, it is helpful to estimate the fees associated
117117
ParaSpell has a helpful function for this: [`getTransferInfo()`](https://paraspell.github.io/docs/sdk/xcmUtils.html#xcm-transfer-info){target=\_blank}. This function returns an estimate of the associated XCM fees, along with the account's balance before and after the fees are paid.
118118

119119
```ts title="index.ts"
120-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:87:102'
120+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:90:106'
121121
```
122122

123-
Comment out the `verifyED()` and execute the script:
123+
Comment out the `verifyED()` and execute the `XcmTransferInfo()` by running:
124124

125125
```bash
126126
bun run index.ts
@@ -141,7 +141,7 @@ Now you can execute the transfer function by adding the following statement:
141141
Add the following code:
142142

143143
```typescript title="index.ts"
144-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:104:104'
144+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:108:108'
145145
```
146146

147147
Comment out the `XcmTransferInfo()` and execute the transfer:

llms-full.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17258,11 +17258,11 @@ description: A step-by-step guide to building, verifying, and executing a transf
1725817258

1725917259
## Introduction
1726017260

17261-
This guide walks you through transferring tokens between two parachains using the [ParaSpell XCM SDK](https://paraspell.github.io/docs/){target=\_blank}. This example uses [Asset Hub](/polkadot-protocol/architecture/system-chains/asset-hub/){target=\_blank} and the [People Chain](/polkadot-protocol/architecture/system-chains/people/){target=\_blank}, but the same approach applies to transfers between any parachain.
17261+
This guide walks you through transferring tokens between two parachains using the [ParaSpell XCM SDK](https://paraspell.github.io/docs/){target=\_blank}. This example uses [Asset Hub](/polkadot-protocol/architecture/system-chains/asset-hub/){target=\_blank} and the [People Chain](/polkadot-protocol/architecture/system-chains/people/){target=\_blank}, but the same approach can apply to transfers between other parachains.
1726217262

1726317263
For development purposes, this guide will use the [Polkadot TestNet](/develop/networks/#paseo){target=\_blank}, so the transferred token will be PAS.
1726417264

17265-
You’ll learn how to:
17265+
In this guide, you’ll learn how to:
1726617266

1726717267
- Build an XCM transfer transaction using ParaSpell XCM SDK.
1726817268
- Perform a dry run to validate the transfer.
@@ -17275,7 +17275,7 @@ You’ll learn how to:
1727517275
- Knowledge of the [fundamentals of Polkadot](/polkadot-protocol/parachain-basics/){target=\_blank}
1727617276
- Basic understanding of [XCM](/develop/interoperability/intro-to-xcm/){target=\_blank}
1727717277
- Basic familiarity with JavaScript/TypeScript
17278-
- Install [bun](https://bun.com/docs/installation){target=\_blank}, a fast JavaScript/TypeScript runtime and package manager
17278+
- Install [bun](https://bun.com/docs/installation){target=\_blank}, a JavaScript/TypeScript package manager
1727917279

1728017280
## Initialize Your Project
1728117281

@@ -17363,6 +17363,7 @@ async function transfer() {
1736317363

1736417364
const result = await tx.signAndSubmit(signer);
1736517365
console.log(inspect(result, { colors: true, depth: null }));
17366+
process.exit(0);
1736617367
}
1736717368
```
1736817369

@@ -17393,6 +17394,7 @@ async function dryRunTransfer() {
1739317394
.dryRun();
1739417395

1739517396
console.log(inspect(tx, { colors: true, depth: null }));
17397+
process.exit(0);
1739617398
}
1739717399

1739817400
dryRunTransfer();
@@ -17552,11 +17554,12 @@ async function verifyED() {
1755217554
.verifyEdOnDestination();
1755317555

1755417556
console.log(`ED verification ${isValid ? 'successful' : 'failed'}.`);
17557+
process.exit(0);
1755517558
}
1755617559

1755717560
verifyED();
1755817561
```
17559-
Comment out the `dryRunTransfer()` and execute the code by running:
17562+
Comment out the `dryRunTransfer()` and execute the `verifyED()` by running:
1756017563

1756117564
```bash
1756217565
bun run index.ts
@@ -17589,12 +17592,13 @@ async function XcmTransferInfo() {
1758917592
.getTransferInfo();
1759017593

1759117594
console.log('Transfer Info:', info);
17595+
process.exit(0);
1759217596
}
1759317597

1759417598
XcmTransferInfo();
1759517599
```
1759617600

17597-
Comment out the `verifyED()` and execute the script:
17601+
Comment out the `verifyED()` and execute the `XcmTransferInfo()` by running:
1759817602

1759917603
```bash
1760017604
bun run index.ts
@@ -18054,6 +18058,7 @@ async function transfer() {
1805418058

1805518059
const result = await tx.signAndSubmit(signer);
1805618060
console.log(inspect(result, { colors: true, depth: null }));
18061+
process.exit(0);
1805718062
}
1805818063

1805918064
async function dryRunTransfer() {
@@ -18074,6 +18079,7 @@ async function dryRunTransfer() {
1807418079
.dryRun();
1807518080

1807618081
console.log(inspect(tx, { colors: true, depth: null }));
18082+
process.exit(0);
1807718083
}
1807818084

1807918085
dryRunTransfer();
@@ -18091,6 +18097,7 @@ async function verifyED() {
1809118097
.verifyEdOnDestination();
1809218098

1809318099
console.log(`ED verification ${isValid ? 'successful' : 'failed'}.`);
18100+
process.exit(0);
1809418101
}
1809518102

1809618103
verifyED();
@@ -18108,6 +18115,7 @@ async function XcmTransferInfo() {
1810818115
.getTransferInfo();
1810918116

1811018117
console.log('Transfer Info:', info);
18118+
process.exit(0);
1811118119
}
1811218120

1811318121
XcmTransferInfo();

0 commit comments

Comments
 (0)