@paraspell/sdk-pjs 12.0.6 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +125 -64
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
1
|
+
import { isConfig, BatchMode, findNativeAssetInfoOrThrow, MissingChainApiError, getChainProviders, UnsupportedOperationError, findAssetInfoOrThrow, computeFeeFromDryRunPjs, hasXcmPaymentApiSupport, resolveModuleError, getAssetsObject, RuntimeApiUnavailableError, wrapTxBypass, assertHasLocation, localizeLocation, isAssetXcEqual, addXcmVersionHeader, Version, RELAY_LOCATION, getRelayChainOf, 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';
|
|
@@ -865,7 +865,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
865
865
|
value: function () {
|
|
866
866
|
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(chain, localXcm, forwardedXcm, asset) {
|
|
867
867
|
var _ref6, _deliveryFeeResJson$o, _deliveryFeeResJson$o2, _deliveryFeeResJson$o3, _ref7, _deliveryFeeResJson$o4, _deliveryFeeResJson$o5, _deliveryFeeResJson$o6;
|
|
868
|
-
var weight, assetLocalizedLoc, feeResult, execFeeRes, execFee, deliveryFeeRes, deliveryFeeResJson, deliveryFeeResolved, nativeAsset, deliveryFee, res, _t4;
|
|
868
|
+
var weight, assetLocalizedLoc, feeResult, execFeeRes, execFeeOk, execFee, isAssetNotFound, bridgeHubExecFee, deliveryFeeRes, deliveryFeeResJson, deliveryFeeResolved, nativeAsset, deliveryFee, res, _t4;
|
|
869
869
|
return _regenerator().w(function (_context10) {
|
|
870
870
|
while (1) switch (_context10.p = _context10.n) {
|
|
871
871
|
case 0:
|
|
@@ -880,49 +880,63 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
880
880
|
case 2:
|
|
881
881
|
feeResult = _context10.v;
|
|
882
882
|
execFeeRes = feeResult.toJSON();
|
|
883
|
-
|
|
884
|
-
|
|
883
|
+
execFeeOk = execFeeRes === null || execFeeRes === void 0 ? void 0 : execFeeRes.ok;
|
|
884
|
+
execFee = typeof execFeeOk === 'string' || typeof execFeeOk === 'number' ? BigInt(execFeeOk) : 0n;
|
|
885
|
+
isAssetNotFound = (execFeeRes === null || execFeeRes === void 0 ? void 0 : execFeeRes.err) === 'AssetNotFound';
|
|
886
|
+
if (!(chain.startsWith('BridgeHub') && isAssetNotFound)) {
|
|
885
887
|
_context10.n = 4;
|
|
886
888
|
break;
|
|
887
889
|
}
|
|
888
890
|
_context10.n = 3;
|
|
889
|
-
return this.
|
|
891
|
+
return this.getBridgeHubFallbackExecFee(chain, weight, asset);
|
|
890
892
|
case 3:
|
|
891
|
-
|
|
893
|
+
bridgeHubExecFee = _context10.v;
|
|
894
|
+
if (typeof bridgeHubExecFee === 'bigint') {
|
|
895
|
+
execFee = bridgeHubExecFee;
|
|
896
|
+
}
|
|
897
|
+
case 4:
|
|
898
|
+
if (!(forwardedXcm.length > 0)) {
|
|
899
|
+
_context10.n = 6;
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
892
902
|
_context10.n = 5;
|
|
903
|
+
return this.api.call.xcmPaymentApi.queryDeliveryFees(forwardedXcm[0], forwardedXcm[1][0]);
|
|
904
|
+
case 5:
|
|
905
|
+
_t4 = _context10.v;
|
|
906
|
+
_context10.n = 7;
|
|
893
907
|
break;
|
|
894
|
-
case
|
|
908
|
+
case 6:
|
|
895
909
|
_t4 = undefined;
|
|
896
|
-
case
|
|
910
|
+
case 7:
|
|
897
911
|
deliveryFeeRes = _t4;
|
|
898
912
|
deliveryFeeResJson = deliveryFeeRes === null || deliveryFeeRes === void 0 ? void 0 : deliveryFeeRes.toJSON();
|
|
899
913
|
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;
|
|
900
914
|
nativeAsset = findNativeAssetInfoOrThrow(chain);
|
|
901
915
|
if (!isAssetXcEqual(asset, nativeAsset)) {
|
|
902
|
-
_context10.n =
|
|
916
|
+
_context10.n = 8;
|
|
903
917
|
break;
|
|
904
918
|
}
|
|
905
919
|
deliveryFee = deliveryFeeResolved;
|
|
906
|
-
_context10.n =
|
|
920
|
+
_context10.n = 11;
|
|
907
921
|
break;
|
|
908
|
-
case
|
|
909
|
-
_context10.p =
|
|
922
|
+
case 8:
|
|
923
|
+
_context10.p = 8;
|
|
910
924
|
assertHasLocation(nativeAsset);
|
|
911
|
-
_context10.n =
|
|
925
|
+
_context10.n = 9;
|
|
912
926
|
return this.quoteAhPrice(localizeLocation(chain, nativeAsset.location), assetLocalizedLoc, deliveryFeeResolved, false);
|
|
913
|
-
case
|
|
927
|
+
case 9:
|
|
914
928
|
res = _context10.v;
|
|
915
929
|
deliveryFee = res !== null && res !== void 0 ? res : 0n;
|
|
916
|
-
_context10.n =
|
|
930
|
+
_context10.n = 11;
|
|
917
931
|
break;
|
|
918
|
-
case
|
|
919
|
-
_context10.p =
|
|
932
|
+
case 10:
|
|
933
|
+
_context10.p = 10;
|
|
920
934
|
_context10.v;
|
|
921
935
|
deliveryFee = 0n;
|
|
922
|
-
case
|
|
936
|
+
case 11:
|
|
923
937
|
return _context10.a(2, execFee + deliveryFee);
|
|
924
938
|
}
|
|
925
|
-
}, _callee10, this, [[
|
|
939
|
+
}, _callee10, this, [[8, 10]]);
|
|
926
940
|
}));
|
|
927
941
|
function getXcmPaymentApiFee(_x18, _x19, _x20, _x21) {
|
|
928
942
|
return _getXcmPaymentApiFee.apply(this, arguments);
|
|
@@ -930,23 +944,70 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
930
944
|
return getXcmPaymentApiFee;
|
|
931
945
|
}()
|
|
932
946
|
}, {
|
|
933
|
-
key: "
|
|
947
|
+
key: "getBridgeHubFallbackExecFee",
|
|
934
948
|
value: function () {
|
|
935
|
-
var
|
|
936
|
-
var
|
|
949
|
+
var _getBridgeHubFallbackExecFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(chain, weightValue, asset) {
|
|
950
|
+
var fallbackExecFeeRes, fallbackJson, fallbackOk, fallbackExecFee, ahApi, assetHubChain, ahLocalizedLoc, convertedExecFee;
|
|
937
951
|
return _regenerator().w(function (_context11) {
|
|
938
952
|
while (1) switch (_context11.n) {
|
|
939
953
|
case 0:
|
|
940
954
|
_context11.n = 1;
|
|
955
|
+
return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weightValue, addXcmVersionHeader(RELAY_LOCATION, Version.V4));
|
|
956
|
+
case 1:
|
|
957
|
+
fallbackExecFeeRes = _context11.v;
|
|
958
|
+
fallbackJson = fallbackExecFeeRes.toJSON();
|
|
959
|
+
fallbackOk = fallbackJson === null || fallbackJson === void 0 ? void 0 : fallbackJson.ok;
|
|
960
|
+
fallbackExecFee = typeof fallbackOk === 'string' || typeof fallbackOk === 'number' ? BigInt(fallbackOk) : undefined;
|
|
961
|
+
if (!(fallbackExecFee === undefined)) {
|
|
962
|
+
_context11.n = 2;
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
return _context11.a(2, undefined);
|
|
966
|
+
case 2:
|
|
967
|
+
ahApi = this.clone();
|
|
968
|
+
assetHubChain = "AssetHub".concat(getRelayChainOf(chain));
|
|
969
|
+
_context11.n = 3;
|
|
970
|
+
return ahApi.init(assetHubChain);
|
|
971
|
+
case 3:
|
|
972
|
+
assertHasLocation(asset);
|
|
973
|
+
ahLocalizedLoc = localizeLocation(assetHubChain, asset.location);
|
|
974
|
+
_context11.n = 4;
|
|
975
|
+
return ahApi.quoteAhPrice(RELAY_LOCATION, ahLocalizedLoc, fallbackExecFee, false);
|
|
976
|
+
case 4:
|
|
977
|
+
convertedExecFee = _context11.v;
|
|
978
|
+
if (!(typeof convertedExecFee === 'bigint')) {
|
|
979
|
+
_context11.n = 5;
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
return _context11.a(2, convertedExecFee);
|
|
983
|
+
case 5:
|
|
984
|
+
return _context11.a(2, undefined);
|
|
985
|
+
}
|
|
986
|
+
}, _callee11, this);
|
|
987
|
+
}));
|
|
988
|
+
function getBridgeHubFallbackExecFee(_x22, _x23, _x24) {
|
|
989
|
+
return _getBridgeHubFallbackExecFee.apply(this, arguments);
|
|
990
|
+
}
|
|
991
|
+
return getBridgeHubFallbackExecFee;
|
|
992
|
+
}()
|
|
993
|
+
}, {
|
|
994
|
+
key: "getXcmWeight",
|
|
995
|
+
value: function () {
|
|
996
|
+
var _getXcmWeight = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(xcm) {
|
|
997
|
+
var result, resultJson;
|
|
998
|
+
return _regenerator().w(function (_context12) {
|
|
999
|
+
while (1) switch (_context12.n) {
|
|
1000
|
+
case 0:
|
|
1001
|
+
_context12.n = 1;
|
|
941
1002
|
return this.api.call.xcmPaymentApi.queryXcmWeight(xcm);
|
|
942
1003
|
case 1:
|
|
943
|
-
result =
|
|
1004
|
+
result = _context12.v;
|
|
944
1005
|
resultJson = result.toJSON();
|
|
945
|
-
return
|
|
1006
|
+
return _context12.a(2, resultJson.ok);
|
|
946
1007
|
}
|
|
947
|
-
},
|
|
1008
|
+
}, _callee12, this);
|
|
948
1009
|
}));
|
|
949
|
-
function getXcmWeight(
|
|
1010
|
+
function getXcmWeight(_x25) {
|
|
950
1011
|
return _getXcmWeight.apply(this, arguments);
|
|
951
1012
|
}
|
|
952
1013
|
return getXcmWeight;
|
|
@@ -954,34 +1015,34 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
954
1015
|
}, {
|
|
955
1016
|
key: "getDryRunXcm",
|
|
956
1017
|
value: function () {
|
|
957
|
-
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1018
|
+
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13(_ref8) {
|
|
958
1019
|
var _ref0, _ref1, _ref10;
|
|
959
1020
|
var originLocation, xcm, asset, chain, origin, supportsDryRunApi, response, result, resultJson, isSuccess, error, failureReason, forwardedXcms, actualWeight, weight, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee;
|
|
960
|
-
return _regenerator().w(function (
|
|
961
|
-
while (1) switch (
|
|
1021
|
+
return _regenerator().w(function (_context13) {
|
|
1022
|
+
while (1) switch (_context13.n) {
|
|
962
1023
|
case 0:
|
|
963
1024
|
originLocation = _ref8.originLocation, xcm = _ref8.xcm, asset = _ref8.asset, chain = _ref8.chain, origin = _ref8.origin;
|
|
964
1025
|
supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
|
|
965
1026
|
if (supportsDryRunApi) {
|
|
966
|
-
|
|
1027
|
+
_context13.n = 1;
|
|
967
1028
|
break;
|
|
968
1029
|
}
|
|
969
1030
|
throw new RuntimeApiUnavailableError(chain, 'DryRunApi');
|
|
970
1031
|
case 1:
|
|
971
|
-
|
|
1032
|
+
_context13.n = 2;
|
|
972
1033
|
return this.api.call.dryRunApi.dryRunXcm(originLocation, xcm);
|
|
973
1034
|
case 2:
|
|
974
|
-
response =
|
|
1035
|
+
response = _context13.v;
|
|
975
1036
|
result = response.toHuman();
|
|
976
1037
|
resultJson = response.toJSON();
|
|
977
1038
|
isSuccess = result.Ok && result.Ok.executionResult.Complete;
|
|
978
1039
|
if (isSuccess) {
|
|
979
|
-
|
|
1040
|
+
_context13.n = 3;
|
|
980
1041
|
break;
|
|
981
1042
|
}
|
|
982
1043
|
error = result.Ok.executionResult.Incomplete.error;
|
|
983
1044
|
failureReason = typeof error === 'string' ? error : error.error;
|
|
984
|
-
return
|
|
1045
|
+
return _context13.a(2, {
|
|
985
1046
|
success: false,
|
|
986
1047
|
failureReason: failureReason,
|
|
987
1048
|
asset: asset
|
|
@@ -997,18 +1058,18 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
997
1058
|
return i.Here ? 0 : (_ref9 = Array.isArray(i.x1) ? i.x1[0] : i.x1) === null || _ref9 === void 0 ? void 0 : _ref9.parachain;
|
|
998
1059
|
}(Object.values(forwardedXcms[0])[0].interior);
|
|
999
1060
|
if (!(hasXcmPaymentApiSupport(chain) && asset)) {
|
|
1000
|
-
|
|
1061
|
+
_context13.n = 5;
|
|
1001
1062
|
break;
|
|
1002
1063
|
}
|
|
1003
|
-
|
|
1064
|
+
_context13.n = 4;
|
|
1004
1065
|
return this.getXcmPaymentApiFee(chain, xcm, forwardedXcms, asset);
|
|
1005
1066
|
case 4:
|
|
1006
|
-
_fee =
|
|
1067
|
+
_fee = _context13.v;
|
|
1007
1068
|
if (!(typeof _fee === 'bigint')) {
|
|
1008
|
-
|
|
1069
|
+
_context13.n = 5;
|
|
1009
1070
|
break;
|
|
1010
1071
|
}
|
|
1011
|
-
return
|
|
1072
|
+
return _context13.a(2, {
|
|
1012
1073
|
success: true,
|
|
1013
1074
|
fee: _fee,
|
|
1014
1075
|
asset: asset,
|
|
@@ -1034,10 +1095,10 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1034
1095
|
return ['currencies', 'tokens'].includes(event.section) && event.method === 'Deposited';
|
|
1035
1096
|
});
|
|
1036
1097
|
if (feeEvent) {
|
|
1037
|
-
|
|
1098
|
+
_context13.n = 6;
|
|
1038
1099
|
break;
|
|
1039
1100
|
}
|
|
1040
|
-
return
|
|
1101
|
+
return _context13.a(2, Promise.resolve({
|
|
1041
1102
|
success: false,
|
|
1042
1103
|
failureReason: 'Cannot determine destination fee. No Issued event found',
|
|
1043
1104
|
asset: asset
|
|
@@ -1045,7 +1106,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1045
1106
|
case 6:
|
|
1046
1107
|
feeAmount = feeEvent.section === 'assetConversion' ? feeEvent.data.amountIn : feeEvent.data.amount;
|
|
1047
1108
|
fee = BigInt(feeAmount.replace(/,/g, ''));
|
|
1048
|
-
return
|
|
1109
|
+
return _context13.a(2, {
|
|
1049
1110
|
success: true,
|
|
1050
1111
|
fee: fee,
|
|
1051
1112
|
asset: asset,
|
|
@@ -1054,9 +1115,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1054
1115
|
destParaId: destParaId
|
|
1055
1116
|
});
|
|
1056
1117
|
}
|
|
1057
|
-
},
|
|
1118
|
+
}, _callee13, this);
|
|
1058
1119
|
}));
|
|
1059
|
-
function getDryRunXcm(
|
|
1120
|
+
function getDryRunXcm(_x26) {
|
|
1060
1121
|
return _getDryRunXcm.apply(this, arguments);
|
|
1061
1122
|
}
|
|
1062
1123
|
return getDryRunXcm;
|
|
@@ -1064,18 +1125,18 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1064
1125
|
}, {
|
|
1065
1126
|
key: "getBridgeStatus",
|
|
1066
1127
|
value: function () {
|
|
1067
|
-
var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1128
|
+
var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
|
|
1068
1129
|
var outboundOperatingMode;
|
|
1069
|
-
return _regenerator().w(function (
|
|
1070
|
-
while (1) switch (
|
|
1130
|
+
return _regenerator().w(function (_context14) {
|
|
1131
|
+
while (1) switch (_context14.n) {
|
|
1071
1132
|
case 0:
|
|
1072
|
-
|
|
1133
|
+
_context14.n = 1;
|
|
1073
1134
|
return this.api.query.ethereumOutboundQueue.operatingMode();
|
|
1074
1135
|
case 1:
|
|
1075
|
-
outboundOperatingMode =
|
|
1076
|
-
return
|
|
1136
|
+
outboundOperatingMode = _context14.v;
|
|
1137
|
+
return _context14.a(2, outboundOperatingMode.toPrimitive());
|
|
1077
1138
|
}
|
|
1078
|
-
},
|
|
1139
|
+
}, _callee14, this);
|
|
1079
1140
|
}));
|
|
1080
1141
|
function getBridgeStatus() {
|
|
1081
1142
|
return _getBridgeStatus.apply(this, arguments);
|
|
@@ -1095,38 +1156,38 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1095
1156
|
}, {
|
|
1096
1157
|
key: "disconnect",
|
|
1097
1158
|
value: function () {
|
|
1098
|
-
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1159
|
+
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
1099
1160
|
var _this$_config$apiOver2;
|
|
1100
1161
|
var force,
|
|
1101
1162
|
api,
|
|
1102
|
-
|
|
1103
|
-
return _regenerator().w(function (
|
|
1104
|
-
while (1) switch (
|
|
1163
|
+
_args15 = arguments;
|
|
1164
|
+
return _regenerator().w(function (_context15) {
|
|
1165
|
+
while (1) switch (_context15.n) {
|
|
1105
1166
|
case 0:
|
|
1106
|
-
force =
|
|
1167
|
+
force = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : false;
|
|
1107
1168
|
if (this.initialized) {
|
|
1108
|
-
|
|
1169
|
+
_context15.n = 1;
|
|
1109
1170
|
break;
|
|
1110
1171
|
}
|
|
1111
|
-
return
|
|
1172
|
+
return _context15.a(2, Promise.resolve());
|
|
1112
1173
|
case 1:
|
|
1113
1174
|
if (!(!force && !this.disconnectAllowed)) {
|
|
1114
|
-
|
|
1175
|
+
_context15.n = 2;
|
|
1115
1176
|
break;
|
|
1116
1177
|
}
|
|
1117
|
-
return
|
|
1178
|
+
return _context15.a(2);
|
|
1118
1179
|
case 2:
|
|
1119
1180
|
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
|
|
1120
1181
|
if (!(force || typeof api === 'string' || api === undefined)) {
|
|
1121
|
-
|
|
1182
|
+
_context15.n = 3;
|
|
1122
1183
|
break;
|
|
1123
1184
|
}
|
|
1124
|
-
|
|
1185
|
+
_context15.n = 3;
|
|
1125
1186
|
return this.api.disconnect();
|
|
1126
1187
|
case 3:
|
|
1127
|
-
return
|
|
1188
|
+
return _context15.a(2);
|
|
1128
1189
|
}
|
|
1129
|
-
},
|
|
1190
|
+
}, _callee15, this);
|
|
1130
1191
|
}));
|
|
1131
1192
|
function disconnect() {
|
|
1132
1193
|
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
|
|
3
|
+
"version": "12.1.0",
|
|
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
|
|
30
|
+
"@paraspell/sdk-core": "12.1.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@polkadot/api": ">= 16.0 < 17",
|