@paraspell/sdk-dedot 14.3.4 → 14.3.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.
- package/dist/index.mjs +32 -9
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEvmPrivateKeyHex, getNativeAssetSymbol, getOtherAssets, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, isCustomChain, isSenderSigner, PolkadotApi, UnsupportedOperationError, buildDryRunError, resolveModuleError, RuntimeApiUnavailableError, wrapTxBypass, localizeLocation, createAssetId,
|
|
1
|
+
import { getEvmPrivateKeyHex, getNativeAssetSymbol, getOtherAssets, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, RoutingResolutionError, addXcmVersionHeader, createBridgedXcmPrefix, isCustomChain, isSenderSigner, PolkadotApi, UnsupportedOperationError, buildDryRunError, resolveModuleError, RuntimeApiUnavailableError, wrapTxBypass, localizeLocation, createAssetId, isAssetEqual, RELAY_LOCATION, SubmitTransactionError, replaceBigInt, createChainClient as createChainClient$1, getBalance as getBalance$1, Foreign, ForeignAbstract, Native, findAssetInfo, getAllAssetsSymbols, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssets, getRelayChainSymbol, getSupportedAssets, getTChain, isChainEvm, convertSs58 as convertSs58$1, Builder as Builder$1, getBridgeStatus as getBridgeStatus$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { stringPascalCase, isEvmAddress, decodeAddress, isHex, u8aToHex, hexToU8a, stringToU8a, blake2AsHex } from 'dedot/utils';
|
|
4
4
|
import { ParaSpellError, snakeToCamel, lowercaseFirstLetter } from '@paraspell/sdk-common';
|
|
@@ -1043,11 +1043,11 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1043
1043
|
_result3,
|
|
1044
1044
|
_resValue$executionRe,
|
|
1045
1045
|
_execRes$actualWeight;
|
|
1046
|
-
var tx, address,
|
|
1046
|
+
var tx, address, chain, destination, version, _options$useRootOrigi, useRootOrigin, bypassOptions, supportsDryRunApi, feeAsset, basePayload, resolvedTx, resolvedFeeAsset, performDryRunCall, findFailingEventInResult, getExecutionSuccessFromResult, extractFailureReasonFromResult, result, isSuccess, failureErr, shouldRetryWithVersion, msg, _result, _msg, _result2, resValue, execRes, forwardedXcms, actualWeight, weight, destParaId, localXcm, USE_XCM_PAYMENT_API_CHAINS, overriddenWeight, xcmFee, _yield$this$getPaymen, executionFee, fee, _t, _t2, _t3, _t4;
|
|
1047
1047
|
return _regenerator().w(function (_context7) {
|
|
1048
1048
|
while (1) switch (_context7.p = _context7.n) {
|
|
1049
1049
|
case 0:
|
|
1050
|
-
tx = options.tx, address = options.address,
|
|
1050
|
+
tx = options.tx, address = options.address, chain = options.chain, destination = options.destination, version = options.version, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi, bypassOptions = options.bypassOptions;
|
|
1051
1051
|
supportsDryRunApi = this.hasDryRunSupport(chain);
|
|
1052
1052
|
if (supportsDryRunApi) {
|
|
1053
1053
|
_context7.n = 1;
|
|
@@ -1055,6 +1055,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
throw new RuntimeApiUnavailableError(chain, "DryRunApi");
|
|
1057
1057
|
case 1:
|
|
1058
|
+
feeAsset = this.getMethod(tx) === "execute" ? options.feeAsset : undefined;
|
|
1058
1059
|
basePayload = {
|
|
1059
1060
|
type: "System",
|
|
1060
1061
|
value: useRootOrigin ? {
|
|
@@ -1081,7 +1082,9 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1081
1082
|
case 4:
|
|
1082
1083
|
resolvedTx = _t;
|
|
1083
1084
|
_context7.n = 5;
|
|
1084
|
-
return this.resolveFeeAsset(options)
|
|
1085
|
+
return this.resolveFeeAsset(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
1086
|
+
feeAsset: feeAsset
|
|
1087
|
+
}));
|
|
1085
1088
|
case 5:
|
|
1086
1089
|
resolvedFeeAsset = _context7.v;
|
|
1087
1090
|
performDryRunCall = function performDryRunCall(includeVersion) {
|
|
@@ -1276,7 +1279,9 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1276
1279
|
case 20:
|
|
1277
1280
|
resolvedFeeAsset = {
|
|
1278
1281
|
isCustomAsset: false,
|
|
1279
|
-
asset: this.resolveDefaultFeeAsset(options)
|
|
1282
|
+
asset: this.resolveDefaultFeeAsset(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
1283
|
+
feeAsset: feeAsset
|
|
1284
|
+
}))
|
|
1280
1285
|
};
|
|
1281
1286
|
case 21:
|
|
1282
1287
|
_context7.n = 22;
|
|
@@ -1305,8 +1310,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1305
1310
|
key: "getXcmPaymentApiFee",
|
|
1306
1311
|
value: function () {
|
|
1307
1312
|
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(chain, localXcm, forwardedXcm, asset, version) {
|
|
1308
|
-
var _this3 = this
|
|
1309
|
-
_execFeeRes$value;
|
|
1313
|
+
var _this3 = this;
|
|
1310
1314
|
var transformXcm,
|
|
1311
1315
|
overridenWeight,
|
|
1312
1316
|
transformedXcm,
|
|
@@ -1366,7 +1370,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1366
1370
|
case 4:
|
|
1367
1371
|
execFeeRes = _context9.v;
|
|
1368
1372
|
execFee = typeof (execFeeRes === null || execFeeRes === void 0 ? void 0 : execFeeRes.value) === "bigint" ? execFeeRes.value : 0n;
|
|
1369
|
-
if (!(chain.startsWith("BridgeHub") &&
|
|
1373
|
+
if (!(chain.startsWith("BridgeHub") && execFeeRes !== null && execFeeRes !== void 0 && execFeeRes.isErr && execFeeRes.err === "AssetNotFound")) {
|
|
1370
1374
|
_context9.n = 6;
|
|
1371
1375
|
break;
|
|
1372
1376
|
}
|
|
@@ -1470,7 +1474,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1470
1474
|
while (1) switch (_context1.n) {
|
|
1471
1475
|
case 0:
|
|
1472
1476
|
_context1.n = 1;
|
|
1473
|
-
return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weightValue, addXcmVersionHeader(RELAY_LOCATION, version));
|
|
1477
|
+
return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weightValue, _transform(addXcmVersionHeader(RELAY_LOCATION, version)));
|
|
1474
1478
|
case 1:
|
|
1475
1479
|
fallbackExecFeeRes = _context1.v;
|
|
1476
1480
|
fallbackOk = fallbackExecFeeRes === null || fallbackExecFeeRes === void 0 ? void 0 : fallbackExecFeeRes.value;
|
|
@@ -1621,6 +1625,22 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1621
1625
|
}
|
|
1622
1626
|
return getDryRunXcm;
|
|
1623
1627
|
}()
|
|
1628
|
+
}, {
|
|
1629
|
+
key: "createBridgedForwardedXcms",
|
|
1630
|
+
value: function createBridgedForwardedXcms(forwardedXcm, params) {
|
|
1631
|
+
var version = forwardedXcm.type;
|
|
1632
|
+
var exportMessage = forwardedXcm.value.find(function (instruction) {
|
|
1633
|
+
return instruction.type === "ExportMessage";
|
|
1634
|
+
});
|
|
1635
|
+
if (!exportMessage) {
|
|
1636
|
+
throw new RoutingResolutionError("ExportMessage instruction not found in the forwarded XCM");
|
|
1637
|
+
}
|
|
1638
|
+
var destination = addXcmVersionHeader(params.destination, version);
|
|
1639
|
+
return [_transform(destination), [{
|
|
1640
|
+
type: version,
|
|
1641
|
+
value: [].concat(_toConsumableArray(_transform(createBridgedXcmPrefix(version, params))), _toConsumableArray(exportMessage.value.xcm))
|
|
1642
|
+
}]];
|
|
1643
|
+
}
|
|
1624
1644
|
}, {
|
|
1625
1645
|
key: "getBridgeStatus",
|
|
1626
1646
|
value: function () {
|
|
@@ -1700,6 +1720,9 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1700
1720
|
releaseClient(key);
|
|
1701
1721
|
}
|
|
1702
1722
|
}
|
|
1723
|
+
if (force || _typeof(api) !== "object" || Array.isArray(api)) {
|
|
1724
|
+
this.resetChain();
|
|
1725
|
+
}
|
|
1703
1726
|
return Promise.resolve();
|
|
1704
1727
|
}
|
|
1705
1728
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-dedot",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.6",
|
|
4
4
|
"description": "Dedot-based SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@paraspell/sdk-common": "14.3.
|
|
26
|
-
"@paraspell/sdk-core": "14.3.
|
|
25
|
+
"@paraspell/sdk-common": "14.3.6",
|
|
26
|
+
"@paraspell/sdk-core": "14.3.6"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"dedot": ">= 1.3.0",
|