@paraspell/sdk 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 +54 -4
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getNativeAssetSymbol, getOtherAssets, isSenderSigner, getEvmPrivateKeyHex, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, InvalidAddressError, BatchMode, isConfig, isCustomChain, PolkadotApi, Parents, buildDryRunError, replaceBigInt, RuntimeApiUnavailableError, wrapTxBypass, RuntimeApiError, localizeLocation, isAssetEqual, createAssetId,
|
|
1
|
+
import { getNativeAssetSymbol, getOtherAssets, isSenderSigner, getEvmPrivateKeyHex, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, InvalidAddressError, BatchMode, isConfig, RoutingResolutionError, addXcmVersionHeader, createBridgedXcmPrefix, isCustomChain, PolkadotApi, Parents, buildDryRunError, replaceBigInt, RuntimeApiUnavailableError, wrapTxBypass, RuntimeApiError, localizeLocation, isAssetEqual, createAssetId, RELAY_LOCATION, isRelayChain, padValueBy, SubmitTransactionError, 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, CustomChainInvalidError, handleSwapExecuteTransfer as handleSwapExecuteTransfer$1, getBridgeStatus as getBridgeStatus$1, getParaEthTransferFees as getParaEthTransferFees$1, getXcmFee as getXcmFee$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { secp256k1 } from '@noble/curves/secp256k1.js';
|
|
4
4
|
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
@@ -124,6 +124,15 @@ function _defineProperty(e, r, t) {
|
|
|
124
124
|
writable: true
|
|
125
125
|
}) : e[r] = t, e;
|
|
126
126
|
}
|
|
127
|
+
function _get() {
|
|
128
|
+
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
|
129
|
+
var p = _superPropBase(e, t);
|
|
130
|
+
if (p) {
|
|
131
|
+
var n = Object.getOwnPropertyDescriptor(p, t);
|
|
132
|
+
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
|
133
|
+
}
|
|
134
|
+
}, _get.apply(null, arguments);
|
|
135
|
+
}
|
|
127
136
|
function _getPrototypeOf(t) {
|
|
128
137
|
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
129
138
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
@@ -294,6 +303,16 @@ function _setPrototypeOf(t, e) {
|
|
|
294
303
|
return t.__proto__ = e, t;
|
|
295
304
|
}, _setPrototypeOf(t, e);
|
|
296
305
|
}
|
|
306
|
+
function _superPropBase(t, o) {
|
|
307
|
+
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
|
308
|
+
return t;
|
|
309
|
+
}
|
|
310
|
+
function _superPropGet(t, o, e, r) {
|
|
311
|
+
var p = _get(_getPrototypeOf(t.prototype ), o, e);
|
|
312
|
+
return "function" == typeof p ? function (t) {
|
|
313
|
+
return p.apply(e, t);
|
|
314
|
+
} : p;
|
|
315
|
+
}
|
|
297
316
|
function _toConsumableArray(r) {
|
|
298
317
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
299
318
|
}
|
|
@@ -1219,17 +1238,18 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1219
1238
|
value: function () {
|
|
1220
1239
|
var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(options) {
|
|
1221
1240
|
var _this2 = this;
|
|
1222
|
-
var tx, chain, destination, address,
|
|
1241
|
+
var tx, chain, destination, address, bypassOptions, version, _options$useRootOrigi, useRootOrigin, feeAsset, basePayload, resolvedTx, performDryRunCall, getExecutionSuccessFromResult, findFailureObjectFromResult, extractFailureReasonFromResult, result, message, isSuccess, resolvedFeeAsset, _result2, failure, actualWeight, weight, forwardedXcms, destParaId, USE_XCM_PAYMENT_API_CHAINS, overriddenWeight, xcmFee, _yield$this$getPaymen, executionFee, fee, _t3, _t4, _t5;
|
|
1223
1242
|
return _regenerator().w(function (_context10) {
|
|
1224
1243
|
while (1) switch (_context10.p = _context10.n) {
|
|
1225
1244
|
case 0:
|
|
1226
|
-
tx = options.tx, chain = options.chain, destination = options.destination, address = options.address,
|
|
1245
|
+
tx = options.tx, chain = options.chain, destination = options.destination, address = options.address, bypassOptions = options.bypassOptions, version = options.version, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi;
|
|
1227
1246
|
if (this.hasDryRunSupport(chain)) {
|
|
1228
1247
|
_context10.n = 1;
|
|
1229
1248
|
break;
|
|
1230
1249
|
}
|
|
1231
1250
|
throw new RuntimeApiUnavailableError(chain, 'DryRunApi');
|
|
1232
1251
|
case 1:
|
|
1252
|
+
feeAsset = this.getMethod(tx) === 'execute' ? options.feeAsset : undefined;
|
|
1233
1253
|
basePayload = {
|
|
1234
1254
|
type: 'system',
|
|
1235
1255
|
value: useRootOrigin ? {
|
|
@@ -1339,7 +1359,9 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1339
1359
|
case 10:
|
|
1340
1360
|
isSuccess = getExecutionSuccessFromResult(result);
|
|
1341
1361
|
_context10.n = 11;
|
|
1342
|
-
return this.resolveFeeAsset(options)
|
|
1362
|
+
return this.resolveFeeAsset(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
1363
|
+
feeAsset: feeAsset
|
|
1364
|
+
}));
|
|
1343
1365
|
case 11:
|
|
1344
1366
|
resolvedFeeAsset = _context10.v;
|
|
1345
1367
|
if (isSuccess) {
|
|
@@ -1790,6 +1812,22 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1790
1812
|
}
|
|
1791
1813
|
return getDryRunXcm;
|
|
1792
1814
|
}()
|
|
1815
|
+
}, {
|
|
1816
|
+
key: "createBridgedForwardedXcms",
|
|
1817
|
+
value: function createBridgedForwardedXcms(forwardedXcm, params) {
|
|
1818
|
+
var version = forwardedXcm.type;
|
|
1819
|
+
var exportMessage = forwardedXcm.value.find(function (instruction) {
|
|
1820
|
+
return instruction.type === 'ExportMessage';
|
|
1821
|
+
});
|
|
1822
|
+
if (!exportMessage) {
|
|
1823
|
+
throw new RoutingResolutionError('ExportMessage instruction not found in the forwarded XCM');
|
|
1824
|
+
}
|
|
1825
|
+
var destination = addXcmVersionHeader(params.destination, version);
|
|
1826
|
+
return [_transform(destination), [{
|
|
1827
|
+
type: version,
|
|
1828
|
+
value: [].concat(_toConsumableArray(_transform(createBridgedXcmPrefix(version, params))), _toConsumableArray(exportMessage.value.xcm))
|
|
1829
|
+
}]];
|
|
1830
|
+
}
|
|
1793
1831
|
}, {
|
|
1794
1832
|
key: "getBridgeStatus",
|
|
1795
1833
|
value: function () {
|
|
@@ -1884,8 +1922,20 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1884
1922
|
releaseClient(key);
|
|
1885
1923
|
}
|
|
1886
1924
|
}
|
|
1925
|
+
if (force || _typeof(api) !== 'object' || Array.isArray(api)) {
|
|
1926
|
+
this.resetChain();
|
|
1927
|
+
}
|
|
1887
1928
|
return Promise.resolve();
|
|
1888
1929
|
}
|
|
1930
|
+
}, {
|
|
1931
|
+
key: "resetChain",
|
|
1932
|
+
value: function resetChain() {
|
|
1933
|
+
this._untypedApi = undefined;
|
|
1934
|
+
this._ahpApi = undefined;
|
|
1935
|
+
this._bridgeHubApi = undefined;
|
|
1936
|
+
this._hydrationApi = undefined;
|
|
1937
|
+
_superPropGet(PapiApi, "resetChain", this)([]);
|
|
1938
|
+
}
|
|
1889
1939
|
}, {
|
|
1890
1940
|
key: "deriveAddress",
|
|
1891
1941
|
value: function deriveAddress$1(sender) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.6",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@noble/hashes": "^2.3.0",
|
|
26
|
-
"@paraspell/sdk-core": "14.3.
|
|
26
|
+
"@paraspell/sdk-core": "14.3.6",
|
|
27
27
|
"@polkadot-api/signers-common": "^0.3.0",
|
|
28
28
|
"@polkadot-api/substrate-bindings": "^0.21.0",
|
|
29
29
|
"@polkadot-labs/hdkd": "^0.0.31",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"viem": "^2.55.19"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@paraspell/descriptors": "14.3.
|
|
34
|
+
"@paraspell/descriptors": "14.3.6",
|
|
35
35
|
"polkadot-api": ">= 3 < 4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|