@paraspell/sdk 5.2.1 → 5.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/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <img alt="snyk" src="https://snyk.io/test/github/paraspell/sdk/badge.svg" />
18
18
  </a>
19
19
  </p>
20
- <p>Currently supporting 53 Polkadot & Kusama nodes list <a href = "https://github.com/paraspell/xcm-tools/blob/main/packages/sdk/docs/supportedNodes.md"\>[here]</p>
20
+ <p>Currently supporting 54 Polkadot & Kusama nodes list <a href = "https://github.com/paraspell/xcm-tools/blob/main/packages/sdk/docs/supportedNodes.md"\>[here]</p>
21
21
  <p>SDK documentation <a href = "https://paraspell.github.io/docs/" \>[here]</p>
22
22
  </div>
23
23
 
@@ -57,11 +57,13 @@ const paraspell = require('@paraspell/sdk')
57
57
 
58
58
  ```
59
59
  NOTES:
60
- - If you wish to transfer from Parachain that uses long IDs for example Moonbeam you have to add the character 'n' the end of currencyID. Eg: .currency(42259045809535163221576417993425387648n) will mean you transfer xcDOT.
60
+ - If you wish to transfer from Parachain that uses long IDs for example Moonbeam you have to add the character 'n' to the end of currencyID. Eg: .currency(42259045809535163221576417993425387648n) will mean you transfer xcDOT.
61
61
  - You can now use custom ParachainIDs if you wish to test in TestNet. Just add parachainID as an additional parameter eg: .to('Basilisk', 2948)
62
- - You can now add optional parameter useKeepAlive which will ensure, that you send more than existential deposit.
63
- - Since v5 you can fully customize all multilocations (address, currency and destination). Instead of string parameter simply pass object with multilocation instead for more information refer to the following PR https://github.com/paraspell/xcm-tools/pull/199.
64
- - Fee asset is now an optional parameter.
62
+ - You can now add an optional parameter useKeepAlive which will ensure, that you send more than the existential deposit.
63
+ - Since v5 you can fully customize all multilocations (address, currency and destination). Instead of a string parameter simply pass an object with multilocation instead for more information refer to the following PR https://github.com/paraspell/xcm-tools/pull/199.
64
+ - Fee asset is now a required builder parameter when you enter a multilocation array.
65
+ - When using a multilocation array the amount parameter is overridden.
66
+ - Multilocation arrays are now available. Customize your asset multilocations by .currency([{multilocation1},{multilocation2}..{multilocationN}]) For more information refer to the official documentation or following PR https://github.com/paraspell/xcm-tools/pull/224.
65
67
  ```
66
68
 
67
69
  ### Builder pattern:
@@ -71,9 +73,9 @@ NOTES:
71
73
  await Builder(/*node api - optional*/)
72
74
  .from(NODE)
73
75
  .to(NODE /*,customParaId - optional*/ | Multilocation object /*Only works for PolkadotXCM pallet*/)
74
- .currency(CurrencyString| | CurrencyID | Multilocation object)
75
- /*.feeAsset(feeAsset) - Optional (Fee asset select id)*/
76
- .amount(amount)
76
+ .currency(CurrencyString| | CurrencyID | Multilocation object | MultilocationArray)
77
+ /*.feeAsset(feeAsset) - Parameter required when using MultilocationArray*/
78
+ .amount(amount) // Overriden when using MultilocationArray
77
79
  .address(address | Multilocation object /*If you are sending through xTokens, you need to pass the destination and address multilocation in one object (x2)*/)
78
80
  .build()
79
81
  /*
@@ -107,7 +109,6 @@ await Builder()
107
109
  ```ts
108
110
  await Builder(/*node api - optional*/)
109
111
  .from(NODE)
110
- /*.feeAsset(feeAsset) - Optional (Fee asset select id)*/
111
112
  .amount(amount)
112
113
  .address(address | Multilocation object)
113
114
  .build()
@@ -144,7 +145,7 @@ Builder(api)
144
145
 
145
146
  ##### Open HRMP channels
146
147
  ```ts
147
- Builder(api)
148
+ Builder()
148
149
  .from(NODE)
149
150
  .to(NODE)
150
151
  .openChannel()
@@ -182,7 +183,6 @@ await paraspell.xcmPallet.send(
182
183
  api?: ApiPromise,
183
184
  origin: origin Parachain name string,
184
185
  amount: any,
185
- feeAsset? - Fee asset select id,
186
186
  to: destination address string | Multilocation object,
187
187
  paraIdTo?: number,
188
188
  destApiForKeepAlive?: ApiPromise
@@ -223,6 +223,17 @@ paraspell.openChannels.openChannel(
223
223
  )
224
224
  ```
225
225
 
226
+ ### Asset claim:
227
+ ```ts
228
+ //Claim XCM trapped assets from the selected chain
229
+ await Builder(api)
230
+ .claimFrom(NODE)
231
+ .fungible(MultilocationArray (Only one multilocation allowed) [{Multilocation}])
232
+ .account(address | Multilocation object)
233
+ /*.xcmVersion(Version.V3) Optional parameter, by default V3. XCM Version ENUM if a different XCM version is needed (Supported V2 & V3). Requires importing Version enum.*/
234
+ .build()
235
+ ```
236
+
226
237
  ### Asset queries:
227
238
 
228
239
  ```ts