Skip to content

Commit 50c0a83

Browse files
committed
Merge branch 'staging/product-ia' into nhussein11/add-remix-ide
2 parents 802a536 + 77c2994 commit 50c0a83

File tree

508 files changed

+30448
-26017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

508 files changed

+30448
-26017
lines changed

.ai/categories/basics.md

Lines changed: 1162 additions & 234 deletions
Large diffs are not rendered by default.

.ai/categories/dapps.md

Lines changed: 1134 additions & 206 deletions
Large diffs are not rendered by default.

.ai/categories/infrastructure.md

Lines changed: 1172 additions & 244 deletions
Large diffs are not rendered by default.

.ai/categories/networks.md

Lines changed: 1177 additions & 249 deletions
Large diffs are not rendered by default.

.ai/categories/parachains.md

Lines changed: 4402 additions & 3118 deletions
Large diffs are not rendered by default.

.ai/categories/polkadot-protocol.md

Lines changed: 1177 additions & 260 deletions
Large diffs are not rendered by default.

.ai/categories/smart-contracts.md

Lines changed: 4080 additions & 556 deletions
Large diffs are not rendered by default.

.ai/categories/tooling.md

Lines changed: 5084 additions & 3231 deletions
Large diffs are not rendered by default.

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

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,59 @@
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
url: https://docs.polkadot.com/chain-interactions/send-transactions/interoperability/transfer-assets-parachains/
55
---
66

7-
# Transfer Tokens Between Parachains
7+
# Transfer Assets Between Parachains
88

99
## Introduction
1010

11-
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.
11+
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.
1212

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

1515
In this guide, you will:
1616

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

2323
### Prerequisites
2424

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

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

3232
## Initialize Your Project
3333

3434
Create the project folder:
3535

3636
```bash
37-
mkdir paraspell-transfer
37+
mkdir paraspell-transfer && \
3838
cd paraspell-transfer
3939
```
4040

4141
Initialize the JavaScript project:
4242

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

4753
Install the required dependencies:
4854

4955
```bash
50-
bun add @paraspell/sdk@11.3.2 polkadot-api@1.17.1 @polkadot-labs/[email protected].25 @polkadot-labs/[email protected].24
56+
npm install --save @paraspell/sdk@11.12.6 polkadot-api@1.20.0 @polkadot-labs/[email protected].26 @polkadot-labs/[email protected].25
5157
```
5258

5359
Now add the following setup code to `index.ts`:
@@ -154,13 +160,13 @@ dryRunTransfer();
154160
Run the script using the following command:
155161

156162
```bash
157-
bun run index.ts
163+
npx tsx index.ts
158164
```
159165

160166
The result of the dry run will look similar to the following example output:
161167

162168
<div id="termynal" data-termynal>
163-
<span data-ty="input"><span class="file-path"></span>bun run index.ts</span>
169+
<span data-ty="input"><span class="file-path"></span>npx tsx index.ts</span>
164170
<span data-ty>{
165171
failureReason: undefined,
166172
failureChain: undefined,
@@ -313,13 +319,13 @@ verifyED();
313319
Comment out the `dryRunTransfer()` function so that it is not executed again. Then, execute the `verifyED()` by running the following command:
314320

315321
```bash
316-
bun run index.ts
322+
npx tsx index.ts
317323
```
318324

319325
After that, you will get output confirming the ED which will look similar to the following:
320326

321327
<div id="termynal" data-termynal>
322-
<span data-ty="input"><span class="file-path"></span>bun run index.ts</span>
328+
<span data-ty="input"><span class="file-path"></span>npx tsx index.ts</span>
323329
<span data-ty>ED verification successful.</span>
324330
</div>
325331
## Get Transfer Info and Fee Estimates
@@ -351,13 +357,13 @@ XcmTransferInfo();
351357
Comment out the `verifyED()` function so it doesn't execute again. Then, execute the `XcmTransferInfo()` function by running the following command:
352358

353359
```bash
354-
bun run index.ts
360+
npx tsx index.ts
355361
```
356362

357363
You will see all the information for your transfer similar to the following example:
358364

359365
<div id="termynal" data-termynal>
360-
<span data-ty="input"><span class="file-path"></span>bun run index.ts</span>
366+
<span data-ty="input"><span class="file-path"></span>npx tsx index.ts</span>
361367
<span data-ty>Transfer Info: {
362368
chain: {
363369
origin: "AssetHubPaseo",
@@ -420,13 +426,13 @@ transfer();
420426
Comment out the `XcmTransferInfo()` function so it doesn't execute again. Then, execute the transfer by running the following command:
421427

422428
```bash
423-
bun run index.ts
429+
npx tsx index.ts
424430
```
425431

426432
Your `transfer` function will submit the transaction, and you will get the following output:
427433

428434
<div id="termynal" data-termynal>
429-
<span data-ty="input"><span class="file-path"></span>bun run index.ts</span>
435+
<span data-ty="input"><span class="file-path"></span>npx tsx index.ts</span>
430436
<span data-ty>...</span>
431437
<span data-ty>Built transaction: {
432438
getPaymentInfo: [AsyncFunction: getPaymentInfo],
@@ -873,4 +879,4 @@ You have now successfully created and sent a cross-chain transfer using the Para
873879

874880
- 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.
875881

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

.ai/pages/chain-interactions.md

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,95 @@
11
---
2+
title: Chain Interactions Overview
3+
description: Learn how to query data, send transactions, enable cross-chain communication, and manage accounts across the Polkadot ecosystem.
4+
categories: Chain Interactions
25
url: https://docs.polkadot.com/chain-interactions/
36
---
47

5-
TODO
8+
# Chain Interactions
9+
10+
## Introduction
11+
12+
Chain interactions form the foundation of building applications on Polkadot. Whether you're querying on-chain data, executing transactions, enabling cross-chain communication, or managing accounts, understanding how to interact with Polkadot-based chains is essential for application developers.
13+
14+
This section provides comprehensive guidance on the various ways to interact with Polkadot chains, from basic queries to complex cross-chain operations. You'll learn how to:
15+
16+
- Query on-chain state and subscribe to blockchain events.
17+
- Send transactions and manage their lifecycle.
18+
- Enable interoperability between parachains through XCM.
19+
- Manage tokens and perform token operations.
20+
- Create and manage accounts programmatically.
21+
22+
Whether you're building a frontend application, a backend service, or integrating with the Polkadot ecosystem, these guides will equip you with the knowledge and tools to effectively interact with chains across the network.
23+
24+
## Core Interaction Patterns
25+
26+
### Query On-Chain Data
27+
28+
Accessing blockchain state is fundamental to building responsive applications. Polkadot offers several methods to query on-chain data, each suited for different use cases.
29+
30+
- **[SDK integration](/chain-interactions/query-data/query-sdks/)**: Programmatically read blockchain state using:
31+
32+
- [Polkadot API (PAPI)](/reference/tools/papi/)
33+
- [Polkadot.js](/reference/tools/polkadot-js-api/)
34+
- [Dedot](/reference/tools/dedot/)
35+
- [Python Substrate Interface](/reference/tools/py-substrate-interface/)
36+
- [Subxt](/reference/tools/subxt/)
37+
38+
- **[REST API access](/chain-interactions/query-data/query-rest/)**: Query chain data through standardized REST endpoints for simpler integration.
39+
- **[Runtime API calls](/chain-interactions/query-data/runtime-api-calls/)**: Execute runtime APIs directly for specialized queries and operations.
40+
41+
### Send Transactions
42+
43+
Transactions are the primary mechanism for modifying blockchain state. Understanding transaction construction, signing, and submission is crucial for building interactive applications.
44+
45+
- **[Transaction construction](/chain-interactions/send-transactions/with-sdks/)**: Build transactions using various SDKs with proper encoding and formatting.
46+
- **[Fee estimation](/chain-interactions/send-transactions/calculate-transaction-fees/)**: Calculate transaction fees to ensure sufficient balance and optimize costs.
47+
- **[Multi-token fees](/chain-interactions/send-transactions/pay-fees-with-different-tokens/)**: Learn how to pay transaction fees with different tokens on supported chains.
48+
49+
### Send Cross-Chain Transactions
50+
51+
Polkadot enables native cross-chain capabilities through Cross-Consensus Messaging (XCM), allowing chains to securely communicate and transfer assets across the ecosystem.
52+
53+
- **[Transfer assets between parachains](/chain-interactions/send-transactions/interoperability/transfer-assets-parachains/)**: Understand how to construct and send XCM messages using [ParaSpell XCM SDK](/reference/tools/paraspell/){target=\_blank} and [Polkadot API (PAPI)](/reference/tools/papi/){target=\_blank}.
54+
- **[Transfer assets out of Polkadot](/chain-interactions/send-transactions/interoperability/transfer-assets-out-of-polkadot/)**: Connect to blockchains outside the Polkadot ecosystem using [Snowbridge](https://wiki.polkadot.com/learn/learn-snowbridge/){target=\_blank} and other bridge solutions.
55+
56+
### Manage Tokens
57+
58+
Polkadot Hub provides a unified platform for managing assets across the ecosystem. Understanding token operations is essential for DeFi applications and multi-chain asset management.
59+
60+
- **[Local asset registration](/chain-interactions/token-operations/register-local-asset/)**: Learn how assets created in Asset Hub are registered on the network.
61+
- **[Foregin asset registration](/chain-interactions/token-operations/register-foreign-asset/)**: Learn how assets created outside of Asset Hub are registered on the network.
62+
- **[Convert assets](/chain-interactions/token-operations/convert-assets/)**: Convert, swap, and manage assets on-chain using the Asset Conversion pallet.
63+
- **Asset Hub integration**: Interact with Polkadot's central asset management hub using [Polkadot.js Apps](https://polkadot.js.org/apps/){target=\_blank}.
64+
65+
### Manage Accounts
66+
67+
Account management forms the basis of user identity and authentication in blockchain applications. Learn how to create, manage, and query accounts programmatically.
68+
69+
- **[Account creation](/chain-interactions/accounts/create-account/)**: Generate accounts using various SDKs in Rust, Python, and JavaScript.
70+
- **[Account queries](/chain-interactions/accounts/query-accounts/)**: Retrieve account information including balances, nonces, and metadata.
71+
72+
## Development Tools and SDKs
73+
74+
The Polkadot ecosystem offers a rich set of tools and libraries to facilitate chain interactions:
75+
76+
- **[Polkadot API (PAPI)](/reference/tools/papi/)**: Modern, type-safe TypeScript library with full metadata support.
77+
- **[Polkadot.js](/reference/tools/polkadot-js-api/)**: Comprehensive JavaScript library with extensive ecosystem support.
78+
- **[Dedot](/reference/tools/dedot/)**: Lightweight TypeScript library optimized for performance.
79+
- **[Python Substrate Interface](/reference/tools/py-substrate-interface/)**: Polkadot Substrate Interface for streamlined development.
80+
- **[Subxt](/reference/tools/subxt/)**: Rust library for building robust substrate-based applications.
81+
- **[Polkadot.js Apps](https://polkadot.js.org/apps/)**: Web-based interface for exploring and interacting with chains.
82+
83+
Each tool has its strengths, and choosing the right one depends on your project requirements, programming language preference, and specific use cases.
84+
85+
## Next Steps
86+
87+
Explore the sections below to dive deeper into specific chain interaction patterns:
88+
89+
- **[Query On-Chain Data](/chain-interactions/query-data/query-sdks/)**: Learn to read blockchain state efficiently.
90+
- **[Send Transactions](/chain-interactions/send-transactions/with-sdks/)**: Master transaction construction and submission.
91+
- **[Send Cross-Chain Transactions](/chain-interactions/send-transactions/interoperability/transfer-assets-parachains/)**: Enable cross-chain communication with XCM.
92+
- **[Manage Tokens](/chain-interactions/token-operations/register-local-asset/)**: Manage assets across the Polkadot ecosystem.
93+
- **[Manage Accounts](/chain-interactions/accounts/create-account/)**: Create and query accounts programmatically.
94+
95+
Each section provides practical examples, code snippets, and comprehensive guides to help you build production-ready applications on Polkadot.

0 commit comments

Comments
 (0)