@paraspell/sdk-pjs 11.9.1 → 11.9.3

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/dist/index.cjs +209 -96
  2. package/dist/index.mjs +210 -97
  3. package/package.json +2 -2
package/dist/index.cjs CHANGED
@@ -353,7 +353,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
353
353
  _context2.n = 2;
354
354
  break;
355
355
  }
356
- return _context2.a(2, this.createApiInstance(apiConfig));
356
+ return _context2.a(2, this.createApiInstance(apiConfig, chain));
357
357
  case 2:
358
358
  return _context2.a(2, apiConfig);
359
359
  }
@@ -367,7 +367,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
367
367
  }, {
368
368
  key: "createApiInstance",
369
369
  value: function () {
370
- var _createApiInstance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(wsUrl) {
370
+ var _createApiInstance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(wsUrl, _chain) {
371
371
  var wsProvider;
372
372
  return _regenerator().w(function (_context3) {
373
373
  while (1) switch (_context3.n) {
@@ -379,7 +379,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
379
379
  }
380
380
  }, _callee3);
381
381
  }));
382
- function createApiInstance(_x5) {
382
+ function createApiInstance(_x5, _x6) {
383
383
  return _createApiInstance.apply(this, arguments);
384
384
  }
385
385
  return createApiInstance;
@@ -418,7 +418,12 @@ var PolkadotJsApi = /*#__PURE__*/function () {
418
418
  }, {
419
419
  key: "callDispatchAsMethod",
420
420
  value: function callDispatchAsMethod(call, address) {
421
- return this.api.tx.utility.dispatchAs(address, call);
421
+ var origin = {
422
+ system: {
423
+ Signed: address
424
+ }
425
+ };
426
+ return this.api.tx.utility.dispatchAs(origin, call);
422
427
  }
423
428
  }, {
424
429
  key: "objectToHex",
@@ -452,7 +457,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
452
457
  }
453
458
  }, _callee4);
454
459
  }));
455
- function calculateTransactionFee(_x6, _x7) {
460
+ function calculateTransactionFee(_x7, _x8) {
456
461
  return _calculateTransactionFee.apply(this, arguments);
457
462
  }
458
463
  return calculateTransactionFee;
@@ -476,7 +481,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
476
481
  }
477
482
  }, _callee5, this);
478
483
  }));
479
- function quoteAhPrice(_x8, _x9, _x0) {
484
+ function quoteAhPrice(_x9, _x0, _x1) {
480
485
  return _quoteAhPrice.apply(this, arguments);
481
486
  }
482
487
  return quoteAhPrice;
@@ -502,7 +507,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
502
507
  }
503
508
  }, _callee6, this);
504
509
  }));
505
- function getBalanceNative(_x1) {
510
+ function getBalanceNative(_x10) {
506
511
  return _getBalanceNative.apply(this, arguments);
507
512
  }
508
513
  return getBalanceNative;
@@ -526,7 +531,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
526
531
  }
527
532
  }, _callee7, this);
528
533
  }));
529
- function getBalanceForeignPolkadotXcm(_x10, _x11, _x12) {
534
+ function getBalanceForeignPolkadotXcm(_x11, _x12, _x13) {
530
535
  return _getBalanceForeignPolkadotXcm.apply(this, arguments);
531
536
  }
532
537
  return getBalanceForeignPolkadotXcm;
@@ -548,7 +553,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
548
553
  }
549
554
  }, _callee8, this);
550
555
  }));
551
- function getMythosForeignBalance(_x13) {
556
+ function getMythosForeignBalance(_x14) {
552
557
  return _getMythosForeignBalance.apply(this, arguments);
553
558
  }
554
559
  return getMythosForeignBalance;
@@ -570,7 +575,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
570
575
  }
571
576
  }, _callee9, this);
572
577
  }));
573
- function getBalanceForeignAssetsPallet(_x14, _x15) {
578
+ function getBalanceForeignAssetsPallet(_x15, _x16) {
574
579
  return _getBalanceForeignAssetsPallet.apply(this, arguments);
575
580
  }
576
581
  return getBalanceForeignAssetsPallet;
@@ -592,7 +597,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
592
597
  }
593
598
  }, _callee0, this);
594
599
  }));
595
- function getForeignAssetsByIdBalance(_x16, _x17) {
600
+ function getForeignAssetsByIdBalance(_x17, _x18) {
596
601
  return _getForeignAssetsByIdBalance.apply(this, arguments);
597
602
  }
598
603
  return getForeignAssetsByIdBalance;
@@ -615,7 +620,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
615
620
  }
616
621
  }, _callee1, this);
617
622
  }));
618
- function getBalanceForeignBifrost(_x18, _x19) {
623
+ function getBalanceForeignBifrost(_x19, _x20) {
619
624
  return _getBalanceForeignBifrost.apply(this, arguments);
620
625
  }
621
626
  return getBalanceForeignBifrost;
@@ -639,7 +644,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
639
644
  }
640
645
  }, _callee10, this);
641
646
  }));
642
- function getBalanceNativeAcala(_x20, _x21) {
647
+ function getBalanceNativeAcala(_x21, _x22) {
643
648
  return _getBalanceNativeAcala.apply(this, arguments);
644
649
  }
645
650
  return getBalanceNativeAcala;
@@ -675,7 +680,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
675
680
  }
676
681
  }, _callee11, this);
677
682
  }));
678
- function getBalanceForeignXTokens(_x22, _x23, _x24) {
683
+ function getBalanceForeignXTokens(_x23, _x24, _x25) {
679
684
  return _getBalanceForeignXTokens.apply(this, arguments);
680
685
  }
681
686
  return getBalanceForeignXTokens;
@@ -697,7 +702,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
697
702
  }
698
703
  }, _callee12, this);
699
704
  }));
700
- function getBalanceAssetsPallet(_x25, _x26) {
705
+ function getBalanceAssetsPallet(_x26, _x27) {
701
706
  return _getBalanceAssetsPallet.apply(this, arguments);
702
707
  }
703
708
  return getBalanceAssetsPallet;
@@ -738,7 +743,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
738
743
  }
739
744
  }, _callee13, this);
740
745
  }));
741
- function getFromRpc(_x27, _x28, _x29) {
746
+ function getFromRpc(_x28, _x29, _x30) {
742
747
  return _getFromRpc.apply(this, arguments);
743
748
  }
744
749
  return getFromRpc;
@@ -769,7 +774,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
769
774
  }
770
775
  }, _callee14);
771
776
  }));
772
- function createApiForChain(_x30) {
777
+ function createApiForChain(_x31) {
773
778
  return _createApiForChain.apply(this, arguments);
774
779
  }
775
780
  return createApiForChain;
@@ -777,13 +782,13 @@ var PolkadotJsApi = /*#__PURE__*/function () {
777
782
  }, {
778
783
  key: "getDryRunCall",
779
784
  value: function () {
780
- var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(_ref4) {
785
+ var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(options) {
781
786
  var _this = this;
782
- var tx, address, feeAsset, chain, supportsDryRunApi, DEFAULT_XCM_VERSION, usedAsset, usedSymbol, performDryRunCall, getExecutionSuccessFromResult, extractFailureReasonFromResult, response, resultHuman, resultJson, isSuccess, failureReason, shouldRetryWithVersion, msg, _msg, executionFee, fee, actualWeight, weight, forwardedXcms, destParaId, _t, _t2;
787
+ var tx, address, feeAsset, chain, destination, _options$useRootOrigi, useRootOrigin, bypassOptions, supportsDryRunApi, DEFAULT_XCM_VERSION, basePayload, resolvedTx, usedAsset, usedSymbol, performDryRunCall, getExecutionSuccessFromResult, extractFailureReasonFromResult, response, resultHuman, resultJson, isSuccess, failureReason, shouldRetryWithVersion, msg, _msg, forwardedXcms, actualWeight, weight, nativeAsset, hasLocation, destParaId, xcmFee, executionFee, fee, _t, _t2, _t3;
783
788
  return _regenerator().w(function (_context16) {
784
789
  while (1) switch (_context16.p = _context16.n) {
785
790
  case 0:
786
- tx = _ref4.tx, address = _ref4.address, feeAsset = _ref4.feeAsset, chain = _ref4.chain;
791
+ 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;
787
792
  supportsDryRunApi = sdkCore.getAssetsObject(chain).supportsDryRunApi;
788
793
  if (supportsDryRunApi) {
789
794
  _context16.n = 1;
@@ -792,24 +797,45 @@ var PolkadotJsApi = /*#__PURE__*/function () {
792
797
  throw new sdkCore.ChainNotSupportedError("DryRunApi is not available on chain ".concat(chain));
793
798
  case 1:
794
799
  DEFAULT_XCM_VERSION = 3;
800
+ basePayload = useRootOrigin ? {
801
+ system: {
802
+ Root: null
803
+ }
804
+ } : {
805
+ system: {
806
+ Signed: address
807
+ }
808
+ };
809
+ if (!useRootOrigin) {
810
+ _context16.n = 3;
811
+ break;
812
+ }
813
+ _context16.n = 2;
814
+ return sdkCore.wrapTxBypass(_objectSpread2(_objectSpread2({}, options), {}, {
815
+ api: this
816
+ }), bypassOptions);
817
+ case 2:
818
+ _t = _context16.v;
819
+ _context16.n = 4;
820
+ break;
821
+ case 3:
822
+ _t = tx;
823
+ case 4:
824
+ resolvedTx = _t;
795
825
  usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : sdkCore.findNativeAssetInfoOrThrow(chain);
796
826
  usedSymbol = usedAsset.symbol;
797
827
  performDryRunCall = /*#__PURE__*/function () {
798
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(includeVersion) {
828
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(includeVersion) {
799
829
  var _this$api$call$dryRun;
800
830
  return _regenerator().w(function (_context15) {
801
831
  while (1) switch (_context15.n) {
802
832
  case 0:
803
- return _context15.a(2, (_this$api$call$dryRun = _this.api.call.dryRunApi).dryRunCall.apply(_this$api$call$dryRun, [{
804
- system: {
805
- Signed: address
806
- }
807
- }, tx].concat(_toConsumableArray(includeVersion ? [DEFAULT_XCM_VERSION] : []))));
833
+ return _context15.a(2, (_this$api$call$dryRun = _this.api.call.dryRunApi).dryRunCall.apply(_this$api$call$dryRun, [basePayload, resolvedTx].concat(_toConsumableArray(includeVersion ? [DEFAULT_XCM_VERSION] : []))));
808
834
  }
809
835
  }, _callee15);
810
836
  }));
811
- return function performDryRunCall(_x32) {
812
- return _ref5.apply(this, arguments);
837
+ return function performDryRunCall(_x33) {
838
+ return _ref4.apply(this, arguments);
813
839
  };
814
840
  }();
815
841
  getExecutionSuccessFromResult = function getExecutionSuccessFromResult(resultHuman) {
@@ -817,7 +843,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
817
843
  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));
818
844
  };
819
845
  extractFailureReasonFromResult = function extractFailureReasonFromResult(resultHuman, resultJson) {
820
- var _resultHuman$Ok, _resultHuman$Ok2, _resultJson$ok, _ref6;
846
+ var _resultHuman$Ok, _resultHuman$Ok2, _resultJson$ok, _ref5;
821
847
  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;
822
848
  if (modErrHuman) {
823
849
  return sdkCore.resolveModuleError(chain, modErrHuman);
@@ -833,15 +859,15 @@ var PolkadotJsApi = /*#__PURE__*/function () {
833
859
  if (execErrJson !== null && execErrJson !== void 0 && execErrJson.other) {
834
860
  return String(execErrJson.other);
835
861
  }
836
- return JSON.stringify((_ref6 = resultJson !== null && resultJson !== void 0 ? resultJson : resultHuman) !== null && _ref6 !== void 0 ? _ref6 : 'Unknown error');
862
+ return JSON.stringify((_ref5 = resultJson !== null && resultJson !== void 0 ? resultJson : resultHuman) !== null && _ref5 !== void 0 ? _ref5 : 'Unknown error');
837
863
  }; // Attempt 1: WITHOUT version
838
864
  isSuccess = false;
839
865
  failureReason = '';
840
866
  shouldRetryWithVersion = false;
841
- _context16.p = 2;
842
- _context16.n = 3;
867
+ _context16.p = 5;
868
+ _context16.n = 6;
843
869
  return performDryRunCall(false);
844
- case 3:
870
+ case 6:
845
871
  response = _context16.v;
846
872
  resultHuman = response.toHuman();
847
873
  resultJson = response.toJSON();
@@ -852,35 +878,35 @@ var PolkadotJsApi = /*#__PURE__*/function () {
852
878
  shouldRetryWithVersion = true;
853
879
  }
854
880
  }
855
- _context16.n = 6;
881
+ _context16.n = 9;
856
882
  break;
857
- case 4:
858
- _context16.p = 4;
859
- _t = _context16.v;
860
- msg = _t instanceof Error ? _t.message : String(_t);
883
+ case 7:
884
+ _context16.p = 7;
885
+ _t2 = _context16.v;
886
+ msg = _t2 instanceof Error ? _t2.message : String(_t2);
861
887
  if (!msg.includes('Expected 3 arguments')) {
862
- _context16.n = 5;
888
+ _context16.n = 8;
863
889
  break;
864
890
  }
865
891
  shouldRetryWithVersion = true;
866
- _context16.n = 6;
892
+ _context16.n = 9;
867
893
  break;
868
- case 5:
894
+ case 8:
869
895
  return _context16.a(2, {
870
896
  success: false,
871
897
  failureReason: msg,
872
898
  currency: usedSymbol,
873
899
  asset: usedAsset
874
900
  });
875
- case 6:
901
+ case 9:
876
902
  if (!shouldRetryWithVersion) {
877
- _context16.n = 10;
903
+ _context16.n = 13;
878
904
  break;
879
905
  }
880
- _context16.p = 7;
881
- _context16.n = 8;
906
+ _context16.p = 10;
907
+ _context16.n = 11;
882
908
  return performDryRunCall(true);
883
- case 8:
909
+ case 11:
884
910
  response = _context16.v;
885
911
  resultHuman = response.toHuman();
886
912
  resultJson = response.toJSON();
@@ -888,12 +914,12 @@ var PolkadotJsApi = /*#__PURE__*/function () {
888
914
  if (!isSuccess) {
889
915
  failureReason = extractFailureReasonFromResult(resultHuman, resultJson);
890
916
  }
891
- _context16.n = 10;
917
+ _context16.n = 13;
892
918
  break;
893
- case 9:
894
- _context16.p = 9;
895
- _t2 = _context16.v;
896
- _msg = _t2 instanceof Error ? _t2.message : String(_t2);
919
+ case 12:
920
+ _context16.p = 12;
921
+ _t3 = _context16.v;
922
+ _msg = _t3 instanceof Error ? _t3.message : String(_t3);
897
923
  failureReason = failureReason || _msg;
898
924
  return _context16.a(2, {
899
925
  success: false,
@@ -901,9 +927,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
901
927
  currency: usedSymbol,
902
928
  asset: usedAsset
903
929
  });
904
- case 10:
930
+ case 13:
905
931
  if (isSuccess) {
906
- _context16.n = 11;
932
+ _context16.n = 14;
907
933
  break;
908
934
  }
909
935
  return _context16.a(2, {
@@ -912,21 +938,45 @@ var PolkadotJsApi = /*#__PURE__*/function () {
912
938
  currency: usedSymbol,
913
939
  asset: usedAsset
914
940
  });
915
- case 11:
916
- _context16.n = 12;
917
- return this.calculateTransactionFee(tx, address);
918
- case 12:
919
- executionFee = _context16.v;
920
- fee = sdkCore.computeFeeFromDryRunPjs(resultHuman, chain, executionFee);
941
+ case 14:
942
+ forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
921
943
  actualWeight = resultJson.ok.executionResult.ok.actualWeight;
922
944
  weight = actualWeight ? {
923
945
  refTime: BigInt(actualWeight.refTime),
924
946
  proofSize: BigInt(actualWeight.proofSize)
925
947
  } : undefined;
926
- forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
927
- destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref7) {
928
- return i.here === null ? 0 : (_ref7 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref7 === void 0 ? void 0 : _ref7.parachain;
948
+ nativeAsset = sdkCore.findNativeAssetInfoOrThrow(chain);
949
+ hasLocation = feeAsset ? Boolean(feeAsset.location) : Boolean(nativeAsset === null || nativeAsset === void 0 ? void 0 : nativeAsset.location);
950
+ destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref6) {
951
+ return i.here === null ? 0 : (_ref6 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref6 === void 0 ? void 0 : _ref6.parachain;
929
952
  }(Object.values(forwardedXcms[0])[0].interior);
953
+ if (!(sdkCore.hasXcmPaymentApiSupport(chain) && resultJson.ok.local_xcm && hasLocation && (feeAsset || chain.startsWith('AssetHub') && destination === 'Ethereum'))) {
954
+ _context16.n = 16;
955
+ break;
956
+ }
957
+ _context16.n = 15;
958
+ return this.getXcmPaymentApiFee(chain, resultJson.ok.local_xcm, forwardedXcms, feeAsset !== null && feeAsset !== void 0 ? feeAsset : nativeAsset);
959
+ case 15:
960
+ xcmFee = _context16.v;
961
+ if (!(typeof xcmFee === 'bigint')) {
962
+ _context16.n = 16;
963
+ break;
964
+ }
965
+ return _context16.a(2, Promise.resolve({
966
+ success: true,
967
+ fee: xcmFee,
968
+ currency: usedSymbol,
969
+ asset: usedAsset,
970
+ weight: weight,
971
+ forwardedXcms: forwardedXcms,
972
+ destParaId: destParaId
973
+ }));
974
+ case 16:
975
+ _context16.n = 17;
976
+ return this.calculateTransactionFee(tx, address);
977
+ case 17:
978
+ executionFee = _context16.v;
979
+ fee = sdkCore.computeFeeFromDryRunPjs(resultHuman, chain, executionFee);
930
980
  return _context16.a(2, {
931
981
  success: true,
932
982
  fee: fee,
@@ -937,9 +987,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
937
987
  destParaId: destParaId
938
988
  });
939
989
  }
940
- }, _callee16, this, [[7, 9], [2, 4]]);
990
+ }, _callee16, this, [[10, 12], [5, 7]]);
941
991
  }));
942
- function getDryRunCall(_x31) {
992
+ function getDryRunCall(_x32) {
943
993
  return _getDryRunCall.apply(this, arguments);
944
994
  }
945
995
  return getDryRunCall;
@@ -947,27 +997,68 @@ var PolkadotJsApi = /*#__PURE__*/function () {
947
997
  }, {
948
998
  key: "getXcmPaymentApiFee",
949
999
  value: function () {
950
- var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17(chain, xcm, asset) {
951
- var weight, localizedLocation, feeResult, res;
1000
+ var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17(chain, localXcm, forwardedXcm, asset) {
1001
+ var _ref7, _deliveryFeeResJson$o, _deliveryFeeResJson$o2, _deliveryFeeResJson$o3, _ref8, _deliveryFeeResJson$o4, _deliveryFeeResJson$o5, _deliveryFeeResJson$o6;
1002
+ var weight, assetLocalizedLoc, feeResult, execFeeRes, execFee, deliveryFeeRes, deliveryFeeResJson, deliveryFeeResolved, nativeAsset, deliveryFee, res, _t4;
952
1003
  return _regenerator().w(function (_context17) {
953
- while (1) switch (_context17.n) {
1004
+ while (1) switch (_context17.p = _context17.n) {
954
1005
  case 0:
955
1006
  _context17.n = 1;
956
- return this.getXcmWeight(xcm);
1007
+ return this.getXcmWeight(localXcm);
957
1008
  case 1:
958
1009
  weight = _context17.v;
959
1010
  sdkCore.assertHasLocation(asset);
960
- localizedLocation = chain === 'AssetHubPolkadot' || chain === 'AssetHubKusama' || sdkCore.isRelayChain(chain) ? sdkCore.localizeLocation(chain, asset.location) : asset.location;
1011
+ assetLocalizedLoc = sdkCore.localizeLocation(chain, asset.location);
961
1012
  _context17.n = 2;
962
- return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weight, sdkCore.addXcmVersionHeader(localizedLocation, sdkCore.Version.V4));
1013
+ return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weight, sdkCore.addXcmVersionHeader(assetLocalizedLoc, sdkCore.Version.V4));
963
1014
  case 2:
964
1015
  feeResult = _context17.v;
965
- res = feeResult.toJSON();
966
- return _context17.a(2, BigInt(res.ok));
1016
+ execFeeRes = feeResult.toJSON();
1017
+ execFee = BigInt(execFeeRes.ok);
1018
+ if (!(forwardedXcm.length > 0)) {
1019
+ _context17.n = 4;
1020
+ break;
1021
+ }
1022
+ _context17.n = 3;
1023
+ return this.api.call.xcmPaymentApi.queryDeliveryFees(forwardedXcm[0], forwardedXcm[1][0]);
1024
+ case 3:
1025
+ _t4 = _context17.v;
1026
+ _context17.n = 5;
1027
+ break;
1028
+ case 4:
1029
+ _t4 = undefined;
1030
+ case 5:
1031
+ deliveryFeeRes = _t4;
1032
+ deliveryFeeResJson = deliveryFeeRes === null || deliveryFeeRes === void 0 ? void 0 : deliveryFeeRes.toJSON();
1033
+ deliveryFeeResolved = deliveryFeeRes && ((_ref7 = (_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 || _ref7 === void 0 ? void 0 : _ref7.length) > 0 ? BigInt((_ref8 = (_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 || _ref8 === void 0 || (_ref8 = _ref8[0]) === null || _ref8 === void 0 || (_ref8 = _ref8.fun) === null || _ref8 === void 0 ? void 0 : _ref8.fungible) : 0n;
1034
+ nativeAsset = sdkCore.findNativeAssetInfoOrThrow(chain);
1035
+ if (!sdkCore.isAssetXcEqual(asset, nativeAsset)) {
1036
+ _context17.n = 6;
1037
+ break;
1038
+ }
1039
+ deliveryFee = deliveryFeeResolved;
1040
+ _context17.n = 9;
1041
+ break;
1042
+ case 6:
1043
+ _context17.p = 6;
1044
+ sdkCore.assertHasLocation(nativeAsset);
1045
+ _context17.n = 7;
1046
+ return this.quoteAhPrice(sdkCore.localizeLocation(chain, nativeAsset.location), assetLocalizedLoc, deliveryFeeResolved, false);
1047
+ case 7:
1048
+ res = _context17.v;
1049
+ deliveryFee = res !== null && res !== void 0 ? res : 0n;
1050
+ _context17.n = 9;
1051
+ break;
1052
+ case 8:
1053
+ _context17.p = 8;
1054
+ _context17.v;
1055
+ deliveryFee = 0n;
1056
+ case 9:
1057
+ return _context17.a(2, execFee + deliveryFee);
967
1058
  }
968
- }, _callee17, this);
1059
+ }, _callee17, this, [[6, 8]]);
969
1060
  }));
970
- function getXcmPaymentApiFee(_x33, _x34, _x35) {
1061
+ function getXcmPaymentApiFee(_x34, _x35, _x36, _x37) {
971
1062
  return _getXcmPaymentApiFee.apply(this, arguments);
972
1063
  }
973
1064
  return getXcmPaymentApiFee;
@@ -989,7 +1080,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
989
1080
  }
990
1081
  }, _callee18, this);
991
1082
  }));
992
- function getXcmWeight(_x36) {
1083
+ function getXcmWeight(_x38) {
993
1084
  return _getXcmWeight.apply(this, arguments);
994
1085
  }
995
1086
  return getXcmWeight;
@@ -997,13 +1088,13 @@ var PolkadotJsApi = /*#__PURE__*/function () {
997
1088
  }, {
998
1089
  key: "getDryRunXcm",
999
1090
  value: function () {
1000
- var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(_ref8) {
1001
- var _ref9, _ref0, _ref1;
1002
- var originLocation, xcm, asset, chain, origin, supportsDryRunApi, response, result, resultJson, symbol, isSuccess, failureReason, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee, actualWeight, weight, forwardedXcms, destParaId;
1091
+ var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(_ref9) {
1092
+ var _ref1, _ref10, _ref11;
1093
+ var originLocation, xcm, asset, chain, origin, supportsDryRunApi, response, result, resultJson, symbol, isSuccess, failureReason, forwardedXcms, actualWeight, weight, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee;
1003
1094
  return _regenerator().w(function (_context19) {
1004
1095
  while (1) switch (_context19.n) {
1005
1096
  case 0:
1006
- originLocation = _ref8.originLocation, xcm = _ref8.xcm, asset = _ref8.asset, chain = _ref8.chain, origin = _ref8.origin;
1097
+ originLocation = _ref9.originLocation, xcm = _ref9.xcm, asset = _ref9.asset, chain = _ref9.chain, origin = _ref9.origin;
1007
1098
  supportsDryRunApi = sdkCore.getAssetsObject(chain).supportsDryRunApi;
1008
1099
  if (supportsDryRunApi) {
1009
1100
  _context19.n = 1;
@@ -1031,24 +1122,55 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1031
1122
  asset: asset
1032
1123
  });
1033
1124
  case 3:
1125
+ forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
1126
+ actualWeight = resultJson.ok.executionResult.used;
1127
+ weight = actualWeight ? {
1128
+ refTime: BigInt(actualWeight.refTime),
1129
+ proofSize: BigInt(actualWeight.proofSize)
1130
+ } : undefined;
1131
+ destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref0) {
1132
+ return i.Here ? 0 : (_ref0 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref0 === void 0 ? void 0 : _ref0.parachain;
1133
+ }(Object.values(forwardedXcms[0])[0].interior);
1134
+ if (!(sdkCore.hasXcmPaymentApiSupport(chain) && asset)) {
1135
+ _context19.n = 5;
1136
+ break;
1137
+ }
1138
+ _context19.n = 4;
1139
+ return this.getXcmPaymentApiFee(chain, xcm, forwardedXcms, asset);
1140
+ case 4:
1141
+ _fee = _context19.v;
1142
+ if (!(typeof _fee === 'bigint')) {
1143
+ _context19.n = 5;
1144
+ break;
1145
+ }
1146
+ return _context19.a(2, {
1147
+ success: true,
1148
+ fee: _fee,
1149
+ currency: symbol,
1150
+ asset: asset,
1151
+ weight: weight,
1152
+ forwardedXcms: forwardedXcms,
1153
+ destParaId: destParaId
1154
+ });
1155
+ case 5:
1034
1156
  emitted = result.Ok.emittedEvents; // We want to look for the last event
1035
1157
  reversedEvents = _toConsumableArray(emitted).reverse();
1036
1158
  palletsWithIssued = ['balances', 'foreignAssets', 'assets'];
1037
- feeEvent = (_ref9 = (_ref0 = (_ref1 = origin === 'Mythos' ? reversedEvents.find(function (event) {
1159
+ feeEvent = (_ref1 = (_ref10 = (_ref11 = origin === 'Mythos' ? reversedEvents.find(function (event) {
1038
1160
  return event.section === 'assetConversion' && event.method === 'SwapCreditExecuted';
1039
- }) : undefined) !== null && _ref1 !== void 0 ? _ref1 :
1161
+ }) : undefined) !== null && _ref11 !== void 0 ? _ref11 :
1040
1162
  // Prefer an Issued event
1041
1163
  reversedEvents.find(function (event) {
1042
1164
  return palletsWithIssued.includes(event.section) && event.method === 'Issued';
1043
- })) !== null && _ref0 !== void 0 ? _ref0 :
1165
+ })) !== null && _ref10 !== void 0 ? _ref10 :
1044
1166
  // Fallback to Minted event
1045
1167
  reversedEvents.find(function (event) {
1046
1168
  return ['balances', 'foreignAssets'].includes(event.section) && event.method === 'Minted';
1047
- })) !== null && _ref9 !== void 0 ? _ref9 : reversedEvents.find(function (event) {
1169
+ })) !== null && _ref1 !== void 0 ? _ref1 : reversedEvents.find(function (event) {
1048
1170
  return ['currencies', 'tokens'].includes(event.section) && event.method === 'Deposited';
1049
1171
  });
1050
1172
  if (feeEvent) {
1051
- _context19.n = 4;
1173
+ _context19.n = 6;
1052
1174
  break;
1053
1175
  }
1054
1176
  return _context19.a(2, Promise.resolve({
@@ -1057,18 +1179,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1057
1179
  currency: symbol,
1058
1180
  asset: asset
1059
1181
  }));
1060
- case 4:
1182
+ case 6:
1061
1183
  feeAmount = feeEvent.section === 'assetConversion' ? feeEvent.data.amountIn : feeEvent.data.amount;
1062
1184
  fee = BigInt(feeAmount.replace(/,/g, ''));
1063
- actualWeight = resultJson.ok.executionResult.used;
1064
- weight = actualWeight ? {
1065
- refTime: BigInt(actualWeight.refTime),
1066
- proofSize: BigInt(actualWeight.proofSize)
1067
- } : undefined;
1068
- forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
1069
- destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref10) {
1070
- return i.Here ? 0 : (_ref10 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref10 === void 0 ? void 0 : _ref10.parachain;
1071
- }(Object.values(forwardedXcms[0])[0].interior);
1072
1185
  return _context19.a(2, {
1073
1186
  success: true,
1074
1187
  fee: fee,
@@ -1081,7 +1194,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1081
1194
  }
1082
1195
  }, _callee19, this);
1083
1196
  }));
1084
- function getDryRunXcm(_x37) {
1197
+ function getDryRunXcm(_x39) {
1085
1198
  return _getDryRunXcm.apply(this, arguments);
1086
1199
  }
1087
1200
  return getDryRunXcm;
@@ -1134,7 +1247,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1134
1247
  }
1135
1248
  }, _callee21, this);
1136
1249
  }));
1137
- function convertLocationToAccount(_x38) {
1250
+ function convertLocationToAccount(_x40) {
1138
1251
  return _convertLocationToAccount.apply(this, arguments);
1139
1252
  }
1140
1253
  return convertLocationToAccount;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { isConfig, BatchMode, MissingChainApiError, createChainClient as createChainClient$1, assertHasId, getChain, isForeignAsset, InvalidParameterError, computeFeeFromDryRunPjs, findNativeAssetInfoOrThrow, resolveModuleError, getAssetsObject, ChainNotSupportedError, assertHasLocation, localizeLocation, isRelayChain, addXcmVersionHeader, Version, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$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, findAssetInfoOrThrow, abstractDecimals, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress, 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, MissingChainApiError, createChainClient as createChainClient$1, assertHasId, getChain, isForeignAsset, InvalidParameterError, computeFeeFromDryRunPjs, findNativeAssetInfoOrThrow, hasXcmPaymentApiSupport, resolveModuleError, getAssetsObject, ChainNotSupportedError, wrapTxBypass, assertHasLocation, localizeLocation, isAssetXcEqual, addXcmVersionHeader, Version, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$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, findAssetInfoOrThrow, abstractDecimals, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress, 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 { u32 } from '@polkadot/types';
@@ -352,7 +352,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
352
352
  _context2.n = 2;
353
353
  break;
354
354
  }
355
- return _context2.a(2, this.createApiInstance(apiConfig));
355
+ return _context2.a(2, this.createApiInstance(apiConfig, chain));
356
356
  case 2:
357
357
  return _context2.a(2, apiConfig);
358
358
  }
@@ -366,7 +366,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
366
366
  }, {
367
367
  key: "createApiInstance",
368
368
  value: function () {
369
- var _createApiInstance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(wsUrl) {
369
+ var _createApiInstance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(wsUrl, _chain) {
370
370
  var wsProvider;
371
371
  return _regenerator().w(function (_context3) {
372
372
  while (1) switch (_context3.n) {
@@ -378,7 +378,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
378
378
  }
379
379
  }, _callee3);
380
380
  }));
381
- function createApiInstance(_x5) {
381
+ function createApiInstance(_x5, _x6) {
382
382
  return _createApiInstance.apply(this, arguments);
383
383
  }
384
384
  return createApiInstance;
@@ -417,7 +417,12 @@ var PolkadotJsApi = /*#__PURE__*/function () {
417
417
  }, {
418
418
  key: "callDispatchAsMethod",
419
419
  value: function callDispatchAsMethod(call, address) {
420
- return this.api.tx.utility.dispatchAs(address, call);
420
+ var origin = {
421
+ system: {
422
+ Signed: address
423
+ }
424
+ };
425
+ return this.api.tx.utility.dispatchAs(origin, call);
421
426
  }
422
427
  }, {
423
428
  key: "objectToHex",
@@ -451,7 +456,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
451
456
  }
452
457
  }, _callee4);
453
458
  }));
454
- function calculateTransactionFee(_x6, _x7) {
459
+ function calculateTransactionFee(_x7, _x8) {
455
460
  return _calculateTransactionFee.apply(this, arguments);
456
461
  }
457
462
  return calculateTransactionFee;
@@ -475,7 +480,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
475
480
  }
476
481
  }, _callee5, this);
477
482
  }));
478
- function quoteAhPrice(_x8, _x9, _x0) {
483
+ function quoteAhPrice(_x9, _x0, _x1) {
479
484
  return _quoteAhPrice.apply(this, arguments);
480
485
  }
481
486
  return quoteAhPrice;
@@ -501,7 +506,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
501
506
  }
502
507
  }, _callee6, this);
503
508
  }));
504
- function getBalanceNative(_x1) {
509
+ function getBalanceNative(_x10) {
505
510
  return _getBalanceNative.apply(this, arguments);
506
511
  }
507
512
  return getBalanceNative;
@@ -525,7 +530,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
525
530
  }
526
531
  }, _callee7, this);
527
532
  }));
528
- function getBalanceForeignPolkadotXcm(_x10, _x11, _x12) {
533
+ function getBalanceForeignPolkadotXcm(_x11, _x12, _x13) {
529
534
  return _getBalanceForeignPolkadotXcm.apply(this, arguments);
530
535
  }
531
536
  return getBalanceForeignPolkadotXcm;
@@ -547,7 +552,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
547
552
  }
548
553
  }, _callee8, this);
549
554
  }));
550
- function getMythosForeignBalance(_x13) {
555
+ function getMythosForeignBalance(_x14) {
551
556
  return _getMythosForeignBalance.apply(this, arguments);
552
557
  }
553
558
  return getMythosForeignBalance;
@@ -569,7 +574,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
569
574
  }
570
575
  }, _callee9, this);
571
576
  }));
572
- function getBalanceForeignAssetsPallet(_x14, _x15) {
577
+ function getBalanceForeignAssetsPallet(_x15, _x16) {
573
578
  return _getBalanceForeignAssetsPallet.apply(this, arguments);
574
579
  }
575
580
  return getBalanceForeignAssetsPallet;
@@ -591,7 +596,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
591
596
  }
592
597
  }, _callee0, this);
593
598
  }));
594
- function getForeignAssetsByIdBalance(_x16, _x17) {
599
+ function getForeignAssetsByIdBalance(_x17, _x18) {
595
600
  return _getForeignAssetsByIdBalance.apply(this, arguments);
596
601
  }
597
602
  return getForeignAssetsByIdBalance;
@@ -614,7 +619,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
614
619
  }
615
620
  }, _callee1, this);
616
621
  }));
617
- function getBalanceForeignBifrost(_x18, _x19) {
622
+ function getBalanceForeignBifrost(_x19, _x20) {
618
623
  return _getBalanceForeignBifrost.apply(this, arguments);
619
624
  }
620
625
  return getBalanceForeignBifrost;
@@ -638,7 +643,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
638
643
  }
639
644
  }, _callee10, this);
640
645
  }));
641
- function getBalanceNativeAcala(_x20, _x21) {
646
+ function getBalanceNativeAcala(_x21, _x22) {
642
647
  return _getBalanceNativeAcala.apply(this, arguments);
643
648
  }
644
649
  return getBalanceNativeAcala;
@@ -674,7 +679,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
674
679
  }
675
680
  }, _callee11, this);
676
681
  }));
677
- function getBalanceForeignXTokens(_x22, _x23, _x24) {
682
+ function getBalanceForeignXTokens(_x23, _x24, _x25) {
678
683
  return _getBalanceForeignXTokens.apply(this, arguments);
679
684
  }
680
685
  return getBalanceForeignXTokens;
@@ -696,7 +701,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
696
701
  }
697
702
  }, _callee12, this);
698
703
  }));
699
- function getBalanceAssetsPallet(_x25, _x26) {
704
+ function getBalanceAssetsPallet(_x26, _x27) {
700
705
  return _getBalanceAssetsPallet.apply(this, arguments);
701
706
  }
702
707
  return getBalanceAssetsPallet;
@@ -737,7 +742,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
737
742
  }
738
743
  }, _callee13, this);
739
744
  }));
740
- function getFromRpc(_x27, _x28, _x29) {
745
+ function getFromRpc(_x28, _x29, _x30) {
741
746
  return _getFromRpc.apply(this, arguments);
742
747
  }
743
748
  return getFromRpc;
@@ -768,7 +773,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
768
773
  }
769
774
  }, _callee14);
770
775
  }));
771
- function createApiForChain(_x30) {
776
+ function createApiForChain(_x31) {
772
777
  return _createApiForChain.apply(this, arguments);
773
778
  }
774
779
  return createApiForChain;
@@ -776,13 +781,13 @@ var PolkadotJsApi = /*#__PURE__*/function () {
776
781
  }, {
777
782
  key: "getDryRunCall",
778
783
  value: function () {
779
- var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(_ref4) {
784
+ var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(options) {
780
785
  var _this = this;
781
- var tx, address, feeAsset, chain, supportsDryRunApi, DEFAULT_XCM_VERSION, usedAsset, usedSymbol, performDryRunCall, getExecutionSuccessFromResult, extractFailureReasonFromResult, response, resultHuman, resultJson, isSuccess, failureReason, shouldRetryWithVersion, msg, _msg, executionFee, fee, actualWeight, weight, forwardedXcms, destParaId, _t, _t2;
786
+ var tx, address, feeAsset, chain, destination, _options$useRootOrigi, useRootOrigin, bypassOptions, supportsDryRunApi, DEFAULT_XCM_VERSION, basePayload, resolvedTx, usedAsset, usedSymbol, performDryRunCall, getExecutionSuccessFromResult, extractFailureReasonFromResult, response, resultHuman, resultJson, isSuccess, failureReason, shouldRetryWithVersion, msg, _msg, forwardedXcms, actualWeight, weight, nativeAsset, hasLocation, destParaId, xcmFee, executionFee, fee, _t, _t2, _t3;
782
787
  return _regenerator().w(function (_context16) {
783
788
  while (1) switch (_context16.p = _context16.n) {
784
789
  case 0:
785
- tx = _ref4.tx, address = _ref4.address, feeAsset = _ref4.feeAsset, chain = _ref4.chain;
790
+ 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;
786
791
  supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
787
792
  if (supportsDryRunApi) {
788
793
  _context16.n = 1;
@@ -791,24 +796,45 @@ var PolkadotJsApi = /*#__PURE__*/function () {
791
796
  throw new ChainNotSupportedError("DryRunApi is not available on chain ".concat(chain));
792
797
  case 1:
793
798
  DEFAULT_XCM_VERSION = 3;
799
+ basePayload = useRootOrigin ? {
800
+ system: {
801
+ Root: null
802
+ }
803
+ } : {
804
+ system: {
805
+ Signed: address
806
+ }
807
+ };
808
+ if (!useRootOrigin) {
809
+ _context16.n = 3;
810
+ break;
811
+ }
812
+ _context16.n = 2;
813
+ return wrapTxBypass(_objectSpread2(_objectSpread2({}, options), {}, {
814
+ api: this
815
+ }), bypassOptions);
816
+ case 2:
817
+ _t = _context16.v;
818
+ _context16.n = 4;
819
+ break;
820
+ case 3:
821
+ _t = tx;
822
+ case 4:
823
+ resolvedTx = _t;
794
824
  usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrow(chain);
795
825
  usedSymbol = usedAsset.symbol;
796
826
  performDryRunCall = /*#__PURE__*/function () {
797
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(includeVersion) {
827
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(includeVersion) {
798
828
  var _this$api$call$dryRun;
799
829
  return _regenerator().w(function (_context15) {
800
830
  while (1) switch (_context15.n) {
801
831
  case 0:
802
- return _context15.a(2, (_this$api$call$dryRun = _this.api.call.dryRunApi).dryRunCall.apply(_this$api$call$dryRun, [{
803
- system: {
804
- Signed: address
805
- }
806
- }, tx].concat(_toConsumableArray(includeVersion ? [DEFAULT_XCM_VERSION] : []))));
832
+ return _context15.a(2, (_this$api$call$dryRun = _this.api.call.dryRunApi).dryRunCall.apply(_this$api$call$dryRun, [basePayload, resolvedTx].concat(_toConsumableArray(includeVersion ? [DEFAULT_XCM_VERSION] : []))));
807
833
  }
808
834
  }, _callee15);
809
835
  }));
810
- return function performDryRunCall(_x32) {
811
- return _ref5.apply(this, arguments);
836
+ return function performDryRunCall(_x33) {
837
+ return _ref4.apply(this, arguments);
812
838
  };
813
839
  }();
814
840
  getExecutionSuccessFromResult = function getExecutionSuccessFromResult(resultHuman) {
@@ -816,7 +842,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
816
842
  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));
817
843
  };
818
844
  extractFailureReasonFromResult = function extractFailureReasonFromResult(resultHuman, resultJson) {
819
- var _resultHuman$Ok, _resultHuman$Ok2, _resultJson$ok, _ref6;
845
+ var _resultHuman$Ok, _resultHuman$Ok2, _resultJson$ok, _ref5;
820
846
  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;
821
847
  if (modErrHuman) {
822
848
  return resolveModuleError(chain, modErrHuman);
@@ -832,15 +858,15 @@ var PolkadotJsApi = /*#__PURE__*/function () {
832
858
  if (execErrJson !== null && execErrJson !== void 0 && execErrJson.other) {
833
859
  return String(execErrJson.other);
834
860
  }
835
- return JSON.stringify((_ref6 = resultJson !== null && resultJson !== void 0 ? resultJson : resultHuman) !== null && _ref6 !== void 0 ? _ref6 : 'Unknown error');
861
+ return JSON.stringify((_ref5 = resultJson !== null && resultJson !== void 0 ? resultJson : resultHuman) !== null && _ref5 !== void 0 ? _ref5 : 'Unknown error');
836
862
  }; // Attempt 1: WITHOUT version
837
863
  isSuccess = false;
838
864
  failureReason = '';
839
865
  shouldRetryWithVersion = false;
840
- _context16.p = 2;
841
- _context16.n = 3;
866
+ _context16.p = 5;
867
+ _context16.n = 6;
842
868
  return performDryRunCall(false);
843
- case 3:
869
+ case 6:
844
870
  response = _context16.v;
845
871
  resultHuman = response.toHuman();
846
872
  resultJson = response.toJSON();
@@ -851,35 +877,35 @@ var PolkadotJsApi = /*#__PURE__*/function () {
851
877
  shouldRetryWithVersion = true;
852
878
  }
853
879
  }
854
- _context16.n = 6;
880
+ _context16.n = 9;
855
881
  break;
856
- case 4:
857
- _context16.p = 4;
858
- _t = _context16.v;
859
- msg = _t instanceof Error ? _t.message : String(_t);
882
+ case 7:
883
+ _context16.p = 7;
884
+ _t2 = _context16.v;
885
+ msg = _t2 instanceof Error ? _t2.message : String(_t2);
860
886
  if (!msg.includes('Expected 3 arguments')) {
861
- _context16.n = 5;
887
+ _context16.n = 8;
862
888
  break;
863
889
  }
864
890
  shouldRetryWithVersion = true;
865
- _context16.n = 6;
891
+ _context16.n = 9;
866
892
  break;
867
- case 5:
893
+ case 8:
868
894
  return _context16.a(2, {
869
895
  success: false,
870
896
  failureReason: msg,
871
897
  currency: usedSymbol,
872
898
  asset: usedAsset
873
899
  });
874
- case 6:
900
+ case 9:
875
901
  if (!shouldRetryWithVersion) {
876
- _context16.n = 10;
902
+ _context16.n = 13;
877
903
  break;
878
904
  }
879
- _context16.p = 7;
880
- _context16.n = 8;
905
+ _context16.p = 10;
906
+ _context16.n = 11;
881
907
  return performDryRunCall(true);
882
- case 8:
908
+ case 11:
883
909
  response = _context16.v;
884
910
  resultHuman = response.toHuman();
885
911
  resultJson = response.toJSON();
@@ -887,12 +913,12 @@ var PolkadotJsApi = /*#__PURE__*/function () {
887
913
  if (!isSuccess) {
888
914
  failureReason = extractFailureReasonFromResult(resultHuman, resultJson);
889
915
  }
890
- _context16.n = 10;
916
+ _context16.n = 13;
891
917
  break;
892
- case 9:
893
- _context16.p = 9;
894
- _t2 = _context16.v;
895
- _msg = _t2 instanceof Error ? _t2.message : String(_t2);
918
+ case 12:
919
+ _context16.p = 12;
920
+ _t3 = _context16.v;
921
+ _msg = _t3 instanceof Error ? _t3.message : String(_t3);
896
922
  failureReason = failureReason || _msg;
897
923
  return _context16.a(2, {
898
924
  success: false,
@@ -900,9 +926,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
900
926
  currency: usedSymbol,
901
927
  asset: usedAsset
902
928
  });
903
- case 10:
929
+ case 13:
904
930
  if (isSuccess) {
905
- _context16.n = 11;
931
+ _context16.n = 14;
906
932
  break;
907
933
  }
908
934
  return _context16.a(2, {
@@ -911,21 +937,45 @@ var PolkadotJsApi = /*#__PURE__*/function () {
911
937
  currency: usedSymbol,
912
938
  asset: usedAsset
913
939
  });
914
- case 11:
915
- _context16.n = 12;
916
- return this.calculateTransactionFee(tx, address);
917
- case 12:
918
- executionFee = _context16.v;
919
- fee = computeFeeFromDryRunPjs(resultHuman, chain, executionFee);
940
+ case 14:
941
+ forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
920
942
  actualWeight = resultJson.ok.executionResult.ok.actualWeight;
921
943
  weight = actualWeight ? {
922
944
  refTime: BigInt(actualWeight.refTime),
923
945
  proofSize: BigInt(actualWeight.proofSize)
924
946
  } : undefined;
925
- forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
926
- destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref7) {
927
- return i.here === null ? 0 : (_ref7 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref7 === void 0 ? void 0 : _ref7.parachain;
947
+ nativeAsset = findNativeAssetInfoOrThrow(chain);
948
+ hasLocation = feeAsset ? Boolean(feeAsset.location) : Boolean(nativeAsset === null || nativeAsset === void 0 ? void 0 : nativeAsset.location);
949
+ destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref6) {
950
+ return i.here === null ? 0 : (_ref6 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref6 === void 0 ? void 0 : _ref6.parachain;
928
951
  }(Object.values(forwardedXcms[0])[0].interior);
952
+ if (!(hasXcmPaymentApiSupport(chain) && resultJson.ok.local_xcm && hasLocation && (feeAsset || chain.startsWith('AssetHub') && destination === 'Ethereum'))) {
953
+ _context16.n = 16;
954
+ break;
955
+ }
956
+ _context16.n = 15;
957
+ return this.getXcmPaymentApiFee(chain, resultJson.ok.local_xcm, forwardedXcms, feeAsset !== null && feeAsset !== void 0 ? feeAsset : nativeAsset);
958
+ case 15:
959
+ xcmFee = _context16.v;
960
+ if (!(typeof xcmFee === 'bigint')) {
961
+ _context16.n = 16;
962
+ break;
963
+ }
964
+ return _context16.a(2, Promise.resolve({
965
+ success: true,
966
+ fee: xcmFee,
967
+ currency: usedSymbol,
968
+ asset: usedAsset,
969
+ weight: weight,
970
+ forwardedXcms: forwardedXcms,
971
+ destParaId: destParaId
972
+ }));
973
+ case 16:
974
+ _context16.n = 17;
975
+ return this.calculateTransactionFee(tx, address);
976
+ case 17:
977
+ executionFee = _context16.v;
978
+ fee = computeFeeFromDryRunPjs(resultHuman, chain, executionFee);
929
979
  return _context16.a(2, {
930
980
  success: true,
931
981
  fee: fee,
@@ -936,9 +986,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
936
986
  destParaId: destParaId
937
987
  });
938
988
  }
939
- }, _callee16, this, [[7, 9], [2, 4]]);
989
+ }, _callee16, this, [[10, 12], [5, 7]]);
940
990
  }));
941
- function getDryRunCall(_x31) {
991
+ function getDryRunCall(_x32) {
942
992
  return _getDryRunCall.apply(this, arguments);
943
993
  }
944
994
  return getDryRunCall;
@@ -946,27 +996,68 @@ var PolkadotJsApi = /*#__PURE__*/function () {
946
996
  }, {
947
997
  key: "getXcmPaymentApiFee",
948
998
  value: function () {
949
- var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17(chain, xcm, asset) {
950
- var weight, localizedLocation, feeResult, res;
999
+ var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17(chain, localXcm, forwardedXcm, asset) {
1000
+ var _ref7, _deliveryFeeResJson$o, _deliveryFeeResJson$o2, _deliveryFeeResJson$o3, _ref8, _deliveryFeeResJson$o4, _deliveryFeeResJson$o5, _deliveryFeeResJson$o6;
1001
+ var weight, assetLocalizedLoc, feeResult, execFeeRes, execFee, deliveryFeeRes, deliveryFeeResJson, deliveryFeeResolved, nativeAsset, deliveryFee, res, _t4;
951
1002
  return _regenerator().w(function (_context17) {
952
- while (1) switch (_context17.n) {
1003
+ while (1) switch (_context17.p = _context17.n) {
953
1004
  case 0:
954
1005
  _context17.n = 1;
955
- return this.getXcmWeight(xcm);
1006
+ return this.getXcmWeight(localXcm);
956
1007
  case 1:
957
1008
  weight = _context17.v;
958
1009
  assertHasLocation(asset);
959
- localizedLocation = chain === 'AssetHubPolkadot' || chain === 'AssetHubKusama' || isRelayChain(chain) ? localizeLocation(chain, asset.location) : asset.location;
1010
+ assetLocalizedLoc = localizeLocation(chain, asset.location);
960
1011
  _context17.n = 2;
961
- return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weight, addXcmVersionHeader(localizedLocation, Version.V4));
1012
+ return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weight, addXcmVersionHeader(assetLocalizedLoc, Version.V4));
962
1013
  case 2:
963
1014
  feeResult = _context17.v;
964
- res = feeResult.toJSON();
965
- return _context17.a(2, BigInt(res.ok));
1015
+ execFeeRes = feeResult.toJSON();
1016
+ execFee = BigInt(execFeeRes.ok);
1017
+ if (!(forwardedXcm.length > 0)) {
1018
+ _context17.n = 4;
1019
+ break;
1020
+ }
1021
+ _context17.n = 3;
1022
+ return this.api.call.xcmPaymentApi.queryDeliveryFees(forwardedXcm[0], forwardedXcm[1][0]);
1023
+ case 3:
1024
+ _t4 = _context17.v;
1025
+ _context17.n = 5;
1026
+ break;
1027
+ case 4:
1028
+ _t4 = undefined;
1029
+ case 5:
1030
+ deliveryFeeRes = _t4;
1031
+ deliveryFeeResJson = deliveryFeeRes === null || deliveryFeeRes === void 0 ? void 0 : deliveryFeeRes.toJSON();
1032
+ deliveryFeeResolved = deliveryFeeRes && ((_ref7 = (_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 || _ref7 === void 0 ? void 0 : _ref7.length) > 0 ? BigInt((_ref8 = (_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 || _ref8 === void 0 || (_ref8 = _ref8[0]) === null || _ref8 === void 0 || (_ref8 = _ref8.fun) === null || _ref8 === void 0 ? void 0 : _ref8.fungible) : 0n;
1033
+ nativeAsset = findNativeAssetInfoOrThrow(chain);
1034
+ if (!isAssetXcEqual(asset, nativeAsset)) {
1035
+ _context17.n = 6;
1036
+ break;
1037
+ }
1038
+ deliveryFee = deliveryFeeResolved;
1039
+ _context17.n = 9;
1040
+ break;
1041
+ case 6:
1042
+ _context17.p = 6;
1043
+ assertHasLocation(nativeAsset);
1044
+ _context17.n = 7;
1045
+ return this.quoteAhPrice(localizeLocation(chain, nativeAsset.location), assetLocalizedLoc, deliveryFeeResolved, false);
1046
+ case 7:
1047
+ res = _context17.v;
1048
+ deliveryFee = res !== null && res !== void 0 ? res : 0n;
1049
+ _context17.n = 9;
1050
+ break;
1051
+ case 8:
1052
+ _context17.p = 8;
1053
+ _context17.v;
1054
+ deliveryFee = 0n;
1055
+ case 9:
1056
+ return _context17.a(2, execFee + deliveryFee);
966
1057
  }
967
- }, _callee17, this);
1058
+ }, _callee17, this, [[6, 8]]);
968
1059
  }));
969
- function getXcmPaymentApiFee(_x33, _x34, _x35) {
1060
+ function getXcmPaymentApiFee(_x34, _x35, _x36, _x37) {
970
1061
  return _getXcmPaymentApiFee.apply(this, arguments);
971
1062
  }
972
1063
  return getXcmPaymentApiFee;
@@ -988,7 +1079,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
988
1079
  }
989
1080
  }, _callee18, this);
990
1081
  }));
991
- function getXcmWeight(_x36) {
1082
+ function getXcmWeight(_x38) {
992
1083
  return _getXcmWeight.apply(this, arguments);
993
1084
  }
994
1085
  return getXcmWeight;
@@ -996,13 +1087,13 @@ var PolkadotJsApi = /*#__PURE__*/function () {
996
1087
  }, {
997
1088
  key: "getDryRunXcm",
998
1089
  value: function () {
999
- var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(_ref8) {
1000
- var _ref9, _ref0, _ref1;
1001
- var originLocation, xcm, asset, chain, origin, supportsDryRunApi, response, result, resultJson, symbol, isSuccess, failureReason, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee, actualWeight, weight, forwardedXcms, destParaId;
1090
+ var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(_ref9) {
1091
+ var _ref1, _ref10, _ref11;
1092
+ var originLocation, xcm, asset, chain, origin, supportsDryRunApi, response, result, resultJson, symbol, isSuccess, failureReason, forwardedXcms, actualWeight, weight, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee;
1002
1093
  return _regenerator().w(function (_context19) {
1003
1094
  while (1) switch (_context19.n) {
1004
1095
  case 0:
1005
- originLocation = _ref8.originLocation, xcm = _ref8.xcm, asset = _ref8.asset, chain = _ref8.chain, origin = _ref8.origin;
1096
+ originLocation = _ref9.originLocation, xcm = _ref9.xcm, asset = _ref9.asset, chain = _ref9.chain, origin = _ref9.origin;
1006
1097
  supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
1007
1098
  if (supportsDryRunApi) {
1008
1099
  _context19.n = 1;
@@ -1030,24 +1121,55 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1030
1121
  asset: asset
1031
1122
  });
1032
1123
  case 3:
1124
+ forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
1125
+ actualWeight = resultJson.ok.executionResult.used;
1126
+ weight = actualWeight ? {
1127
+ refTime: BigInt(actualWeight.refTime),
1128
+ proofSize: BigInt(actualWeight.proofSize)
1129
+ } : undefined;
1130
+ destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref0) {
1131
+ return i.Here ? 0 : (_ref0 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref0 === void 0 ? void 0 : _ref0.parachain;
1132
+ }(Object.values(forwardedXcms[0])[0].interior);
1133
+ if (!(hasXcmPaymentApiSupport(chain) && asset)) {
1134
+ _context19.n = 5;
1135
+ break;
1136
+ }
1137
+ _context19.n = 4;
1138
+ return this.getXcmPaymentApiFee(chain, xcm, forwardedXcms, asset);
1139
+ case 4:
1140
+ _fee = _context19.v;
1141
+ if (!(typeof _fee === 'bigint')) {
1142
+ _context19.n = 5;
1143
+ break;
1144
+ }
1145
+ return _context19.a(2, {
1146
+ success: true,
1147
+ fee: _fee,
1148
+ currency: symbol,
1149
+ asset: asset,
1150
+ weight: weight,
1151
+ forwardedXcms: forwardedXcms,
1152
+ destParaId: destParaId
1153
+ });
1154
+ case 5:
1033
1155
  emitted = result.Ok.emittedEvents; // We want to look for the last event
1034
1156
  reversedEvents = _toConsumableArray(emitted).reverse();
1035
1157
  palletsWithIssued = ['balances', 'foreignAssets', 'assets'];
1036
- feeEvent = (_ref9 = (_ref0 = (_ref1 = origin === 'Mythos' ? reversedEvents.find(function (event) {
1158
+ feeEvent = (_ref1 = (_ref10 = (_ref11 = origin === 'Mythos' ? reversedEvents.find(function (event) {
1037
1159
  return event.section === 'assetConversion' && event.method === 'SwapCreditExecuted';
1038
- }) : undefined) !== null && _ref1 !== void 0 ? _ref1 :
1160
+ }) : undefined) !== null && _ref11 !== void 0 ? _ref11 :
1039
1161
  // Prefer an Issued event
1040
1162
  reversedEvents.find(function (event) {
1041
1163
  return palletsWithIssued.includes(event.section) && event.method === 'Issued';
1042
- })) !== null && _ref0 !== void 0 ? _ref0 :
1164
+ })) !== null && _ref10 !== void 0 ? _ref10 :
1043
1165
  // Fallback to Minted event
1044
1166
  reversedEvents.find(function (event) {
1045
1167
  return ['balances', 'foreignAssets'].includes(event.section) && event.method === 'Minted';
1046
- })) !== null && _ref9 !== void 0 ? _ref9 : reversedEvents.find(function (event) {
1168
+ })) !== null && _ref1 !== void 0 ? _ref1 : reversedEvents.find(function (event) {
1047
1169
  return ['currencies', 'tokens'].includes(event.section) && event.method === 'Deposited';
1048
1170
  });
1049
1171
  if (feeEvent) {
1050
- _context19.n = 4;
1172
+ _context19.n = 6;
1051
1173
  break;
1052
1174
  }
1053
1175
  return _context19.a(2, Promise.resolve({
@@ -1056,18 +1178,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1056
1178
  currency: symbol,
1057
1179
  asset: asset
1058
1180
  }));
1059
- case 4:
1181
+ case 6:
1060
1182
  feeAmount = feeEvent.section === 'assetConversion' ? feeEvent.data.amountIn : feeEvent.data.amount;
1061
1183
  fee = BigInt(feeAmount.replace(/,/g, ''));
1062
- actualWeight = resultJson.ok.executionResult.used;
1063
- weight = actualWeight ? {
1064
- refTime: BigInt(actualWeight.refTime),
1065
- proofSize: BigInt(actualWeight.proofSize)
1066
- } : undefined;
1067
- forwardedXcms = resultJson.ok.forwardedXcms.length > 0 ? resultJson.ok.forwardedXcms[0] : [];
1068
- destParaId = forwardedXcms.length === 0 ? undefined : function (i, _ref10) {
1069
- return i.Here ? 0 : (_ref10 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref10 === void 0 ? void 0 : _ref10.parachain;
1070
- }(Object.values(forwardedXcms[0])[0].interior);
1071
1184
  return _context19.a(2, {
1072
1185
  success: true,
1073
1186
  fee: fee,
@@ -1080,7 +1193,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1080
1193
  }
1081
1194
  }, _callee19, this);
1082
1195
  }));
1083
- function getDryRunXcm(_x37) {
1196
+ function getDryRunXcm(_x39) {
1084
1197
  return _getDryRunXcm.apply(this, arguments);
1085
1198
  }
1086
1199
  return getDryRunXcm;
@@ -1133,7 +1246,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1133
1246
  }
1134
1247
  }, _callee21, this);
1135
1248
  }));
1136
- function convertLocationToAccount(_x38) {
1249
+ function convertLocationToAccount(_x40) {
1137
1250
  return _convertLocationToAccount.apply(this, arguments);
1138
1251
  }
1139
1252
  return convertLocationToAccount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-pjs",
3
- "version": "11.9.1",
3
+ "version": "11.9.3",
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.0",
28
28
  "ethers": "^6.15.0",
29
29
  "viem": "^2.37.9",
30
- "@paraspell/sdk-core": "11.9.1"
30
+ "@paraspell/sdk-core": "11.9.3"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@polkadot/api": ">= 16.0 < 17",