@paraspell/sdk 10.1.6 → 10.1.7
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/README.md +27 -27
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -70,12 +70,12 @@ import { Native, Foreign, ForeignAbstract } from '@paraspell/sdk'; //Only needed
|
|
|
70
70
|
|
|
71
71
|
```
|
|
72
72
|
NOTES:
|
|
73
|
-
- Local transfers are now available for every currency and every chain. To try them, simply use same origin and destination parameters.
|
|
73
|
+
- Local transfers are now available for every currency and every chain. To try them, simply use the same origin and destination parameters.
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
```
|
|
77
77
|
Latest news:
|
|
78
|
-
- Transfer info queries are now all in Builder pattern and don't require any imports other than builder.
|
|
78
|
+
- Transfer info queries are now all in the Builder pattern and don't require any imports other than the builder.
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
### Sending XCM:
|
|
@@ -97,7 +97,7 @@ const builder = Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
97
97
|
|
|
98
98
|
const tx = await builder.build()
|
|
99
99
|
|
|
100
|
-
//Make sure to disconnect API after it is no longer used (eg
|
|
100
|
+
//Make sure to disconnect the API after it is no longer used (eg, after a transaction)
|
|
101
101
|
await builder.disconnect()
|
|
102
102
|
|
|
103
103
|
/*
|
|
@@ -117,7 +117,7 @@ const tx = await builder.build()
|
|
|
117
117
|
await builder.disconnect()
|
|
118
118
|
*/
|
|
119
119
|
```
|
|
120
|
-
#### Transfer assets from the Relay chain to Parachain
|
|
120
|
+
#### Transfer assets from the Relay chain to the Parachain
|
|
121
121
|
```ts
|
|
122
122
|
const builder = Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
123
123
|
.from(RELAY_NODE) //Kusama or Polkadot
|
|
@@ -129,7 +129,7 @@ const builder = Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
129
129
|
|
|
130
130
|
const tx = await builder.build()
|
|
131
131
|
|
|
132
|
-
//Make sure to disconnect API after it is no longer used (eg
|
|
132
|
+
//Make sure to disconnect the API after it is no longer used (eg, after a transaction)
|
|
133
133
|
await builder.disconnect()
|
|
134
134
|
|
|
135
135
|
/*
|
|
@@ -161,7 +161,7 @@ const builder = Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
161
161
|
|
|
162
162
|
const tx = await builder.build()
|
|
163
163
|
|
|
164
|
-
//Make sure to disconnect API after it is no longer used (eg
|
|
164
|
+
//Make sure to disconnect the API after it is no longer used (eg, after a transaction)
|
|
165
165
|
await builder.disconnect()
|
|
166
166
|
|
|
167
167
|
/*
|
|
@@ -186,13 +186,13 @@ await builder.disconnect()
|
|
|
186
186
|
```ts
|
|
187
187
|
const builder = Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
188
188
|
.from(NODE)
|
|
189
|
-
.to(NODE) //Has to be same as origin (from)
|
|
189
|
+
.to(NODE) //Has to be the same as the origin (from)
|
|
190
190
|
.currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {multilocation: AssetMultilocationString, amount: amount | AssetMultilocationJson, amount: amount} | {multilocation: Override('Custom Multilocation'), amount: amount} | {multiasset: {currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or multilocation: multilocation*/, amount: amount}})
|
|
191
191
|
.address(address)
|
|
192
192
|
|
|
193
193
|
const tx = await builder.build()
|
|
194
194
|
|
|
195
|
-
//Make sure to disconnect API after it is no longer used (eg
|
|
195
|
+
//Make sure to disconnect the API after it is no longer used (eg, after a transaction)
|
|
196
196
|
await builder.disconnect()
|
|
197
197
|
|
|
198
198
|
/*
|
|
@@ -233,7 +233,7 @@ const tx = await builder.buildBatch({
|
|
|
233
233
|
mode: BatchMode.BATCH_ALL //or BatchMode.BATCH
|
|
234
234
|
})
|
|
235
235
|
|
|
236
|
-
//Make sure to disconnect API after it is no longer used (eg
|
|
236
|
+
//Make sure to disconnect the API after it is no longer used (eg, after a transaction)
|
|
237
237
|
await builder.disconnect()
|
|
238
238
|
```
|
|
239
239
|
|
|
@@ -248,7 +248,7 @@ const builder = Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
248
248
|
|
|
249
249
|
const tx = await builder.build()
|
|
250
250
|
|
|
251
|
-
//Make sure to disconnect API after it is no longer used (eg
|
|
251
|
+
//Make sure to disconnect the API after it is no longer used (eg, after a transaction)
|
|
252
252
|
await builder.disconnect()
|
|
253
253
|
```
|
|
254
254
|
|
|
@@ -272,7 +272,7 @@ const result = hasDryRunSupport(node)
|
|
|
272
272
|
|
|
273
273
|
### XCM Fee queries
|
|
274
274
|
|
|
275
|
-
For full documentation with examples on this feature head
|
|
275
|
+
For full documentation with examples on this feature, head to [official documentation](https://paraspell.github.io/docs/sdk/xcmUtils.html).
|
|
276
276
|
|
|
277
277
|
#### XCM Transfer info
|
|
278
278
|
```ts
|
|
@@ -280,7 +280,7 @@ const info = await Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
280
280
|
.from(ORIGIN_CHAIN)
|
|
281
281
|
.to(DESTINATION_CHAIN)
|
|
282
282
|
.currency(CURRENCY)
|
|
283
|
-
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
|
|
283
|
+
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
|
|
284
284
|
.address(RECIPIENT_ADDRESS)
|
|
285
285
|
.senderAddress(SENDER_ADDRESS)
|
|
286
286
|
.getTransferInfo()
|
|
@@ -292,7 +292,7 @@ const transferable = await Builder(/*node api/ws_url_string/ws_url_array - optio
|
|
|
292
292
|
.from(ORIGIN_CHAIN)
|
|
293
293
|
.to(DESTINATION_CHAIN)
|
|
294
294
|
.currency(CURRENCY)
|
|
295
|
-
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
|
|
295
|
+
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
|
|
296
296
|
.address(RECIPIENT_ADDRESS)
|
|
297
297
|
.senderAddress(SENDER_ADDRESS)
|
|
298
298
|
.getTransferableAmount()
|
|
@@ -304,7 +304,7 @@ const ed = await Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
304
304
|
.from(ORIGIN_CHAIN)
|
|
305
305
|
.to(DESTINATION_CHAIN)
|
|
306
306
|
.currency(CURRENCY)
|
|
307
|
-
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
|
|
307
|
+
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
|
|
308
308
|
.address(RECIPIENT_ADDRESS)
|
|
309
309
|
.senderAddress(SENDER_ADDRESS)
|
|
310
310
|
.verifyEdOnDestination()
|
|
@@ -318,10 +318,10 @@ const fee = await Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
318
318
|
.from(ORIGIN_CHAIN)
|
|
319
319
|
.to(DESTINATION_CHAIN)
|
|
320
320
|
.currency(CURRENCY)
|
|
321
|
-
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
|
|
321
|
+
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
|
|
322
322
|
.address(RECIPIENT_ADDRESS)
|
|
323
323
|
.senderAddress(SENDER_ADDRESS)
|
|
324
|
-
.getXcmFee(/*{disableFallback: true / false}*/) //Fallback is optional. When fallback is disabled, you only get notified of DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin or Destination chain do not support DryRun out of the box.
|
|
324
|
+
.getXcmFee(/*{disableFallback: true / false}*/) //Fallback is optional. When fallback is disabled, you only get notified of a DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin or Destination chain do not support DryRun out of the box.
|
|
325
325
|
```
|
|
326
326
|
|
|
327
327
|
##### Less accurate query using Payment info
|
|
@@ -343,10 +343,10 @@ const fee = await Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
343
343
|
.from(ORIGIN_CHAIN)
|
|
344
344
|
.to(DESTINATION_CHAIN)
|
|
345
345
|
.currency(CURRENCY)
|
|
346
|
-
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
|
|
346
|
+
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
|
|
347
347
|
.address(RECIPIENT_ADDRESS)
|
|
348
348
|
.senderAddress(SENDER_ADDRESS)
|
|
349
|
-
.getOriginXcmFee(/*{disableFallback: true / false}*/) //Fallback is optional. When fallback is disabled, you only get notified of DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin do not support DryRun out of the box.
|
|
349
|
+
.getOriginXcmFee(/*{disableFallback: true / false}*/) //Fallback is optional. When fallback is disabled, you only get notified of a DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin do not support DryRun out of the box.
|
|
350
350
|
```
|
|
351
351
|
|
|
352
352
|
##### Less accurate query using Payment info
|
|
@@ -379,7 +379,7 @@ const fees = await getParaEthTransferFees(/*api - optional (Can also be WS port
|
|
|
379
379
|
```ts
|
|
380
380
|
import { getExistentialDeposit } from "@paraspell/sdk";
|
|
381
381
|
|
|
382
|
-
//Currency is an optional parameter. If you wish to query native asset, currency parameter is not necessary.
|
|
382
|
+
//Currency is an optional parameter. If you wish to query a native asset, the currency parameter is not necessary.
|
|
383
383
|
//Currency can be either {symbol: assetSymbol}, {id: assetId}, {multilocation: assetMultilocation}.
|
|
384
384
|
const ed = getExistentialDeposit(node, currency?)
|
|
385
385
|
```
|
|
@@ -393,7 +393,7 @@ let result = convertSs58(address, node) // returns converted address in string
|
|
|
393
393
|
|
|
394
394
|
### Asset queries:
|
|
395
395
|
|
|
396
|
-
For full documentation with examples on this feature head over to [official documentation](https://paraspell.github.io/docs/sdk/AssetPallet.html).
|
|
396
|
+
For full documentation with examples on this feature, head over to [official documentation](https://paraspell.github.io/docs/sdk/AssetPallet.html).
|
|
397
397
|
|
|
398
398
|
```ts
|
|
399
399
|
import { getFeeAssets, getAssetsObject, getAssetId, getRelayChainSymbol, getNativeAssets, getNativeAssets, getOtherAssets, getAllAssetsSymbols, hasSupportForAsset, getAssetDecimals, getParaId, getTNode, getAssetMultiLocation, NODE_NAMES } from '@paraspell/sdk'
|
|
@@ -401,10 +401,10 @@ import { getFeeAssets, getAssetsObject, getAssetId, getRelayChainSymbol, getNati
|
|
|
401
401
|
// Retrieve Fee asset queries (Assets accepted as XCM Fee on specific node)
|
|
402
402
|
getFeeAssets(NODE)
|
|
403
403
|
|
|
404
|
-
// Get multilocation for asset
|
|
404
|
+
// Get multilocation for asset ID or symbol on a specific chain
|
|
405
405
|
getAssetMultiLocation(NODE, { symbol: symbol } | { id: assetId })
|
|
406
406
|
|
|
407
|
-
// Retrieve assets object from assets.json for particular node including information about native and foreign assets
|
|
407
|
+
// Retrieve assets object from assets.json for a particular node, including information about native and foreign assets
|
|
408
408
|
getAssetsObject(NODE)
|
|
409
409
|
|
|
410
410
|
// Retrieve foreign assetId for a particular node and asset symbol
|
|
@@ -413,13 +413,13 @@ getAssetId(NODE, ASSET_SYMBOL)
|
|
|
413
413
|
// Retrieve the symbol of the relay chain for a particular node. Either "DOT" or "KSM"
|
|
414
414
|
getRelayChainSymbol(NODE)
|
|
415
415
|
|
|
416
|
-
// Retrieve string array of native assets symbols for particular node
|
|
416
|
+
// Retrieve string array of native assets symbols for a particular node
|
|
417
417
|
getNativeAssets(NODE)
|
|
418
418
|
|
|
419
|
-
// Retrieve object array of foreign assets for a particular node. Each object has a symbol and assetId property
|
|
419
|
+
// Retrieve object array of foreign assets for a particular node. Each object has a symbol and an assetId property
|
|
420
420
|
getOtherAssets(NODE)
|
|
421
421
|
|
|
422
|
-
// Retrieve string array of all
|
|
422
|
+
// Retrieve string array of all asset symbols. (native and foreign assets are merged into a single array)
|
|
423
423
|
getAllAssetsSymbols(NODE)
|
|
424
424
|
|
|
425
425
|
// Check if a node supports a particular asset. (Both native and foreign assets are searched). Returns boolean
|
|
@@ -432,7 +432,7 @@ getAssetDecimals(NODE, ASSET_SYMBOL)
|
|
|
432
432
|
getParaId(NODE)
|
|
433
433
|
|
|
434
434
|
// Get specific TNode from nodeID
|
|
435
|
-
getTNode(paraID: number, ecosystem: 'polkadot' || 'kusama' || 'ethereum') //When Ethereum ecosystem is selected please fill nodeID as 1 to select Ethereum.
|
|
435
|
+
getTNode(paraID: number, ecosystem: 'polkadot' || 'kusama' || 'ethereum') //When the Ethereum ecosystem is selected, please fill nodeID as 1 to select Ethereum.
|
|
436
436
|
|
|
437
437
|
// Import all compatible nodes as constant
|
|
438
438
|
NODE_NAMES
|
|
@@ -484,4 +484,4 @@ Published under [MIT License](https://github.com/paraspell/xcm-tools/blob/main/p
|
|
|
484
484
|
<img width="200" alt="version" src="https://user-images.githubusercontent.com/55763425/211145923-f7ee2a57-3e63-4b7d-9674-2da9db46b2ee.png" />
|
|
485
485
|
<img width="200" alt="version" src="https://github.com/paraspell/xcm-sdk/assets/55763425/9ed74ebe-9b29-4efd-8e3e-7467ac4caed6" />
|
|
486
486
|
</p>
|
|
487
|
-
</div>
|
|
487
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.7",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ethers": "^6.13.7",
|
|
28
28
|
"quick-lru": "^7.0.1",
|
|
29
29
|
"viem": "^2.28.1",
|
|
30
|
-
"@paraspell/sdk-core": "10.1.
|
|
30
|
+
"@paraspell/sdk-core": "10.1.7"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"polkadot-api": ">= 1.10.2 < 2"
|