Skip to content

Commit 9433199

Browse files
ReinhardHatko0xlukemeshaben
authored
Migrate Paraspell content and asset transfer tutorial (#1160)
* Updating Paraspell content. Reducing duplicate text on variou pages * Updating Paraspell asset transfer tutorial change from bun to npm / tsx fixing links * fixing comments adding installation and reference to tutorial removing duplicate paragraph on ParaSpell * minor formating fix * Update reference/tools/paraspell.md Co-authored-by: Erin Shaben <[email protected]> * Update reference/tools/paraspell.md Co-authored-by: Erin Shaben <[email protected]> * feedback --------- Co-authored-by: 0xlukem <[email protected]> Co-authored-by: Lucas Malizia <[email protected]> Co-authored-by: Erin Shaben <[email protected]>
1 parent 00abbb9 commit 9433199

File tree

8 files changed

+71
-45
lines changed

8 files changed

+71
-45
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: 21 additions & 15 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

6-
# Transfer Tokens Between Parachains
6+
# Transfer Assets 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.

reference/polkadot-hub/assets-and-smart-contracts.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,6 @@ These public instances are primarily for ad-hoc testing and quick checks.
149149

150150
`TxWrapper` provides the flexibility needed to integrate asset operations into custom applications while maintaining the security and efficiency of Polkadot's transaction model.
151151

152-
### ParaSpell
153-
154-
[ParaSpell](https://paraspell.xyz/){target=\_blank} is a collection of open-source XCM tools designed to streamline cross-chain asset transfers and interactions within the Polkadot and Kusama ecosystems. It equips developers with an intuitive interface to manage and optimize XCM-based functionalities. Some key points included by ParaSpell are:
155-
156-
- **[XCM SDK](https://paraspell.xyz/#xcm-sdk){target=\_blank}**: Provides a unified layer to incorporate XCM into decentralized applications, simplifying complex cross-chain interactions.
157-
- **[XCM API](https://paraspell.xyz/#xcm-api){target=\_blank}**: Offers an efficient, package-free approach to integrating XCM functionality while offloading heavy computing tasks, minimizing costs and improving application performance.
158-
- **[XCM router](https://paraspell.xyz/#xcm-router){target=\_blank}**: Enables cross-chain asset swaps in a single command, allowing developers to send one asset type (such as DOT on Polkadot) and receive a different asset on another chain (like ASTR on Astar).
159-
- **[XCM analyser](https://paraspell.xyz/#xcm-analyser){target=\_blank}**: Decodes and translates complex XCM multilocation data into readable information, supporting easier troubleshooting and debugging.
160-
- **[XCM visualizator](https://paraspell.xyz/#xcm-visualizator){target=\_blank}**: A tool designed to give developers a clear, interactive view of XCM activity across the Polkadot ecosystem, providing insights into cross-chain communication flow.
161-
162-
ParaSpell's tools make it simple for developers to build, test, and deploy cross-chain solutions without needing extensive knowledge of the XCM protocol. With features like message composition, decoding, and practical utility functions for parachain interactions, ParaSpell is especially useful for debugging and optimizing cross-chain communications.
163152

164153
### Parachain Node
165154

reference/tools/paraspell.md

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ The primary goal of ParaSpell is to abstract away the complexities of the XCM pr
1313

1414
The ParaSpell suite includes:
1515

16-
- **[XCM SDK](https://paraspell.github.io/docs/sdk/getting-started.html){target=\_blank}**: A powerful library for integrating XCM interoperability into dApps.
17-
- **[XCM API](https://paraspell.github.io/docs/api/g-started.html){target=\_blank}**: A lightweight alternative to the SDK for package-less integration.
18-
- **[XCM Router](https://paraspell.github.io/docs/router/getting-strtd.html){target=\_blank}**: A tool for enabling cross-chain swaps of different assets in a single transaction.
19-
- **[XCM Analyser](https://paraspell.github.io/docs/analyser/getng-strtd.html){target=\_blank}**: A utility for decoding and translating complex XCM data into a human-readable format.
20-
- **[XCM Visualizator](https://paraspell.github.io/docs/visualizer/getting-start.html){target=\_blank}**: A tool for visualizing XCM activity across the Polkadot ecosystem.
21-
- **[XCM Playground](https://paraspell.github.io/docs/tools/playground.html){target=\_blank}**: A tool for testing different XCM scenarios.
16+
- **[XCM SDK](https://paraspell.xyz/#xcm-sdk){target=\_blank}**: Provides a unified layer to incorporate XCM into decentralized applications, simplifying complex cross-chain interactions.
17+
- **[XCM API](https://paraspell.xyz/#xcm-api){target=\_blank}**: Offers an efficient, package-free approach to integrating XCM functionality while offloading heavy computing tasks, minimizing costs and improving application performance.
18+
- **[XCM Router](https://paraspell.xyz/#xcm-router){target=\_blank}**: Enables cross-chain asset swaps in a single command, allowing developers to send one asset type (such as DOT on Polkadot) and receive a different asset on another chain (like ASTR on Astar).
19+
- **[XCM Analyser](https://paraspell.xyz/#xcm-analyser){target=\_blank}**: Decodes and translates complex XCM multilocation data into readable information, supporting easier troubleshooting and debugging.
20+
- **[XCM Visualizator](https://paraspell.xyz/#xcm-visualizator){target=\_blank}**: A tool designed to give developers a clear, interactive view of XCM activity across the Polkadot ecosystem, providing insights into cross-chain communication flow.
21+
- **[XCM Playground](https://paraspell.xyz/#try-it){target=\_blank}**: An interactive playground for testing different XCM scenarios.
2222

2323
### ParaSpell XCM SDK
2424

@@ -27,3 +27,42 @@ The [ParaSpell XCM SDK](https://paraspell.github.io/docs/sdk/getting-started.htm
2727
The SDK simplifies the process of creating and sending XCM messages by providing a user-friendly builder pattern. This allows developers to construct complex XCM calls with just a few lines of code, reducing the likelihood of errors and ensuring that messages are constructed correctly.
2828

2929
By using the ParaSpell XCM SDK, developers can significantly accelerate their development workflow and build powerful, interoperable dApps that take full advantage of the Polkadot network's cross-chain capabilities.
30+
31+
## Install ParaSpell
32+
33+
If you want to use ParaSpell in your project you can add it as a dependency with the following command:
34+
35+
=== "npm"
36+
37+
```bash
38+
npm install --save @paraspell/[email protected]
39+
```
40+
41+
=== "pnpm"
42+
43+
```bash
44+
pnpm add @paraspell/[email protected]
45+
```
46+
47+
=== "yarn"
48+
49+
```bash
50+
yarn add @paraspell/[email protected]
51+
```
52+
53+
54+
## Where to Go Next
55+
56+
Explore more about ParaSpell through these resources:
57+
58+
<div class="grid cards" markdown>
59+
60+
- <span class="badge tutorial">Tutorial</span> __Transfer Assets Between Parachains__
61+
62+
---
63+
64+
Learn how to transfer assets across chains with ParaSpell.
65+
66+
[:octicons-arrow-right-24: Get Started](/chain-interactions/send-transactions/interoperability/transfer-assets-parachains/)
67+
68+
</div>

reference/tools/xcm-tools.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,7 @@ For a full overview of each script, visit the [scripts](https://github.com/Moons
3636

3737
### ParaSpell
3838

39-
[ParaSpell](https://paraspell.xyz/){target=\_blank} is a collection of open-source XCM tools designed to streamline cross-chain asset transfers and interactions within the Polkadot and Kusama ecosystems. It equips developers with an intuitive interface to manage and optimize XCM-based functionalities. Some key points included by ParaSpell are:
40-
41-
- **[XCM SDK](https://paraspell.xyz/#xcm-sdk){target=\_blank}**: Provides a unified layer to incorporate XCM into decentralized applications, simplifying complex cross-chain interactions.
42-
- **[XCM API](https://paraspell.xyz/#xcm-api){target=\_blank}**: Offers an efficient, package-free approach to integrating XCM functionality while offloading heavy computing tasks, minimizing costs and improving application performance.
43-
- **[XCM router](https://paraspell.xyz/#xcm-router){target=\_blank}**: Enables cross-chain asset swaps in a single command, allowing developers to send one asset type (such as DOT on Polkadot) and receive a different asset on another chain (like ASTR on Astar).
44-
- **[XCM analyser](https://paraspell.xyz/#xcm-analyser){target=\_blank}**: Decodes and translates complex XCM multilocation data into readable information, supporting easier troubleshooting and debugging.
45-
- **[XCM visualizator](https://paraspell.xyz/#xcm-visualizator){target=\_blank}**: A tool designed to give developers a clear, interactive view of XCM activity across the Polkadot ecosystem, providing insights into cross-chain communication flow.
46-
47-
ParaSpell's tools make it simple for developers to build, test, and deploy cross-chain solutions without needing extensive knowledge of the XCM protocol. With features like message composition, decoding, and practical utility functions for parachain interactions, ParaSpell is especially useful for debugging and optimizing cross-chain communications.
39+
[ParaSpell](/reference/tools/paraspell/){target=\_blank} is a collection of open-source XCM tools that streamline cross-chain asset transfers and interactions across the Polkadot and Kusama ecosystems. It provides developers with an intuitive interface to build, test, and deploy interoperable dApps, featuring message composition, decoding, and practical utilities for parachain interactions that simplify debugging and cross-chain communication optimization.
4840

4941
### Astar XCM Tools
5042

0 commit comments

Comments
 (0)