@paraspell/sdk-pjs 12.0.4 → 12.0.6

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.
Files changed (3) hide show
  1. package/README.md +16 -16
  2. package/dist/index.mjs +207 -146
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -86,7 +86,7 @@ For full documentation on XCM Transfers head over to [official documentation](ht
86
86
 
87
87
  ```ts
88
88
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
89
- .from(TChain)
89
+ .from(TSubstrateChain)
90
90
  .to(TChain /*,customParaId - optional*/ | Location object /*Only works for PolkadotXCM pallet*/)
91
91
  .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}, ..])
92
92
  .address(address | Location object /*If you are sending through xTokens, you need to pass the destination and address Location in one object (x2)*/)
@@ -157,7 +157,7 @@ await builder.disconnect()
157
157
 
158
158
  ```ts
159
159
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
160
- .from(TChain)
160
+ .from(TSubstrateChain)
161
161
  .to(TRelaychain) // Kusama | Polkadot | Westend | Paseo
162
162
  .currency({symbol: 'DOT', amount: amount /*Use "ALL" to transfer everything*/})
163
163
  .address(address | Location object)
@@ -191,7 +191,7 @@ await builder.disconnect()
191
191
 
192
192
  ```ts
193
193
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
194
- .from(TChain)
194
+ .from(TSubstrateChain)
195
195
  .to(TChain) //Has to be the same as the origin (from)
196
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)
@@ -223,13 +223,13 @@ await builder.disconnect()
223
223
 
224
224
  ```ts
225
225
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
226
- .from(TChain) //Ensure, that origin chain is the same in all batched XCM Calls.
226
+ .from(TSubstrateChain) //Ensure, that origin chain is the same in all batched XCM Calls.
227
227
  .to(TChain2) //Any compatible Parachain
228
228
  .currency({currencySelection, amount}) //Currency to transfer - options as in scenarios above
229
229
  .address(address | Location object)
230
230
  .addToBatch()
231
231
 
232
- .from(TChain) //Ensure, that origin chain is the same in all batched XCM Calls.
232
+ .from(TSubstrateChain) //Ensure, that origin chain is the same in all batched XCM Calls.
233
233
  .to(TChain3) //Any compatible Parachain
234
234
  .currency({currencySelection, amount}) //Currency to transfer - options as in scenarios above
235
235
  .address(address | Location object)
@@ -249,7 +249,7 @@ await builder.disconnect()
249
249
  ```ts
250
250
  //Claim XCM trapped assets from the selected chain
251
251
  const builder = Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
252
- .claimFrom(TChain)
252
+ .claimfrom(TSubstrateChain)
253
253
  .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}, ..]
254
254
  )
255
255
  .address(address | Location object)
@@ -265,7 +265,7 @@ await builder.disconnect()
265
265
  ```ts
266
266
  //Builder pattern
267
267
  const result = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
268
- .from(TChain)
268
+ .from(TSubstrateChain)
269
269
  .to(TChain)
270
270
  .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*/}]})
271
271
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
@@ -284,7 +284,7 @@ const result = hasDryRunSupport(chain)
284
284
  ```ts
285
285
  //Builder pattern
286
286
  const result = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
287
- .from(TChain)
287
+ .from(TSubstrateChain)
288
288
  .to(TChain)
289
289
  .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*/}]})
290
290
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
@@ -305,7 +305,7 @@ const builder = await Builder({
305
305
  //ChainName: ...
306
306
  }
307
307
  })
308
- .from(TChain)
308
+ .from(TSubstrateChain)
309
309
  .to(TChain)
310
310
  .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*/}])
311
311
  .address(address)
@@ -323,7 +323,7 @@ For full documentation with output examples of XCM Fee queries, head to [officia
323
323
  #### XCM Transfer info
324
324
  ```ts
325
325
  const info = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
326
- .from(TChain)
326
+ .from(TSubstrateChain)
327
327
  .to(TChain)
328
328
  .currency(CURRENCY_SPEC)
329
329
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
@@ -335,7 +335,7 @@ const info = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array
335
335
  #### Transferable amount
336
336
  ```ts
337
337
  const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
338
- .from(TChain)
338
+ .from(TSubstrateChain)
339
339
  .to(TChain)
340
340
  .currency(CURRENCY_SPEC)
341
341
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
@@ -347,7 +347,7 @@ const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_u
347
347
  #### Minimal transferable amount
348
348
  ```ts
349
349
  const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
350
- .from(TChain)
350
+ .from(TSubstrateChain)
351
351
  .to(TChain)
352
352
  .currency(CURRENCY_SPEC)
353
353
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
@@ -359,7 +359,7 @@ const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_u
359
359
  #### Receivable amount
360
360
  ```ts
361
361
  const receivable = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
362
- .from(TChain)
362
+ .from(TSubstrateChain)
363
363
  .to(TChain)
364
364
  .currency(CURRENCY_SPEC)
365
365
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
@@ -371,7 +371,7 @@ const receivable = await Builder(/*chain api/builder_config/ws_url_string/ws_url
371
371
  #### Verify ED on destination
372
372
  ```ts
373
373
  const ed = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
374
- .from(TChain)
374
+ .from(TSubstrateChain)
375
375
  .to(TChain)
376
376
  .currency(CURRENCY_SPEC)
377
377
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
@@ -384,7 +384,7 @@ const ed = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array -
384
384
 
385
385
  ```ts
386
386
  const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
387
- .from(TChain)
387
+ .from(TSubstrateChain)
388
388
  .to(TChain)
389
389
  .currency(CURRENCY_SPEC)
390
390
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
@@ -397,7 +397,7 @@ const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array
397
397
 
398
398
  ```ts
399
399
  const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
400
- .from(TChain)
400
+ .from(TSubstrateChain)
401
401
  .to(TChain)
402
402
  .currency(CURRENCY_SPEC)
403
403
  /*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { isConfig, BatchMode, MissingChainApiError, getChainProviders, UnsupportedOperationError, computeFeeFromDryRunPjs, findNativeAssetInfoOrThrow, hasXcmPaymentApiSupport, resolveModuleError, getAssetsObject, RuntimeApiUnavailableError, wrapTxBypass, assertHasLocation, localizeLocation, isAssetXcEqual, addXcmVersionHeader, Version, createChainClient as createChainClient$1, getBalance as getBalance$1, claimAssets as claimAssets$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, getParaId, ETH_CHAIN_ID, RoutingResolutionError, findAssetInfoOrThrow, abstractDecimals, assertHasId, MissingParameterError, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress as validateAddress$1, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
1
+ import { isConfig, BatchMode, findNativeAssetInfoOrThrow, MissingChainApiError, getChainProviders, UnsupportedOperationError, findAssetInfoOrThrow, computeFeeFromDryRunPjs, hasXcmPaymentApiSupport, resolveModuleError, getAssetsObject, RuntimeApiUnavailableError, wrapTxBypass, assertHasLocation, localizeLocation, isAssetXcEqual, addXcmVersionHeader, Version, createChainClient as createChainClient$1, getBalance as getBalance$1, claimAssets as claimAssets$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, getParaId, ETH_CHAIN_ID, RoutingResolutionError, abstractDecimals, assertHasId, MissingParameterError, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress as validateAddress$1, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
2
2
  export * from '@paraspell/sdk-core';
3
3
  import { WsProvider, ApiPromise } from '@polkadot/api';
4
4
  import { isHex, u8aToHex, hexToU8a, stringToU8a } from '@polkadot/util';
@@ -580,19 +580,72 @@ var PolkadotJsApi = /*#__PURE__*/function () {
580
580
  }
581
581
  return createApiForChain;
582
582
  }()
583
+ }, {
584
+ key: "resolveDefaultFeeAsset",
585
+ value: function resolveDefaultFeeAsset(_ref2) {
586
+ var chain = _ref2.chain,
587
+ feeAsset = _ref2.feeAsset;
588
+ return feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrow(chain);
589
+ }
590
+ }, {
591
+ key: "resolveFeeAsset",
592
+ value: function () {
593
+ var _resolveFeeAsset = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(options) {
594
+ var chain, address, response, assetId;
595
+ return _regenerator().w(function (_context9) {
596
+ while (1) switch (_context9.n) {
597
+ case 0:
598
+ chain = options.chain, address = options.address;
599
+ if (chain.startsWith('Hydration')) {
600
+ _context9.n = 1;
601
+ break;
602
+ }
603
+ return _context9.a(2, {
604
+ isCustomAsset: false,
605
+ asset: this.resolveDefaultFeeAsset(options)
606
+ });
607
+ case 1:
608
+ _context9.n = 2;
609
+ return this.api.query.multiTransactionPayment.accountCurrencyMap(address);
610
+ case 2:
611
+ response = _context9.v;
612
+ assetId = response.toJSON();
613
+ if (!(assetId === null)) {
614
+ _context9.n = 3;
615
+ break;
616
+ }
617
+ return _context9.a(2, {
618
+ isCustomAsset: false,
619
+ asset: this.resolveDefaultFeeAsset(options)
620
+ });
621
+ case 3:
622
+ return _context9.a(2, {
623
+ isCustomAsset: true,
624
+ asset: findAssetInfoOrThrow(chain, {
625
+ id: assetId
626
+ }, null)
627
+ });
628
+ }
629
+ }, _callee9, this);
630
+ }));
631
+ function resolveFeeAsset(_x15) {
632
+ return _resolveFeeAsset.apply(this, arguments);
633
+ }
634
+ return resolveFeeAsset;
635
+ }()
583
636
  }, {
584
637
  key: "getDryRunCall",
585
638
  value: function () {
586
- var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(options) {
639
+ var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(options) {
587
640
  var _this = this;
588
- var tx, address, feeAsset, chain, destination, _options$useRootOrigi, useRootOrigin, bypassOptions, supportsDryRunApi, DEFAULT_XCM_VERSION, basePayload, resolvedTx, usedAsset, performDryRunCall, getExecutionSuccessFromResult, extractFailureReasonFromResult, response, resultHuman, resultJson, isSuccess, failureErr, shouldRetryWithVersion, msg, _msg, forwardedXcms, actualWeight, weight, nativeAsset, hasLocation, destParaId, xcmFee, executionFee, fee, _t, _t2, _t3;
589
- return _regenerator().w(function (_context0) {
590
- while (1) switch (_context0.p = _context0.n) {
641
+ var tx, address, feeAsset, chain, destination, _options$useRootOrigi, useRootOrigin, bypassOptions, supportsDryRunApi, DEFAULT_XCM_VERSION, basePayload, resolvedTx, resolvedFeeAsset, performDryRunCall, getExecutionSuccessFromResult, extractFailureReasonFromResult, response, resultHuman, resultJson, isSuccess, failureErr, shouldRetryWithVersion, msg, _msg, forwardedXcms, actualWeight, weight, nativeAsset, hasLocation, destParaId, xcmFee, executionFee, fee, _t, _t2, _t3;
642
+ return _regenerator().w(function (_context1) {
643
+ while (1) switch (_context1.p = _context1.n) {
591
644
  case 0:
592
645
  tx = options.tx, address = options.address, feeAsset = options.feeAsset, chain = options.chain, destination = options.destination, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi, bypassOptions = options.bypassOptions;
593
646
  supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
594
647
  if (supportsDryRunApi) {
595
- _context0.n = 1;
648
+ _context1.n = 1;
596
649
  break;
597
650
  }
598
651
  throw new RuntimeApiUnavailableError(chain, 'DryRunApi');
@@ -608,34 +661,37 @@ var PolkadotJsApi = /*#__PURE__*/function () {
608
661
  }
609
662
  };
610
663
  if (!useRootOrigin) {
611
- _context0.n = 3;
664
+ _context1.n = 3;
612
665
  break;
613
666
  }
614
- _context0.n = 2;
667
+ _context1.n = 2;
615
668
  return wrapTxBypass(_objectSpread2(_objectSpread2({}, options), {}, {
616
669
  api: this
617
670
  }), bypassOptions);
618
671
  case 2:
619
- _t = _context0.v;
620
- _context0.n = 4;
672
+ _t = _context1.v;
673
+ _context1.n = 4;
621
674
  break;
622
675
  case 3:
623
676
  _t = tx;
624
677
  case 4:
625
678
  resolvedTx = _t;
626
- usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrow(chain);
679
+ _context1.n = 5;
680
+ return this.resolveFeeAsset(options);
681
+ case 5:
682
+ resolvedFeeAsset = _context1.v;
627
683
  performDryRunCall = /*#__PURE__*/function () {
628
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(includeVersion) {
684
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(includeVersion) {
629
685
  var _this$api$call$dryRun;
630
- return _regenerator().w(function (_context9) {
631
- while (1) switch (_context9.n) {
686
+ return _regenerator().w(function (_context0) {
687
+ while (1) switch (_context0.n) {
632
688
  case 0:
633
- return _context9.a(2, (_this$api$call$dryRun = _this.api.call.dryRunApi).dryRunCall.apply(_this$api$call$dryRun, [basePayload, resolvedTx].concat(_toConsumableArray(includeVersion ? [DEFAULT_XCM_VERSION] : []))));
689
+ return _context0.a(2, (_this$api$call$dryRun = _this.api.call.dryRunApi).dryRunCall.apply(_this$api$call$dryRun, [basePayload, resolvedTx].concat(_toConsumableArray(includeVersion ? [DEFAULT_XCM_VERSION] : []))));
634
690
  }
635
- }, _callee9);
691
+ }, _callee0);
636
692
  }));
637
- return function performDryRunCall(_x16) {
638
- return _ref2.apply(this, arguments);
693
+ return function performDryRunCall(_x17) {
694
+ return _ref3.apply(this, arguments);
639
695
  };
640
696
  }();
641
697
  getExecutionSuccessFromResult = function getExecutionSuccessFromResult(resultHuman) {
@@ -643,7 +699,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
643
699
  return Boolean((resultHuman === null || resultHuman === void 0 ? void 0 : resultHuman.Ok) && ((_resultHuman$Ok$execu = resultHuman.Ok.executionResult) === null || _resultHuman$Ok$execu === void 0 ? void 0 : _resultHuman$Ok$execu.Ok));
644
700
  };
645
701
  extractFailureReasonFromResult = function extractFailureReasonFromResult(resultHuman, resultJson) {
646
- var _resultHuman$Ok, _resultHuman$Ok2, _resultJson$ok, _ref3;
702
+ var _resultHuman$Ok, _resultHuman$Ok2, _resultJson$ok, _ref4;
647
703
  var modErrHuman = resultHuman === null || resultHuman === void 0 || (_resultHuman$Ok = resultHuman.Ok) === null || _resultHuman$Ok === void 0 || (_resultHuman$Ok = _resultHuman$Ok.executionResult) === null || _resultHuman$Ok === void 0 || (_resultHuman$Ok = _resultHuman$Ok.Err) === null || _resultHuman$Ok === void 0 || (_resultHuman$Ok = _resultHuman$Ok.error) === null || _resultHuman$Ok === void 0 ? void 0 : _resultHuman$Ok.Module;
648
704
  if (modErrHuman) {
649
705
  return resolveModuleError(chain, modErrHuman);
@@ -664,7 +720,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
664
720
  };
665
721
  }
666
722
  return {
667
- failureReason: JSON.stringify((_ref3 = resultJson !== null && resultJson !== void 0 ? resultJson : resultHuman) !== null && _ref3 !== void 0 ? _ref3 : 'Unknown error')
723
+ failureReason: JSON.stringify((_ref4 = resultJson !== null && resultJson !== void 0 ? resultJson : resultHuman) !== null && _ref4 !== void 0 ? _ref4 : 'Unknown error')
668
724
  };
669
725
  }; // Attempt 1: WITHOUT version
670
726
  isSuccess = false;
@@ -672,11 +728,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
672
728
  failureReason: ''
673
729
  };
674
730
  shouldRetryWithVersion = false;
675
- _context0.p = 5;
676
- _context0.n = 6;
731
+ _context1.p = 6;
732
+ _context1.n = 7;
677
733
  return performDryRunCall(false);
678
- case 6:
679
- response = _context0.v;
734
+ case 7:
735
+ response = _context1.v;
680
736
  resultHuman = response.toHuman();
681
737
  resultJson = response.toJSON();
682
738
  isSuccess = getExecutionSuccessFromResult(resultHuman);
@@ -686,66 +742,66 @@ var PolkadotJsApi = /*#__PURE__*/function () {
686
742
  shouldRetryWithVersion = true;
687
743
  }
688
744
  }
689
- _context0.n = 9;
745
+ _context1.n = 10;
690
746
  break;
691
- case 7:
692
- _context0.p = 7;
693
- _t2 = _context0.v;
747
+ case 8:
748
+ _context1.p = 8;
749
+ _t2 = _context1.v;
694
750
  msg = _t2 instanceof Error ? _t2.message : String(_t2);
695
751
  if (!msg.includes('Expected 3 arguments')) {
696
- _context0.n = 8;
752
+ _context1.n = 9;
697
753
  break;
698
754
  }
699
755
  shouldRetryWithVersion = true;
700
- _context0.n = 9;
756
+ _context1.n = 10;
701
757
  break;
702
- case 8:
703
- return _context0.a(2, {
758
+ case 9:
759
+ return _context1.a(2, {
704
760
  success: false,
705
761
  failureReason: msg,
706
- asset: usedAsset
762
+ asset: resolvedFeeAsset.asset
707
763
  });
708
- case 9:
764
+ case 10:
709
765
  if (!shouldRetryWithVersion) {
710
- _context0.n = 13;
766
+ _context1.n = 14;
711
767
  break;
712
768
  }
713
- _context0.p = 10;
714
- _context0.n = 11;
769
+ _context1.p = 11;
770
+ _context1.n = 12;
715
771
  return performDryRunCall(true);
716
- case 11:
717
- response = _context0.v;
772
+ case 12:
773
+ response = _context1.v;
718
774
  resultHuman = response.toHuman();
719
775
  resultJson = response.toJSON();
720
776
  isSuccess = getExecutionSuccessFromResult(resultHuman);
721
777
  if (!isSuccess) {
722
778
  failureErr = extractFailureReasonFromResult(resultHuman, resultJson);
723
779
  }
724
- _context0.n = 13;
780
+ _context1.n = 14;
725
781
  break;
726
- case 12:
727
- _context0.p = 12;
728
- _t3 = _context0.v;
782
+ case 13:
783
+ _context1.p = 13;
784
+ _t3 = _context1.v;
729
785
  _msg = _t3 instanceof Error ? _t3.message : String(_t3);
730
786
  failureErr = failureErr || _msg;
731
- return _context0.a(2, {
787
+ return _context1.a(2, {
732
788
  success: false,
733
789
  failureReason: failureErr.failureReason,
734
790
  failureSubReason: failureErr.failureSubReason,
735
- asset: usedAsset
791
+ asset: resolvedFeeAsset.asset
736
792
  });
737
- case 13:
793
+ case 14:
738
794
  if (isSuccess) {
739
- _context0.n = 14;
795
+ _context1.n = 15;
740
796
  break;
741
797
  }
742
- return _context0.a(2, {
798
+ return _context1.a(2, {
743
799
  success: false,
744
800
  failureReason: failureErr.failureReason || 'Unknown error',
745
801
  failureSubReason: failureErr.failureSubReason,
746
- asset: usedAsset
802
+ asset: resolvedFeeAsset.asset
747
803
  });
748
- case 14:
804
+ case 15:
749
805
  forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
750
806
  actualWeight = resultJson.ok.executionResult.ok.actualWeight;
751
807
  weight = actualWeight ? {
@@ -754,47 +810,52 @@ var PolkadotJsApi = /*#__PURE__*/function () {
754
810
  } : undefined;
755
811
  nativeAsset = findNativeAssetInfoOrThrow(chain);
756
812
  hasLocation = feeAsset ? Boolean(feeAsset.location) : Boolean(nativeAsset === null || nativeAsset === void 0 ? void 0 : nativeAsset.location);
757
- destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref4) {
758
- return i.here === null ? 0 : (_ref4 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref4 === void 0 ? void 0 : _ref4.parachain;
813
+ destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref5) {
814
+ return i.here === null ? 0 : (_ref5 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref5 === void 0 ? void 0 : _ref5.parachain;
759
815
  }(Object.values(forwardedXcms[0])[0].interior);
760
- if (!(hasXcmPaymentApiSupport(chain) && resultJson.ok.local_xcm && hasLocation && (feeAsset || chain.startsWith('AssetHub') && destination === 'Ethereum'))) {
761
- _context0.n = 16;
816
+ if (!(hasXcmPaymentApiSupport(chain) && resultJson.ok.local_xcm && hasLocation && (feeAsset || chain.startsWith('AssetHub') && destination === 'Ethereum') || resolvedFeeAsset.isCustomAsset)) {
817
+ _context1.n = 18;
762
818
  break;
763
819
  }
764
- _context0.n = 15;
820
+ _context1.n = 16;
765
821
  return this.getXcmPaymentApiFee(chain, resultJson.ok.local_xcm, forwardedXcms, feeAsset !== null && feeAsset !== void 0 ? feeAsset : nativeAsset);
766
- case 15:
767
- xcmFee = _context0.v;
822
+ case 16:
823
+ xcmFee = _context1.v;
768
824
  if (!(typeof xcmFee === 'bigint')) {
769
- _context0.n = 16;
825
+ _context1.n = 17;
770
826
  break;
771
827
  }
772
- return _context0.a(2, Promise.resolve({
828
+ return _context1.a(2, Promise.resolve({
773
829
  success: true,
774
830
  fee: xcmFee,
775
- asset: usedAsset,
831
+ asset: resolvedFeeAsset.asset,
776
832
  weight: weight,
777
833
  forwardedXcms: forwardedXcms,
778
834
  destParaId: destParaId
779
835
  }));
780
- case 16:
781
- _context0.n = 17;
782
- return this.calculateTransactionFee(tx, address);
783
836
  case 17:
784
- executionFee = _context0.v;
837
+ resolvedFeeAsset = {
838
+ isCustomAsset: false,
839
+ asset: this.resolveDefaultFeeAsset(options)
840
+ };
841
+ case 18:
842
+ _context1.n = 19;
843
+ return this.calculateTransactionFee(tx, address);
844
+ case 19:
845
+ executionFee = _context1.v;
785
846
  fee = computeFeeFromDryRunPjs(resultHuman, chain, executionFee);
786
- return _context0.a(2, {
847
+ return _context1.a(2, {
787
848
  success: true,
788
849
  fee: fee,
789
- asset: usedAsset,
850
+ asset: resolvedFeeAsset.asset,
790
851
  weight: weight,
791
852
  forwardedXcms: forwardedXcms,
792
853
  destParaId: destParaId
793
854
  });
794
855
  }
795
- }, _callee0, this, [[10, 12], [5, 7]]);
856
+ }, _callee1, this, [[11, 13], [6, 8]]);
796
857
  }));
797
- function getDryRunCall(_x15) {
858
+ function getDryRunCall(_x16) {
798
859
  return _getDryRunCall.apply(this, arguments);
799
860
  }
800
861
  return getDryRunCall;
@@ -802,68 +863,68 @@ var PolkadotJsApi = /*#__PURE__*/function () {
802
863
  }, {
803
864
  key: "getXcmPaymentApiFee",
804
865
  value: function () {
805
- var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(chain, localXcm, forwardedXcm, asset) {
806
- var _ref5, _deliveryFeeResJson$o, _deliveryFeeResJson$o2, _deliveryFeeResJson$o3, _ref6, _deliveryFeeResJson$o4, _deliveryFeeResJson$o5, _deliveryFeeResJson$o6;
866
+ var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(chain, localXcm, forwardedXcm, asset) {
867
+ var _ref6, _deliveryFeeResJson$o, _deliveryFeeResJson$o2, _deliveryFeeResJson$o3, _ref7, _deliveryFeeResJson$o4, _deliveryFeeResJson$o5, _deliveryFeeResJson$o6;
807
868
  var weight, assetLocalizedLoc, feeResult, execFeeRes, execFee, deliveryFeeRes, deliveryFeeResJson, deliveryFeeResolved, nativeAsset, deliveryFee, res, _t4;
808
- return _regenerator().w(function (_context1) {
809
- while (1) switch (_context1.p = _context1.n) {
869
+ return _regenerator().w(function (_context10) {
870
+ while (1) switch (_context10.p = _context10.n) {
810
871
  case 0:
811
- _context1.n = 1;
872
+ _context10.n = 1;
812
873
  return this.getXcmWeight(localXcm);
813
874
  case 1:
814
- weight = _context1.v;
875
+ weight = _context10.v;
815
876
  assertHasLocation(asset);
816
877
  assetLocalizedLoc = localizeLocation(chain, asset.location);
817
- _context1.n = 2;
878
+ _context10.n = 2;
818
879
  return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weight, addXcmVersionHeader(assetLocalizedLoc, Version.V4));
819
880
  case 2:
820
- feeResult = _context1.v;
881
+ feeResult = _context10.v;
821
882
  execFeeRes = feeResult.toJSON();
822
883
  execFee = BigInt(execFeeRes.ok);
823
884
  if (!(forwardedXcm.length > 0)) {
824
- _context1.n = 4;
885
+ _context10.n = 4;
825
886
  break;
826
887
  }
827
- _context1.n = 3;
888
+ _context10.n = 3;
828
889
  return this.api.call.xcmPaymentApi.queryDeliveryFees(forwardedXcm[0], forwardedXcm[1][0]);
829
890
  case 3:
830
- _t4 = _context1.v;
831
- _context1.n = 5;
891
+ _t4 = _context10.v;
892
+ _context10.n = 5;
832
893
  break;
833
894
  case 4:
834
895
  _t4 = undefined;
835
896
  case 5:
836
897
  deliveryFeeRes = _t4;
837
898
  deliveryFeeResJson = deliveryFeeRes === null || deliveryFeeRes === void 0 ? void 0 : deliveryFeeRes.toJSON();
838
- deliveryFeeResolved = deliveryFeeRes && ((_ref5 = (_deliveryFeeResJson$o = (_deliveryFeeResJson$o2 = deliveryFeeResJson.ok) === null || _deliveryFeeResJson$o2 === void 0 ? void 0 : _deliveryFeeResJson$o2.v4) !== null && _deliveryFeeResJson$o !== void 0 ? _deliveryFeeResJson$o : (_deliveryFeeResJson$o3 = deliveryFeeResJson.ok) === null || _deliveryFeeResJson$o3 === void 0 ? void 0 : _deliveryFeeResJson$o3.v3) === null || _ref5 === void 0 ? void 0 : _ref5.length) > 0 ? BigInt((_ref6 = (_deliveryFeeResJson$o4 = deliveryFeeResJson === null || deliveryFeeResJson === void 0 || (_deliveryFeeResJson$o5 = deliveryFeeResJson.ok) === null || _deliveryFeeResJson$o5 === void 0 ? void 0 : _deliveryFeeResJson$o5.v4) !== null && _deliveryFeeResJson$o4 !== void 0 ? _deliveryFeeResJson$o4 : deliveryFeeResJson === null || deliveryFeeResJson === void 0 || (_deliveryFeeResJson$o6 = deliveryFeeResJson.ok) === null || _deliveryFeeResJson$o6 === void 0 ? void 0 : _deliveryFeeResJson$o6.v3) === null || _ref6 === void 0 || (_ref6 = _ref6[0]) === null || _ref6 === void 0 || (_ref6 = _ref6.fun) === null || _ref6 === void 0 ? void 0 : _ref6.fungible) : 0n;
899
+ deliveryFeeResolved = deliveryFeeRes && ((_ref6 = (_deliveryFeeResJson$o = (_deliveryFeeResJson$o2 = deliveryFeeResJson.ok) === null || _deliveryFeeResJson$o2 === void 0 ? void 0 : _deliveryFeeResJson$o2.v4) !== null && _deliveryFeeResJson$o !== void 0 ? _deliveryFeeResJson$o : (_deliveryFeeResJson$o3 = deliveryFeeResJson.ok) === null || _deliveryFeeResJson$o3 === void 0 ? void 0 : _deliveryFeeResJson$o3.v3) === null || _ref6 === void 0 ? void 0 : _ref6.length) > 0 ? BigInt((_ref7 = (_deliveryFeeResJson$o4 = deliveryFeeResJson === null || deliveryFeeResJson === void 0 || (_deliveryFeeResJson$o5 = deliveryFeeResJson.ok) === null || _deliveryFeeResJson$o5 === void 0 ? void 0 : _deliveryFeeResJson$o5.v4) !== null && _deliveryFeeResJson$o4 !== void 0 ? _deliveryFeeResJson$o4 : deliveryFeeResJson === null || deliveryFeeResJson === void 0 || (_deliveryFeeResJson$o6 = deliveryFeeResJson.ok) === null || _deliveryFeeResJson$o6 === void 0 ? void 0 : _deliveryFeeResJson$o6.v3) === null || _ref7 === void 0 || (_ref7 = _ref7[0]) === null || _ref7 === void 0 || (_ref7 = _ref7.fun) === null || _ref7 === void 0 ? void 0 : _ref7.fungible) : 0n;
839
900
  nativeAsset = findNativeAssetInfoOrThrow(chain);
840
901
  if (!isAssetXcEqual(asset, nativeAsset)) {
841
- _context1.n = 6;
902
+ _context10.n = 6;
842
903
  break;
843
904
  }
844
905
  deliveryFee = deliveryFeeResolved;
845
- _context1.n = 9;
906
+ _context10.n = 9;
846
907
  break;
847
908
  case 6:
848
- _context1.p = 6;
909
+ _context10.p = 6;
849
910
  assertHasLocation(nativeAsset);
850
- _context1.n = 7;
911
+ _context10.n = 7;
851
912
  return this.quoteAhPrice(localizeLocation(chain, nativeAsset.location), assetLocalizedLoc, deliveryFeeResolved, false);
852
913
  case 7:
853
- res = _context1.v;
914
+ res = _context10.v;
854
915
  deliveryFee = res !== null && res !== void 0 ? res : 0n;
855
- _context1.n = 9;
916
+ _context10.n = 9;
856
917
  break;
857
918
  case 8:
858
- _context1.p = 8;
859
- _context1.v;
919
+ _context10.p = 8;
920
+ _context10.v;
860
921
  deliveryFee = 0n;
861
922
  case 9:
862
- return _context1.a(2, execFee + deliveryFee);
923
+ return _context10.a(2, execFee + deliveryFee);
863
924
  }
864
- }, _callee1, this, [[6, 8]]);
925
+ }, _callee10, this, [[6, 8]]);
865
926
  }));
866
- function getXcmPaymentApiFee(_x17, _x18, _x19, _x20) {
927
+ function getXcmPaymentApiFee(_x18, _x19, _x20, _x21) {
867
928
  return _getXcmPaymentApiFee.apply(this, arguments);
868
929
  }
869
930
  return getXcmPaymentApiFee;
@@ -871,21 +932,21 @@ var PolkadotJsApi = /*#__PURE__*/function () {
871
932
  }, {
872
933
  key: "getXcmWeight",
873
934
  value: function () {
874
- var _getXcmWeight = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(xcm) {
935
+ var _getXcmWeight = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(xcm) {
875
936
  var result, resultJson;
876
- return _regenerator().w(function (_context10) {
877
- while (1) switch (_context10.n) {
937
+ return _regenerator().w(function (_context11) {
938
+ while (1) switch (_context11.n) {
878
939
  case 0:
879
- _context10.n = 1;
940
+ _context11.n = 1;
880
941
  return this.api.call.xcmPaymentApi.queryXcmWeight(xcm);
881
942
  case 1:
882
- result = _context10.v;
943
+ result = _context11.v;
883
944
  resultJson = result.toJSON();
884
- return _context10.a(2, resultJson.ok);
945
+ return _context11.a(2, resultJson.ok);
885
946
  }
886
- }, _callee10, this);
947
+ }, _callee11, this);
887
948
  }));
888
- function getXcmWeight(_x21) {
949
+ function getXcmWeight(_x22) {
889
950
  return _getXcmWeight.apply(this, arguments);
890
951
  }
891
952
  return getXcmWeight;
@@ -893,34 +954,34 @@ var PolkadotJsApi = /*#__PURE__*/function () {
893
954
  }, {
894
955
  key: "getDryRunXcm",
895
956
  value: function () {
896
- var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(_ref7) {
897
- var _ref9, _ref0, _ref1;
957
+ var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(_ref8) {
958
+ var _ref0, _ref1, _ref10;
898
959
  var originLocation, xcm, asset, chain, origin, supportsDryRunApi, response, result, resultJson, isSuccess, error, failureReason, forwardedXcms, actualWeight, weight, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee;
899
- return _regenerator().w(function (_context11) {
900
- while (1) switch (_context11.n) {
960
+ return _regenerator().w(function (_context12) {
961
+ while (1) switch (_context12.n) {
901
962
  case 0:
902
- originLocation = _ref7.originLocation, xcm = _ref7.xcm, asset = _ref7.asset, chain = _ref7.chain, origin = _ref7.origin;
963
+ originLocation = _ref8.originLocation, xcm = _ref8.xcm, asset = _ref8.asset, chain = _ref8.chain, origin = _ref8.origin;
903
964
  supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
904
965
  if (supportsDryRunApi) {
905
- _context11.n = 1;
966
+ _context12.n = 1;
906
967
  break;
907
968
  }
908
969
  throw new RuntimeApiUnavailableError(chain, 'DryRunApi');
909
970
  case 1:
910
- _context11.n = 2;
971
+ _context12.n = 2;
911
972
  return this.api.call.dryRunApi.dryRunXcm(originLocation, xcm);
912
973
  case 2:
913
- response = _context11.v;
974
+ response = _context12.v;
914
975
  result = response.toHuman();
915
976
  resultJson = response.toJSON();
916
977
  isSuccess = result.Ok && result.Ok.executionResult.Complete;
917
978
  if (isSuccess) {
918
- _context11.n = 3;
979
+ _context12.n = 3;
919
980
  break;
920
981
  }
921
982
  error = result.Ok.executionResult.Incomplete.error;
922
983
  failureReason = typeof error === 'string' ? error : error.error;
923
- return _context11.a(2, {
984
+ return _context12.a(2, {
924
985
  success: false,
925
986
  failureReason: failureReason,
926
987
  asset: asset
@@ -932,22 +993,22 @@ var PolkadotJsApi = /*#__PURE__*/function () {
932
993
  refTime: BigInt(actualWeight.refTime),
933
994
  proofSize: BigInt(actualWeight.proofSize)
934
995
  } : undefined;
935
- destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref8) {
936
- return i.Here ? 0 : (_ref8 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref8 === void 0 ? void 0 : _ref8.parachain;
996
+ destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref9) {
997
+ return i.Here ? 0 : (_ref9 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref9 === void 0 ? void 0 : _ref9.parachain;
937
998
  }(Object.values(forwardedXcms[0])[0].interior);
938
999
  if (!(hasXcmPaymentApiSupport(chain) && asset)) {
939
- _context11.n = 5;
1000
+ _context12.n = 5;
940
1001
  break;
941
1002
  }
942
- _context11.n = 4;
1003
+ _context12.n = 4;
943
1004
  return this.getXcmPaymentApiFee(chain, xcm, forwardedXcms, asset);
944
1005
  case 4:
945
- _fee = _context11.v;
1006
+ _fee = _context12.v;
946
1007
  if (!(typeof _fee === 'bigint')) {
947
- _context11.n = 5;
1008
+ _context12.n = 5;
948
1009
  break;
949
1010
  }
950
- return _context11.a(2, {
1011
+ return _context12.a(2, {
951
1012
  success: true,
952
1013
  fee: _fee,
953
1014
  asset: asset,
@@ -959,24 +1020,24 @@ var PolkadotJsApi = /*#__PURE__*/function () {
959
1020
  emitted = result.Ok.emittedEvents; // We want to look for the last event
960
1021
  reversedEvents = _toConsumableArray(emitted).reverse();
961
1022
  palletsWithIssued = ['balances', 'foreignAssets', 'assets'];
962
- feeEvent = (_ref9 = (_ref0 = (_ref1 = origin === 'Mythos' ? reversedEvents.find(function (event) {
1023
+ feeEvent = (_ref0 = (_ref1 = (_ref10 = origin === 'Mythos' ? reversedEvents.find(function (event) {
963
1024
  return event.section === 'assetConversion' && event.method === 'SwapCreditExecuted';
964
- }) : undefined) !== null && _ref1 !== void 0 ? _ref1 :
1025
+ }) : undefined) !== null && _ref10 !== void 0 ? _ref10 :
965
1026
  // Prefer an Issued event
966
1027
  reversedEvents.find(function (event) {
967
1028
  return palletsWithIssued.includes(event.section) && event.method === 'Issued';
968
- })) !== null && _ref0 !== void 0 ? _ref0 :
1029
+ })) !== null && _ref1 !== void 0 ? _ref1 :
969
1030
  // Fallback to Minted event
970
1031
  reversedEvents.find(function (event) {
971
1032
  return ['balances', 'foreignAssets'].includes(event.section) && event.method === 'Minted';
972
- })) !== null && _ref9 !== void 0 ? _ref9 : reversedEvents.find(function (event) {
1033
+ })) !== null && _ref0 !== void 0 ? _ref0 : reversedEvents.find(function (event) {
973
1034
  return ['currencies', 'tokens'].includes(event.section) && event.method === 'Deposited';
974
1035
  });
975
1036
  if (feeEvent) {
976
- _context11.n = 6;
1037
+ _context12.n = 6;
977
1038
  break;
978
1039
  }
979
- return _context11.a(2, Promise.resolve({
1040
+ return _context12.a(2, Promise.resolve({
980
1041
  success: false,
981
1042
  failureReason: 'Cannot determine destination fee. No Issued event found',
982
1043
  asset: asset
@@ -984,7 +1045,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
984
1045
  case 6:
985
1046
  feeAmount = feeEvent.section === 'assetConversion' ? feeEvent.data.amountIn : feeEvent.data.amount;
986
1047
  fee = BigInt(feeAmount.replace(/,/g, ''));
987
- return _context11.a(2, {
1048
+ return _context12.a(2, {
988
1049
  success: true,
989
1050
  fee: fee,
990
1051
  asset: asset,
@@ -993,9 +1054,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
993
1054
  destParaId: destParaId
994
1055
  });
995
1056
  }
996
- }, _callee11, this);
1057
+ }, _callee12, this);
997
1058
  }));
998
- function getDryRunXcm(_x22) {
1059
+ function getDryRunXcm(_x23) {
999
1060
  return _getDryRunXcm.apply(this, arguments);
1000
1061
  }
1001
1062
  return getDryRunXcm;
@@ -1003,18 +1064,18 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1003
1064
  }, {
1004
1065
  key: "getBridgeStatus",
1005
1066
  value: function () {
1006
- var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
1067
+ var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
1007
1068
  var outboundOperatingMode;
1008
- return _regenerator().w(function (_context12) {
1009
- while (1) switch (_context12.n) {
1069
+ return _regenerator().w(function (_context13) {
1070
+ while (1) switch (_context13.n) {
1010
1071
  case 0:
1011
- _context12.n = 1;
1072
+ _context13.n = 1;
1012
1073
  return this.api.query.ethereumOutboundQueue.operatingMode();
1013
1074
  case 1:
1014
- outboundOperatingMode = _context12.v;
1015
- return _context12.a(2, outboundOperatingMode.toPrimitive());
1075
+ outboundOperatingMode = _context13.v;
1076
+ return _context13.a(2, outboundOperatingMode.toPrimitive());
1016
1077
  }
1017
- }, _callee12, this);
1078
+ }, _callee13, this);
1018
1079
  }));
1019
1080
  function getBridgeStatus() {
1020
1081
  return _getBridgeStatus.apply(this, arguments);
@@ -1034,38 +1095,38 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1034
1095
  }, {
1035
1096
  key: "disconnect",
1036
1097
  value: function () {
1037
- var _disconnect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
1098
+ var _disconnect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
1038
1099
  var _this$_config$apiOver2;
1039
1100
  var force,
1040
1101
  api,
1041
- _args13 = arguments;
1042
- return _regenerator().w(function (_context13) {
1043
- while (1) switch (_context13.n) {
1102
+ _args14 = arguments;
1103
+ return _regenerator().w(function (_context14) {
1104
+ while (1) switch (_context14.n) {
1044
1105
  case 0:
1045
- force = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : false;
1106
+ force = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : false;
1046
1107
  if (this.initialized) {
1047
- _context13.n = 1;
1108
+ _context14.n = 1;
1048
1109
  break;
1049
1110
  }
1050
- return _context13.a(2, Promise.resolve());
1111
+ return _context14.a(2, Promise.resolve());
1051
1112
  case 1:
1052
1113
  if (!(!force && !this.disconnectAllowed)) {
1053
- _context13.n = 2;
1114
+ _context14.n = 2;
1054
1115
  break;
1055
1116
  }
1056
- return _context13.a(2);
1117
+ return _context14.a(2);
1057
1118
  case 2:
1058
1119
  api = isConfig(this._config) ? (_this$_config$apiOver2 = this._config.apiOverrides) === null || _this$_config$apiOver2 === void 0 ? void 0 : _this$_config$apiOver2[this._chain] : this._config; // Disconnect api only if it was created automatically
1059
1120
  if (!(force || typeof api === 'string' || api === undefined)) {
1060
- _context13.n = 3;
1121
+ _context14.n = 3;
1061
1122
  break;
1062
1123
  }
1063
- _context13.n = 3;
1124
+ _context14.n = 3;
1064
1125
  return this.api.disconnect();
1065
1126
  case 3:
1066
- return _context13.a(2);
1127
+ return _context14.a(2);
1067
1128
  }
1068
- }, _callee13, this);
1129
+ }, _callee14, this);
1069
1130
  }));
1070
1131
  function disconnect() {
1071
1132
  return _disconnect.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-pjs",
3
- "version": "12.0.4",
3
+ "version": "12.0.6",
4
4
  "description": "Polkadot.js based SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "@snowbridge/contract-types": "0.2.17",
28
28
  "ethers": "^6.15.0",
29
29
  "viem": "^2.40.3",
30
- "@paraspell/sdk-core": "12.0.4"
30
+ "@paraspell/sdk-core": "12.0.6"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@polkadot/api": ">= 16.0 < 17",