@paraspell/sdk 13.8.0 → 13.10.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 +26 -11
- package/package.json +8 -8
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, findNativeAssetInfoOrThrowImpl, isCustomChain, getChainProvidersImpl, PolkadotApi, Parents, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, replaceBigInt, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, RuntimeApiError, localizeLocation,
|
|
1
|
+
import { getNativeAssetSymbol, getOtherAssets, isSenderSigner, getEvmPrivateKeyHex, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, InvalidAddressError, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, isCustomChain, getChainProvidersImpl, PolkadotApi, Parents, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, replaceBigInt, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, RuntimeApiError, localizeLocation, isAssetEqual, createAssetId, addXcmVersionHeader, RELAY_LOCATION, getRelayChainOfImpl, isRelayChain, padValueBy, SubmitTransactionError, createChainClient as createChainClient$1, getBalance as getBalance$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, 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';
|
|
@@ -750,13 +750,23 @@ var extractDryRunXcmFailureReason = function extractDryRunXcmFailureReason(resul
|
|
|
750
750
|
var executionResult = result === null || result === void 0 || (_result$value = result.value) === null || _result$value === void 0 ? void 0 : _result$value.execution_result;
|
|
751
751
|
var error = executionResult === null || executionResult === void 0 || (_executionResult$valu = executionResult.value) === null || _executionResult$valu === void 0 ? void 0 : _executionResult$valu.error;
|
|
752
752
|
var failureType = (_ref2 = (_ref3 = (_ref4 = (_error$error$type = error === null || error === void 0 || (_error$error = error.error) === null || _error$error === void 0 ? void 0 : _error$error.type) !== null && _error$error$type !== void 0 ? _error$error$type : error === null || error === void 0 || (_error$value = error.value) === null || _error$value === void 0 || (_error$value = _error$value.error) === null || _error$value === void 0 ? void 0 : _error$value.type) !== null && _ref4 !== void 0 ? _ref4 : error === null || error === void 0 || (_error$value2 = error.value) === null || _error$value2 === void 0 || (_error$value2 = _error$value2.value) === null || _error$value2 === void 0 ? void 0 : _error$value2.type) !== null && _ref3 !== void 0 ? _ref3 : error === null || error === void 0 || (_error$value3 = error.value) === null || _error$value3 === void 0 ? void 0 : _error$value3.type) !== null && _ref2 !== void 0 ? _ref2 : error === null || error === void 0 ? void 0 : error.type;
|
|
753
|
+
var failureIndex = typeof (error === null || error === void 0 ? void 0 : error.index) === 'number' ? error.index : undefined;
|
|
753
754
|
if (typeof failureType === 'string') {
|
|
754
|
-
return
|
|
755
|
+
return {
|
|
756
|
+
failureReason: failureType,
|
|
757
|
+
failureIndex: failureIndex
|
|
758
|
+
};
|
|
755
759
|
}
|
|
756
760
|
if (typeof (executionResult === null || executionResult === void 0 ? void 0 : executionResult.type) === 'string') {
|
|
757
|
-
return
|
|
761
|
+
return {
|
|
762
|
+
failureReason: executionResult.type,
|
|
763
|
+
failureIndex: failureIndex
|
|
764
|
+
};
|
|
758
765
|
}
|
|
759
|
-
return
|
|
766
|
+
return {
|
|
767
|
+
failureReason: JSON.stringify((_ref5 = (_result$value2 = result === null || result === void 0 ? void 0 : result.value) !== null && _result$value2 !== void 0 ? _result$value2 : result) !== null && _ref5 !== void 0 ? _ref5 : 'Unknown error structure', replaceBigInt),
|
|
768
|
+
failureIndex: failureIndex
|
|
769
|
+
};
|
|
760
770
|
};
|
|
761
771
|
var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
762
772
|
function PapiApi() {
|
|
@@ -1274,17 +1284,20 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1274
1284
|
return result;
|
|
1275
1285
|
};
|
|
1276
1286
|
extractFailureReasonFromResult = function extractFailureReasonFromResult(result) {
|
|
1277
|
-
var _obj$value, _ref10, _result$value6;
|
|
1287
|
+
var _obj$value, _obj$value2, _ref10, _result$value6;
|
|
1278
1288
|
var obj = findFailureObjectFromResult(result);
|
|
1279
|
-
|
|
1289
|
+
var failureIndex = typeof (obj === null || obj === void 0 || (_obj$value = obj.value) === null || _obj$value === void 0 ? void 0 : _obj$value.index) === 'number' ? obj.value.index : undefined;
|
|
1290
|
+
if (obj !== null && obj !== void 0 && obj.type && obj !== null && obj !== void 0 && (_obj$value2 = obj.value) !== null && _obj$value2 !== void 0 && (_obj$value2 = _obj$value2.error) !== null && _obj$value2 !== void 0 && _obj$value2.type) {
|
|
1280
1291
|
return {
|
|
1281
1292
|
failureReason: obj.type,
|
|
1282
|
-
failureSubReason: obj.value.error.type
|
|
1293
|
+
failureSubReason: obj.value.error.type,
|
|
1294
|
+
failureIndex: failureIndex
|
|
1283
1295
|
};
|
|
1284
1296
|
}
|
|
1285
1297
|
if (obj !== null && obj !== void 0 && obj.type) {
|
|
1286
1298
|
return {
|
|
1287
|
-
failureReason: obj.type
|
|
1299
|
+
failureReason: obj.type,
|
|
1300
|
+
failureIndex: failureIndex
|
|
1288
1301
|
};
|
|
1289
1302
|
}
|
|
1290
1303
|
return {
|
|
@@ -1329,6 +1342,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1329
1342
|
success: false,
|
|
1330
1343
|
failureReason: failureOutputReason.failureReason,
|
|
1331
1344
|
failureSubReason: failureOutputReason.failureSubReason,
|
|
1345
|
+
failureIndex: failureOutputReason.failureIndex,
|
|
1332
1346
|
asset: resolvedFeeAsset.asset
|
|
1333
1347
|
}));
|
|
1334
1348
|
case 12:
|
|
@@ -1485,7 +1499,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1485
1499
|
case 7:
|
|
1486
1500
|
deliveryFeeResolved = ((_deliveryFeeRes2 = deliveryFeeRes) === null || _deliveryFeeRes2 === void 0 || (_deliveryFeeRes2 = _deliveryFeeRes2.value) === null || _deliveryFeeRes2 === void 0 ? void 0 : _deliveryFeeRes2.value.length) > 0 ? (_deliveryFeeRes3 = deliveryFeeRes) === null || _deliveryFeeRes3 === void 0 || (_deliveryFeeRes3 = _deliveryFeeRes3.value) === null || _deliveryFeeRes3 === void 0 ? void 0 : _deliveryFeeRes3.value[0].fun.value : 0n;
|
|
1487
1501
|
nativeAsset = findNativeAssetInfoOrThrowImpl(chain, this._customCtx);
|
|
1488
|
-
if (!(
|
|
1502
|
+
if (!(isAssetEqual(asset, nativeAsset) || usedThirdParam)) {
|
|
1489
1503
|
_context12.n = 8;
|
|
1490
1504
|
break;
|
|
1491
1505
|
}
|
|
@@ -1678,7 +1692,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1678
1692
|
value: function () {
|
|
1679
1693
|
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(_ref12) {
|
|
1680
1694
|
var _ref13, _processAssetsDeposit, _ref14, _ref15, _ref16, _ref17, _ref18;
|
|
1681
|
-
var originLocation, xcm, chain, origin, asset, feeAsset, originFee, amount, version, transformedOriginLocation, result, isSuccess, failureReason, execResult, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, feeEventValue, fee, processedFee;
|
|
1695
|
+
var originLocation, xcm, chain, origin, asset, feeAsset, originFee, amount, version, transformedOriginLocation, result, isSuccess, _extractDryRunXcmFail, failureReason, failureIndex, execResult, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, feeEventValue, fee, processedFee;
|
|
1682
1696
|
return _regenerator().w(function (_context16) {
|
|
1683
1697
|
while (1) switch (_context16.n) {
|
|
1684
1698
|
case 0:
|
|
@@ -1699,10 +1713,11 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1699
1713
|
_context16.n = 3;
|
|
1700
1714
|
break;
|
|
1701
1715
|
}
|
|
1702
|
-
|
|
1716
|
+
_extractDryRunXcmFail = extractDryRunXcmFailureReason(result), failureReason = _extractDryRunXcmFail.failureReason, failureIndex = _extractDryRunXcmFail.failureIndex;
|
|
1703
1717
|
return _context16.a(2, {
|
|
1704
1718
|
success: false,
|
|
1705
1719
|
failureReason: failureReason,
|
|
1720
|
+
failureIndex: failureIndex,
|
|
1706
1721
|
asset: asset
|
|
1707
1722
|
});
|
|
1708
1723
|
case 3:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.0",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,26 +26,26 @@
|
|
|
26
26
|
"@polkadot-api/substrate-bindings": "^0.20.3",
|
|
27
27
|
"@polkadot-labs/hdkd": "^0.0.28",
|
|
28
28
|
"@polkadot-labs/hdkd-helpers": "^0.0.30",
|
|
29
|
-
"viem": "^2.
|
|
30
|
-
"@paraspell/sdk-core": "13.
|
|
29
|
+
"viem": "^2.53.1",
|
|
30
|
+
"@paraspell/sdk-core": "13.10.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"polkadot-api": "
|
|
33
|
+
"polkadot-api": "2.1.7"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@acala-network/chopsticks": "^1.
|
|
36
|
+
"@acala-network/chopsticks": "^1.5.0",
|
|
37
37
|
"@babel/plugin-syntax-import-attributes": "^7.29.7",
|
|
38
38
|
"@babel/preset-env": "^7.29.7",
|
|
39
39
|
"@codecov/rollup-plugin": "^2.0.1",
|
|
40
40
|
"@noble/curves": "^2.2.0",
|
|
41
|
-
"@rollup/plugin-babel": "^7.
|
|
41
|
+
"@rollup/plugin-babel": "^7.1.0",
|
|
42
42
|
"@rollup/plugin-json": "^6.1.0",
|
|
43
43
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
44
44
|
"@scure/bip32": "^2.2.0",
|
|
45
45
|
"@scure/bip39": "^2.2.0",
|
|
46
|
-
"@vitest/coverage-v8": "^4.1.
|
|
46
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
47
47
|
"dotenv": "^17.4.2",
|
|
48
|
-
"rollup": "^4.
|
|
48
|
+
"rollup": "^4.62.2",
|
|
49
49
|
"rollup-plugin-dts": "^6.4.1"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|