Skip to content

Commit 59054e6

Browse files
committed
Update content
1 parent cf6b513 commit 59054e6

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

develop/toolkit/interoperability/paraspell-xcm-sdk/teleport-from-asset-hub-to-relay-chain.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ bun add @paraspell/sdk polkadot-api @polkadot-labs/hdkd-helpers @polkadot-labs/h
4848
Now add the following setup code to `index.ts`:
4949

5050
```ts title="index.ts"
51-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:1:28'
51+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:1:27'
5252
```
5353

5454
Replace the `SEED_PHRASE` with the `SEED_PHRASE` from your Polkadot development account.
@@ -67,7 +67,7 @@ In this example, you will teleport 10 PAS tokens from Asset Hub Paseo to the Pas
6767
Add the ParaSpell transaction code to your `index.ts` file:
6868

6969
```ts title="index.ts"
70-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:30:47'
70+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:29:46'
7171
```
7272

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

8181
```ts title="index.ts"
82-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:49:69'
82+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:48:68'
8383
```
8484
Go ahead and run the script.
8585

@@ -96,7 +96,7 @@ The result of the dry run will be similar to this:
9696
Check if the recipient account meets the [Existential Deposit (ED)](/polkadot-protocol/glossary/#existential-deposit){target=\_blank} requirement before sending:
9797

9898
```ts title="index.ts"
99-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:71:86'
99+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:70:85'
100100
```
101101
Execute the code by running:
102102

@@ -115,7 +115,7 @@ Before sending an XCM transaction, it is helpful to estimate the fees associated
115115
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.
116116

117117
```ts title="index.ts"
118-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:88:103'
118+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:87:102'
119119
```
120120

121121
Go ahead and execute the script:
@@ -139,7 +139,7 @@ You can execute the teleport transaction with confidence.
139139
Add the following code:
140140

141141
```typescript title="index.ts"
142-
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:105:105'
142+
--8<-- 'code/develop/toolkit/interoperability/paraspell/index.ts:104:104'
143143
```
144144

145145
And execute your teleport:

llms-full.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18797,7 +18797,8 @@ In this example, you will teleport 10 PAS tokens from Asset Hub Paseo to the Pas
1879718797
Add the ParaSpell transaction code to your `index.ts` file:
1879818798

1879918799
```ts title="index.ts"
18800-
const signer = getSigner();
18800+
async function teleport() {
18801+
const signer = getSigner();
1880118802

1880218803
const tx = await Builder()
1880318804
.from('AssetHubPaseo')
@@ -18825,7 +18826,8 @@ Dry runs simulate the transaction without broadcasting it, allowing you to confi
1882518826
Add the following dry run code to your `index.ts` script:
1882618827

1882718828
```ts title="index.ts"
18828-
if (!hasDryRunSupport('AssetHubPaseo')) {
18829+
async function dryRunTeleport() {
18830+
if (!hasDryRunSupport('AssetHubPaseo')) {
1882918831
console.log('Dry run is not supported on AssetHubPaseo.');
1883018832
return;
1883118833
}
@@ -18968,7 +18970,8 @@ The result of the dry run will be similar to this:
1896818970
Check if the recipient account meets the [Existential Deposit (ED)](/polkadot-protocol/glossary/#existential-deposit){target=\_blank} requirement before sending:
1896918971

1897018972
```ts title="index.ts"
18971-
const isValid = await Builder()
18973+
async function verifyED() {
18974+
const isValid = await Builder()
1897218975
.from('AssetHubPaseo')
1897318976
.to('Paseo')
1897418977
.currency({
@@ -19005,7 +19008,8 @@ Before sending an XCM transaction, it is helpful to estimate the fees associated
1900519008
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.
1900619009

1900719010
```ts title="index.ts"
19008-
const info = await Builder()
19011+
async function XcmTransferInfo() {
19012+
const info = await Builder()
1900919013
.from('AssetHubPaseo')
1901019014
.to('Paseo')
1901119015
.currency({
@@ -19088,7 +19092,7 @@ You can execute the teleport transaction with confidence.
1908819092
Add the following code:
1908919093

1909019094
```typescript title="index.ts"
19091-
19095+
teleport();
1909219096
```
1909319097

1909419098
And execute your teleport:

0 commit comments

Comments
 (0)