@paraspell/sdk 12.3.0 → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +21 -89
- package/package.json +2 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<h1 align="center">@paraspell/sdk</h1>
|
|
5
|
-
<h4 align="center"> SDK for handling XCM asset transfers across Polkadot and
|
|
5
|
+
<h4 align="center"> SDK for handling XCM asset transfers across Polkadot, Kusama, Paseo and Westend ecosystems. </h4>
|
|
6
6
|
<p align="center">
|
|
7
7
|
<a href="https://npmjs.com/package/@paraspell/sdk">
|
|
8
8
|
<img alt="version" src="https://img.shields.io/npm/v/@paraspell/sdk?style=flat-square" />
|
|
@@ -65,23 +65,20 @@ import { Native, Foreign, ForeignAbstract } from '@paraspell/sdk'; //Only needed
|
|
|
65
65
|
```
|
|
66
66
|
## Implementation
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
- Brand new asset decimal abstraction introduced. It can be turned on in Builder config. Will be turned on by default in next major release.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Latest news:
|
|
78
|
-
- V11 > V12 Migration guide https://paraspell.github.io/docs/migration/v11-to-v12.html
|
|
79
|
-
```
|
|
68
|
+
> [!NOTE]
|
|
69
|
+
> - Local transfers are now available for every currency and every chain. To try them, simply use the same origin and destination parameters.
|
|
70
|
+
> - Transfer info queries are now all in the Builder pattern and don't require any imports other than the builder.
|
|
71
|
+
> - You can now query Ethereum asset balances on Ethereum via balance query
|
|
72
|
+
> - The Builder() now accepts an optional configuration object (To enhance localhost experience and testing). This object can contain apiOverrides and a development flag. More information in the "Localhost test setup" section.
|
|
73
|
+
> - Brand new asset decimal abstraction introduced. It can be turned on in Builder config. Will be turned on by default in next major release.
|
|
74
|
+
>
|
|
75
|
+
> **Latest news:**
|
|
76
|
+
> - V11 > V12 Migration guide https://paraspell.github.io/docs/migration/v11-to-v12.html
|
|
80
77
|
|
|
81
78
|
### Sending XCM
|
|
82
79
|
For full documentation on XCM Transfers head over to [official documentation](https://paraspell.github.io/docs/sdk/xcmPallet.html).
|
|
83
80
|
|
|
84
|
-
#### Transfer assets from
|
|
81
|
+
#### Transfer assets from Substrate to Substrate
|
|
85
82
|
|
|
86
83
|
```ts
|
|
87
84
|
const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
@@ -103,75 +100,7 @@ await builder.disconnect()
|
|
|
103
100
|
/*
|
|
104
101
|
EXAMPLE:
|
|
105
102
|
const builder = Builder()
|
|
106
|
-
.from('
|
|
107
|
-
.to('Astar')
|
|
108
|
-
.currency({
|
|
109
|
-
symbol: 'ACA',
|
|
110
|
-
amount: '1000000000'
|
|
111
|
-
})
|
|
112
|
-
.address(address)
|
|
113
|
-
|
|
114
|
-
const tx = await builder.build()
|
|
115
|
-
|
|
116
|
-
//Disconnect API after TX
|
|
117
|
-
await builder.disconnect()
|
|
118
|
-
*/
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
#### Transfer assets from the Relay chain to the Parachain
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
125
|
-
.from(TRelaychain) // Kusama | Polkadot | Westend | Paseo
|
|
126
|
-
.to(TChain/*,customParaId - optional*/ | Location object)
|
|
127
|
-
.currency({symbol: 'DOT', amount: amount /*Use "ALL" to transfer everything*/})
|
|
128
|
-
.address(address | Location object)
|
|
129
|
-
/*.xcmVersion(Version.V3/V4/V5) //Optional parameter for manual override of XCM Version used in call
|
|
130
|
-
.customPallet('Pallet','pallet_function') //Optional parameter for manual override of XCM Pallet and function used in call (If they are named differently on some chain but syntax stays the same). Both pallet name and function required. Pallet name must be CamelCase, function name snake_case.*/
|
|
131
|
-
|
|
132
|
-
const tx = await builder.build()
|
|
133
|
-
|
|
134
|
-
//Make sure to disconnect the API after it is no longer used (eg, after a transaction)
|
|
135
|
-
await builder.disconnect()
|
|
136
|
-
|
|
137
|
-
/*
|
|
138
|
-
EXAMPLE:
|
|
139
|
-
const builder = await Builder()
|
|
140
|
-
.from('Polkadot')
|
|
141
|
-
.to('Astar')
|
|
142
|
-
.currency({
|
|
143
|
-
symbol: 'DOT',
|
|
144
|
-
amount: '1000000000'
|
|
145
|
-
})
|
|
146
|
-
.address(address)
|
|
147
|
-
|
|
148
|
-
const tx = await builder.build()
|
|
149
|
-
|
|
150
|
-
//Disconnect API after TX
|
|
151
|
-
await builder.disconnect()
|
|
152
|
-
*/
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
#### Transfer assets from Parachain to Relay chain
|
|
156
|
-
|
|
157
|
-
```ts
|
|
158
|
-
const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
159
|
-
.from(TSubstrateChain)
|
|
160
|
-
.to(TRelaychain) // Kusama | Polkadot | Westend | Paseo
|
|
161
|
-
.currency({symbol: 'DOT', amount: amount /*Use "ALL" to transfer everything*/})
|
|
162
|
-
.address(address | Location object)
|
|
163
|
-
/*.xcmVersion(Version.V3/V4/V5) //Optional parameter for manual override of XCM Version used in call
|
|
164
|
-
.customPallet('Pallet','pallet_function') //Optional parameter for manual override of XCM Pallet and function used in call (If they are named differently on some chain but syntax stays the same). Both pallet name and function required. Pallet name must be CamelCase, function name snake_case.*/
|
|
165
|
-
|
|
166
|
-
const tx = await builder.build()
|
|
167
|
-
|
|
168
|
-
//Make sure to disconnect the API after it is no longer used (eg, after a transaction)
|
|
169
|
-
await builder.disconnect()
|
|
170
|
-
|
|
171
|
-
/*
|
|
172
|
-
EXAMPLE:
|
|
173
|
-
const builder = await Builder()
|
|
174
|
-
.from('Astar')
|
|
103
|
+
.from('AssetHubPolkadot')
|
|
175
104
|
.to('Polkadot')
|
|
176
105
|
.currency({
|
|
177
106
|
symbol: 'DOT',
|
|
@@ -531,7 +460,8 @@ console.log(SUPPORTED_PALLETS)
|
|
|
531
460
|
|
|
532
461
|
- Run all core tests and checks using `pnpm runAll`
|
|
533
462
|
|
|
534
|
-
|
|
463
|
+
> [!NOTE]
|
|
464
|
+
> XCM SDK can be tested in [Playground](https://playground.paraspell.xyz/xcm-sdk/xcm-transfer).
|
|
535
465
|
|
|
536
466
|
## Contribute to XCM Tools and earn rewards 💰
|
|
537
467
|
|
|
@@ -551,8 +481,10 @@ Published under [MIT License](https://github.com/paraspell/xcm-tools/blob/main/p
|
|
|
551
481
|
|
|
552
482
|
## Supported by
|
|
553
483
|
|
|
554
|
-
<
|
|
555
|
-
|
|
556
|
-
<
|
|
557
|
-
|
|
558
|
-
|
|
484
|
+
<p align="center">
|
|
485
|
+
<picture>
|
|
486
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/paraspell/presskit/blob/main/logos_supporters/polkadot_kusama_transparent.png">
|
|
487
|
+
<source media="(prefers-color-scheme: light)" srcset="https://github.com/paraspell/presskit/blob/main/logos_supporters/polkadot_kusama_w3f_standard.png">
|
|
488
|
+
<img width="750" alt="Shows a black logo in light color mode and a white one in dark color mode." src="https://github.com/paraspell/presskit/blob/main/logos_supporters/polkadot_kusama_w3f_standard.png">
|
|
489
|
+
</picture>
|
|
490
|
+
</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.4.0",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@polkadot-labs/hdkd": "^0.0.26",
|
|
29
29
|
"@polkadot-labs/hdkd-helpers": "^0.0.27",
|
|
30
30
|
"viem": "2.40.3",
|
|
31
|
-
"@paraspell/sdk-core": "12.
|
|
31
|
+
"@paraspell/sdk-core": "12.4.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"polkadot-api": ">= 1.23.1 < 2"
|