Skip to content

Commit 683e940

Browse files
committed
Updating Paraspell asset transfer tutorial
change from bun to npm / tsx fixing links
1 parent d9496fd commit 683e940

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

.snippets/code/chain-interactions/send-transactions/interoperability/transfer-assets-parachains/dry-run-output.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="termynal" data-termynal>
2-
<span data-ty="input"><span class="file-path"></span>bun run index.ts</span>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx index.ts</span>
33
<span data-ty>{
44
failureReason: undefined,
55
failureChain: undefined,
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div id="termynal" data-termynal>
2-
<span data-ty="input"><span class="file-path"></span>bun run index.ts</span>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx index.ts</span>
33
<span data-ty>ED verification successful.</span>
44
</div>

.snippets/code/chain-interactions/send-transactions/interoperability/transfer-assets-parachains/transfer-info-output.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="termynal" data-termynal>
2-
<span data-ty="input"><span class="file-path"></span>bun run index.ts</span>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx index.ts</span>
33
<span data-ty>Transfer Info: {
44
chain: {
55
origin: "AssetHubPaseo",

.snippets/code/chain-interactions/send-transactions/interoperability/transfer-assets-parachains/transfer-output.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="termynal" data-termynal>
2-
<span data-ty="input"><span class="file-path"></span>bun run index.ts</span>
2+
<span data-ty="input"><span class="file-path"></span>npx tsx index.ts</span>
33
<span data-ty>...</span>
44
<span data-ty>Built transaction: {
55
getPaymentInfo: [AsyncFunction: getPaymentInfo],

chain-interactions/send-transactions/interoperability/transfer-assets-parachains.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,58 @@
11
---
2-
title: Transfer Tokens Between Parachains
2+
title: Transfer Assets Between Parachains
33
description: A step-by-step guide to using the ParaSpell XCM SDK to build, verify, and execute a transfer from one Parachain to another.
44
---
55

66
# Transfer Tokens Between Parachains
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 utilizes [Asset Hub](/polkadot-protocol/architecture/system-chains/asset-hub/){target=\_blank} and the [People Chain](/polkadot-protocol/architecture/system-chains/people/){target=\_blank}. However, the same approach can be applied to transfers between other parachains.
10+
This guide walks you through transferring tokens between two parachains using the [ParaSpell XCM SDK](/reference/tools/paraspell/){target=\_blank}. This example utilizes [Asset Hub](/polkadot-protocol/architecture/system-chains/asset-hub/){target=\_blank} and the [People Chain](/polkadot-protocol/architecture/system-chains/people/){target=\_blank}. However, the same approach can be applied 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

1414
In this guide, you will:
1515

1616
- Build an XCM transfer transaction using ParaSpell XCM SDK.
1717
- Perform a dry run to validate the transfer.
18-
- Verify the [Existential Deposit (ED)](/polkadot-protocol/glossary/#existential-deposit){target=\_blank} requirement on the destination chain.
18+
- Verify the [Existential Deposit (ED)](/reference/glossary/#existential-deposit){target=\_blank} requirement on the destination chain.
1919
- Retrieve information regarding the transfer, along with fee estimates.
2020
- Submit the transaction.
2121

2222
### Prerequisites
2323

2424
Before you begin, ensure you have the following:
2525

26-
- Knowledge of the [fundamentals of Polkadot](/polkadot-protocol/parachain-basics/){target=\_blank}.
27-
- Basic understanding of [XCM](/develop/interoperability/intro-to-xcm/){target=\_blank}.
26+
- Knowledge of the [fundamentals of Polkadot](/parachains/get-started/){target=\_blank}.
27+
- Basic understanding of [XCM](/parachains/interoperability/get-started/){target=\_blank}.
2828
- Basic familiarity with JavaScript or TypeScript.
29-
- Installed [bun](https://bun.com/docs/installation){target=\_blank}, a JavaScript and TypeScript package manager.
29+
- Installed [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm){target=\_blank}, a JavaScript and TypeScript package manager.
3030

3131
## Initialize Your Project
3232

3333
Create the project folder:
3434

3535
```bash
36-
mkdir paraspell-transfer
36+
mkdir paraspell-transfer && \
3737
cd paraspell-transfer
3838
```
3939

4040
Initialize the JavaScript project:
4141

4242
```bash
43-
bun init -y
43+
npm init -y
44+
```
45+
46+
Install dev dependencies:
47+
48+
```bash
49+
npm install --save-dev @types/node@^22.12.0 tsx@^4.20.6 typescript@^5.7.3
4450
```
4551

4652
Install the required dependencies:
4753

4854
```bash
49-
bun add @paraspell/sdk@11.3.2 polkadot-api@1.17.1 @polkadot-labs/[email protected].25 @polkadot-labs/[email protected].24
55+
npm install --save @paraspell/sdk@11.12.6 polkadot-api@1.20.0 @polkadot-labs/[email protected].26 @polkadot-labs/[email protected].25
5056
```
5157

5258
Now add the following setup code to `index.ts`:
@@ -88,7 +94,7 @@ Add the following dry run code to your `index.ts` script:
8894
Run the script using the following command:
8995

9096
```bash
91-
bun run index.ts
97+
npx tsx index.ts
9298
```
9399

94100
The result of the dry run will look similar to the following example output:
@@ -105,7 +111,7 @@ Check if the recipient account meets the [Existential Deposit (ED)](/polkadot-pr
105111
Comment out the `dryRunTransfer()` function so that it is not executed again. Then, execute the `verifyED()` by running the following command:
106112

107113
```bash
108-
bun run index.ts
114+
npx tsx index.ts
109115
```
110116

111117
After that, you will get output confirming the ED which will look similar to the following:
@@ -125,7 +131,7 @@ ParaSpell has a helpful function for this: [`getTransferInfo()`](https://paraspe
125131
Comment out the `verifyED()` function so it doesn't execute again. Then, execute the `XcmTransferInfo()` function by running the following command:
126132

127133
```bash
128-
bun run index.ts
134+
npx tsx index.ts
129135
```
130136

131137
You will see all the information for your transfer similar to the following example:
@@ -147,7 +153,7 @@ You can execute the transfer function by adding the following function call:
147153
Comment out the `XcmTransferInfo()` function so it doesn't execute again. Then, execute the transfer by running the following command:
148154

149155
```bash
150-
bun run index.ts
156+
npx tsx index.ts
151157
```
152158

153159
Your `transfer` function will submit the transaction, and you will get the following output:
@@ -180,4 +186,4 @@ You have now successfully created and sent a cross-chain transfer using the Para
180186

181187
- Read the Docs: Dive deeper into the features of the [ParaSpell XCM SDK](https://paraspell.github.io/docs/sdk/getting-started.html){target=\_blank} documentation.
182188

183-
- Learn about XCM: Understand the underlying protocol by visiting the [Introduction to XCM page](/develop/interoperability/intro-to-xcm/) in the Polkadot Docs.
189+
- Learn about XCM: Understand the underlying protocol by visiting the [Introduction to XCM page](/parachains/interoperability/get-started/) in the Polkadot Docs.

0 commit comments

Comments
 (0)