@paraspell/sdk 11.8.6 → 11.9.1

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
@@ -91,7 +91,7 @@ For full documentation with examples on this feature head over to [official docu
91
91
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
92
92
  .from(CHAIN)
93
93
  .to(CHAIN /*,customParaId - optional*/ | Location object /*Only works for PolkadotXCM pallet*/)
94
- .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {location: AssetLocationString, amount: amount | AssetLocationJson, amount: amount} | {location: Override('Custom Location'), amount: amount} | [{currencySelection /*for example symbol: symbol or id: id, or location: location*/, amount: amount}, {currencySelection}, ..])
94
+ .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Native('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Foreign('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: ForeignAbstract('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {location: AssetLocationString, amount: amount /*Use "ALL" to transfer everything*/ | AssetLocationJson, amount: amount /*Use "ALL" to transfer everything*/} | {location: Override('Custom Location'), amount: amount /*Use "ALL" to transfer everything*/} | [{currencySelection /*for example symbol: symbol or id: id, or location: location*/, amount: amount /*Use "ALL" to transfer everything*/}, {currencySelection}, ..])
95
95
  .address(address | Location object /*If you are sending through xTokens, you need to pass the destination and address Location in one object (x2)*/)
96
96
  .senderAddress(address) // - OPTIONAL but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT ED.
97
97
  /*.ahAddress(ahAddress) - OPTIONAL - used when origin is EVM chain and XCM goes through AssetHub (Multihop transfer where we are unable to convert Key20 to ID32 address eg. origin: Moonbeam & destination: Ethereum (Multihop goes from Moonbeam > AssetHub > BridgeHub > Ethereum)
@@ -127,7 +127,7 @@ await builder.disconnect()
127
127
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
128
128
  .from(RELAY_CHAIN) // Kusama | Polkadot | Westend | Paseo
129
129
  .to(CHAIN/*,customParaId - optional*/ | Location object)
130
- .currency({symbol: 'DOT', amount: amount})
130
+ .currency({symbol: 'DOT', amount: amount /*Use "ALL" to transfer everything*/})
131
131
  .address(address | Location object)
132
132
  /*.xcmVersion(Version.V3/V4/V5) //Optional parameter for manual override of XCM Version used in call
133
133
  .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.*/
@@ -160,7 +160,7 @@ await builder.disconnect()
160
160
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
161
161
  .from(CHAIN)
162
162
  .to(RELAY_CHAIN) // Kusama | Polkadot | Westend | Paseo
163
- .currency({symbol: 'DOT', amount: amount})
163
+ .currency({symbol: 'DOT', amount: amount /*Use "ALL" to transfer everything*/})
164
164
  .address(address | Location object)
165
165
  /*.xcmVersion(Version.V3/V4/V5) //Optional parameter for manual override of XCM Version used in call
166
166
  .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.*/
@@ -193,7 +193,7 @@ await builder.disconnect()
193
193
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
194
194
  .from(CHAIN)
195
195
  .to(CHAIN) //Has to be the same as the origin (from)
196
- .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {location: AssetLocationString, amount: amount | AssetLocationJson, amount: amount} | {location: Override('Custom Location'), amount: amount} | [{currencySelection /*for example symbol: symbol or id: id, or location: location*/, amount: amount}, {currencySelection}, ..])
196
+ .currency({id: currencyID, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: currencySymbol, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Native('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Foreign('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: ForeignAbstract('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {location: AssetLocationString, amount: amount /*Use "ALL" to transfer everything*/ | AssetLocationJson, amount: amount /*Use "ALL" to transfer everything*/} | {location: Override('Custom Location'), amount: amount /*Use "ALL" to transfer everything*/} | [{currencySelection /*for example symbol: symbol or id: id, or location: location*/, amount: amount /*Use "ALL" to transfer everything*/}, {currencySelection}, ..])
197
197
  .address(address)
198
198
 
199
199
  const tx = await builder.build()
@@ -248,7 +248,7 @@ await builder.disconnect()
248
248
  //Claim XCM trapped assets from the selected chain
249
249
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
250
250
  .claimFrom(CHAIN)
251
- .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {location: AssetLocationString, amount: amount | AssetLocationJson, amount: amount} | [{currencySelection /*for example symbol: symbol or id: id, or location: location*/, amount: amount}, {currencySelection}, ..]
251
+ .currency({id: currencyID, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: currencySymbol, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Native('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Foreign('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: ForeignAbstract('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {location: AssetLocationString, amount: amount /*Use "ALL" to transfer everything*/ | AssetLocationJson, amount: amount /*Use "ALL" to transfer everything*/} | [{currencySelection /*for example symbol: symbol or id: id, or location: location*/, amount: amount /*Use "ALL" to transfer everything*/}, {currencySelection}, ..]
252
252
  )
253
253
  .address(address | Location object)
254
254
  /*.xcmVersion(Version.V3) Optional parameter, by default chain specific version. XCM Version ENUM if a different XCM version is needed (Supported V3 & V4 & V5). Requires importing Version enum.*/
@@ -265,7 +265,7 @@ await builder.disconnect()
265
265
  const result = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
266
266
  .from(CHAIN)
267
267
  .to(CHAIN_2)
268
- .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {location: AssetLocationString, amount: amount | AssetLocationJson, amount: amount} | {location: Override('Custom Location'), amount: amount} | {[{currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or Location: Location*/, amount: amount}]})
268
+ .currency({id: currencyID, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: currencySymbol, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Native('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Foreign('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: ForeignAbstract('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {location: AssetLocationString, amount: amount /*Use "ALL" to transfer everything*/ | AssetLocationJson, amount: amount /*Use "ALL" to transfer everything*/} | {location: Override('Custom Location'), amount: amount /*Use "ALL" to transfer everything*/} | {[{currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or Location: Location*/, amount: amount /*Use "ALL" to transfer everything*/}]})
269
269
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
270
270
  .address(ADDRESS)
271
271
  .senderAddress(SENDER_ADDRESS)
@@ -285,7 +285,7 @@ More on this feature in [official documentation](https://paraspell.github.io/doc
285
285
  const result = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
286
286
  .from(CHAIN)
287
287
  .to(CHAIN_2)
288
- .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {location: AssetLocationString, amount: amount | AssetLocationJson, amount: amount} | {location: Override('Custom Location'), amount: amount} | {[{currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or Location: Location*/, amount: amount}]})
288
+ .currency({id: currencyID, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: currencySymbol, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Native('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Foreign('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: ForeignAbstract('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {location: AssetLocationString, amount: amount /*Use "ALL" to transfer everything*/ | AssetLocationJson, amount: amount /*Use "ALL" to transfer everything*/} | {location: Override('Custom Location'), amount: amount /*Use "ALL" to transfer everything*/} | {[{currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or Location: Location*/, amount: amount /*Use "ALL" to transfer everything*/}]})
289
289
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
290
290
  .address(ADDRESS)
291
291
  .senderAddress(SENDER_ADDRESS)
@@ -309,7 +309,7 @@ const builder = await Builder({
309
309
  })
310
310
  .from(CHAIN)
311
311
  .to(CHAIN)
312
- .currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {location: AssetLocationString, amount: amount | AssetLocationJson, amount: amount} | {location: Override('Custom Location'), amount: amount} | [{currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or Location: Location*/, amount: amount}])
312
+ .currency({id: currencyID, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: currencySymbol, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Native('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: Foreign('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {symbol: ForeignAbstract('currencySymbol'), amount: amount /*Use "ALL" to transfer everything*/} | {location: AssetLocationString, amount: amount /*Use "ALL" to transfer everything*/ | AssetLocationJson, amount: amount /*Use "ALL" to transfer everything*/} | {location: Override('Custom Location'), amount: amount /*Use "ALL" to transfer everything*/} | [{currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or Location: Location*/, amount: amount /*Use "ALL" to transfer everything*/}])
313
313
  .address(address)
314
314
 
315
315
  const tx = await builder.build()
package/dist/index.cjs CHANGED
@@ -1294,7 +1294,7 @@ var PapiApi = /*#__PURE__*/function () {
1294
1294
  if (chain === 'Centrifuge' || chain === 'Altair') {
1295
1295
  pallet = 'OrmlTokens';
1296
1296
  }
1297
- if (!(chain === 'Peaq' || chain === 'Manta' || chain === 'Crust')) {
1297
+ if (!(chain === 'Peaq' || chain === 'Manta' || chain === 'Crust' || chain === 'Ajuna')) {
1298
1298
  _context15.n = 2;
1299
1299
  break;
1300
1300
  }
@@ -1507,7 +1507,9 @@ var PapiApi = /*#__PURE__*/function () {
1507
1507
  }
1508
1508
  var erroredEvent = findFailingEvent(result);
1509
1509
  if (erroredEvent) {
1510
- return erroredEvent.value.value.result.value.value.value.type;
1510
+ var _result$value$value$v, _result$value$value$v2;
1511
+ var _result = erroredEvent.value.value.result;
1512
+ return (_result$value$value$v = (_result$value$value$v2 = _result.value.value.value) === null || _result$value$value$v2 === void 0 ? void 0 : _result$value$value$v2.type) !== null && _result$value$value$v !== void 0 ? _result$value$value$v : _result.value.value.type;
1511
1513
  }
1512
1514
  return JSON.stringify((_ref1 = (_result$value6 = result === null || result === void 0 ? void 0 : result.value) !== null && _result$value6 !== void 0 ? _result$value6 : result) !== null && _ref1 !== void 0 ? _ref1 : 'Unknown error structure', sdkCore.replaceBigInt);
1513
1515
  };
@@ -1559,7 +1561,7 @@ var PapiApi = /*#__PURE__*/function () {
1559
1561
  forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
1560
1562
  destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
1561
1563
  _context20.n = 9;
1562
- return this.calculateTransactionFee(resolvedTx, address);
1564
+ return this.calculateTransactionFee(tx, address);
1563
1565
  case 9:
1564
1566
  executionFee = _context20.v;
1565
1567
  nativeAsset = sdkCore.findNativeAssetInfoOrThrow(chain);
package/dist/index.d.ts CHANGED
@@ -190,6 +190,8 @@ declare const EvmBuilder: (api?: TBuilderOptions<TPapiApiOrUrl>) => EvmBuilderCo
190
190
  * @returns An extrinsic to be signed and sent.
191
191
  */
192
192
  declare const send: (options: _paraspell_sdk_core.TSendBaseOptions & {
193
+ isAmountAll: boolean;
194
+ } & {
193
195
  api?: TPapiApiOrUrl;
194
196
  }) => Promise<TPapiTransaction>;
195
197
  declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<TPapiTransaction> & {
package/dist/index.mjs CHANGED
@@ -1293,7 +1293,7 @@ var PapiApi = /*#__PURE__*/function () {
1293
1293
  if (chain === 'Centrifuge' || chain === 'Altair') {
1294
1294
  pallet = 'OrmlTokens';
1295
1295
  }
1296
- if (!(chain === 'Peaq' || chain === 'Manta' || chain === 'Crust')) {
1296
+ if (!(chain === 'Peaq' || chain === 'Manta' || chain === 'Crust' || chain === 'Ajuna')) {
1297
1297
  _context15.n = 2;
1298
1298
  break;
1299
1299
  }
@@ -1506,7 +1506,9 @@ var PapiApi = /*#__PURE__*/function () {
1506
1506
  }
1507
1507
  var erroredEvent = findFailingEvent(result);
1508
1508
  if (erroredEvent) {
1509
- return erroredEvent.value.value.result.value.value.value.type;
1509
+ var _result$value$value$v, _result$value$value$v2;
1510
+ var _result = erroredEvent.value.value.result;
1511
+ return (_result$value$value$v = (_result$value$value$v2 = _result.value.value.value) === null || _result$value$value$v2 === void 0 ? void 0 : _result$value$value$v2.type) !== null && _result$value$value$v !== void 0 ? _result$value$value$v : _result.value.value.type;
1510
1512
  }
1511
1513
  return JSON.stringify((_ref1 = (_result$value6 = result === null || result === void 0 ? void 0 : result.value) !== null && _result$value6 !== void 0 ? _result$value6 : result) !== null && _ref1 !== void 0 ? _ref1 : 'Unknown error structure', replaceBigInt);
1512
1514
  };
@@ -1558,7 +1560,7 @@ var PapiApi = /*#__PURE__*/function () {
1558
1560
  forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
1559
1561
  destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
1560
1562
  _context20.n = 9;
1561
- return this.calculateTransactionFee(resolvedTx, address);
1563
+ return this.calculateTransactionFee(tx, address);
1562
1564
  case 9:
1563
1565
  executionFee = _context20.v;
1564
1566
  nativeAsset = findNativeAssetInfoOrThrow(chain);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "11.8.6",
3
+ "version": "11.9.1",
4
4
  "description": "SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@noble/hashes": "^1.8.0",
27
27
  "viem": "^2.37.9",
28
- "@paraspell/sdk-core": "11.8.6"
28
+ "@paraspell/sdk-core": "11.9.1"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "polkadot-api": ">= 1.19.1 < 2"