@paraspell/sdk 13.8.0 → 13.9.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.
Files changed (2) hide show
  1. package/dist/index.mjs +24 -9
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -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 failureType;
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 executionResult.type;
761
+ return {
762
+ failureReason: executionResult.type,
763
+ failureIndex: failureIndex
764
+ };
758
765
  }
759
- return 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);
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
- if (obj !== null && obj !== void 0 && obj.type && obj !== null && obj !== void 0 && (_obj$value = obj.value) !== null && _obj$value !== void 0 && (_obj$value = _obj$value.error) !== null && _obj$value !== void 0 && _obj$value.type) {
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:
@@ -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
- failureReason = extractDryRunXcmFailureReason(result);
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.8.0",
3
+ "version": "13.9.0",
4
4
  "description": "SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "@polkadot-labs/hdkd": "^0.0.28",
28
28
  "@polkadot-labs/hdkd-helpers": "^0.0.30",
29
29
  "viem": "^2.51.3",
30
- "@paraspell/sdk-core": "13.8.0"
30
+ "@paraspell/sdk-core": "13.9.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "polkadot-api": ">= 2 < 3"