@paraspell/sdk 5.8.0 → 5.10.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/README.md +26 -1
- package/dist/index.cjs +1481 -525
- package/dist/index.d.ts +542 -68
- package/dist/index.mjs +1475 -527
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -67,6 +67,7 @@ NOTES:
|
|
|
67
67
|
- POLKADOT <> KUSAMA Bridge is now available! Try sending DOT or KSM between AssetHubs - More information here: https://paraspell.github.io/docs/sdk/xcmPallet.html#ecosystem-bridges.
|
|
68
68
|
- You can now customize XCM Version! Try using .xcmVersion parameter after address in builder.
|
|
69
69
|
- POLKADOT <> ETHEREUM Bridge is now available! Try sending WETH between the ecosystems - More information here: https://paraspell.github.io/docs/sdk/xcmPallet.html#ecosystem-bridges.
|
|
70
|
+
- If you have duplicit asset error when building your call you can now specify which asset by new object selection eg. {symbol: number | bigint | string } or {id: number | bigint | string}
|
|
70
71
|
```
|
|
71
72
|
|
|
72
73
|
### Builder pattern:
|
|
@@ -76,7 +77,7 @@ NOTES:
|
|
|
76
77
|
await Builder(/*node api - optional*/)
|
|
77
78
|
.from(NODE)
|
|
78
79
|
.to(NODE /*,customParaId - optional*/ | Multilocation object /*Only works for PolkadotXCM pallet*/)
|
|
79
|
-
.currency(CurrencyString| CurrencyID | Multilocation object | MultilocationArray)
|
|
80
|
+
.currency(CurrencyString | CurrencyID | Multilocation object | MultilocationArray | { symbol: string | number | bigint} | { id: string | number | bigint}) // Object selection is used when there are duplicate assets found and selector is unable to pick based on details provided (You will get an error from SDK when this happens).
|
|
80
81
|
/*.feeAsset(feeAsset) - Parameter required when using MultilocationArray*/
|
|
81
82
|
.amount(amount) // Overriden when using MultilocationArray
|
|
82
83
|
.address(address | Multilocation object /*If you are sending through xTokens, you need to pass the destination and address multilocation in one object (x2)*/)
|
|
@@ -140,6 +141,30 @@ await Builder(/*node api - optional*/)
|
|
|
140
141
|
/*.xcmVersion(Version.V1/V2/V3/V4) //Optional parameter for manual override of XCM Version used in call*/
|
|
141
142
|
.build()
|
|
142
143
|
```
|
|
144
|
+
|
|
145
|
+
##### Batch calls
|
|
146
|
+
You can batch XCM calls and execute multiple XCM calls within one call. All three scenarios (Para->Para, Para->Relay, Relay->Para) can be used and combined.
|
|
147
|
+
```js
|
|
148
|
+
await Builder(/*node api - optional*/)
|
|
149
|
+
.from(NODE) //Ensure, that origin node is the same in all batched XCM Calls.
|
|
150
|
+
.to(NODE_2) //Any compatible Parachain
|
|
151
|
+
.currency(currency) //Currency to transfer (If Para->Para), otherwise you do not need to specify .currency()
|
|
152
|
+
.amount(amount)
|
|
153
|
+
.address(address | Multilocation object)
|
|
154
|
+
.addToBatch()
|
|
155
|
+
|
|
156
|
+
.from(NODE) //Ensure, that origin node is the same in all batched XCM Calls.
|
|
157
|
+
.to(NODE_3) //Any compatible Parachain
|
|
158
|
+
.currency(currency) //Currency to transfer (If Para->Para), otherwise you do not need to specify .currency()
|
|
159
|
+
.amount(amount)
|
|
160
|
+
.address(address | Multilocation object)
|
|
161
|
+
.addToBatch()
|
|
162
|
+
.buildBatch({
|
|
163
|
+
// This settings object is optional and batch all is the default option
|
|
164
|
+
mode: BatchMode.BATCH_ALL //or BatchMode.BATCH
|
|
165
|
+
})
|
|
166
|
+
```
|
|
167
|
+
|
|
143
168
|
##### Close HRMP channels
|
|
144
169
|
```ts
|
|
145
170
|
Builder(api)
|