@paraspell/sdk-dedot 13.7.2 → 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 +20 -14
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { getEvmPrivateKeyHex, getNativeAssetSymbol, getOtherAssets, NumberFormat
2
2
  export * from '@paraspell/sdk-core';
3
3
  import { stringPascalCase, isEvmAddress, decodeAddress, isHex, u8aToHex, hexToU8a, stringToU8a, blake2AsHex } from 'dedot/utils';
4
4
  import { Keyring } from '@polkadot/keyring';
5
+ import { snakeToCamel, lowercaseFirstLetter } from '@paraspell/sdk-common';
5
6
  import { DedotClient, WsProvider } from 'dedot';
6
7
 
7
8
  function _arrayLikeToArray(r, a) {
@@ -427,15 +428,6 @@ var createKeyringPair = function createKeyringPair(path) {
427
428
  return evmPrivateKey ? keyring.createFromUri(evmPrivateKey, undefined, "ethereum") : keyring.addFromUri(path);
428
429
  };
429
430
 
430
- var lowercaseFirstLetter = function lowercaseFirstLetter(value) {
431
- return value.charAt(0).toLowerCase() + value.slice(1);
432
- };
433
- var snakeToCamel = function snakeToCamel(str) {
434
- return str.replace(/([-_][a-z])/g, function (group) {
435
- return group.toUpperCase().replace("-", "").replace("_", "");
436
- });
437
- };
438
-
439
431
  /* eslint-disable @typescript-eslint/no-explicit-any */
440
432
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
441
433
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
@@ -758,13 +750,23 @@ var extractDryRunXcmFailureReason = function extractDryRunXcmFailureReason(resul
758
750
  var executionResult = result === null || result === void 0 || (_result$value = result.value) === null || _result$value === void 0 ? void 0 : _result$value.executionResult;
759
751
  var error = executionResult === null || executionResult === void 0 || (_executionResult$valu = executionResult.value) === null || _executionResult$valu === void 0 ? void 0 : _executionResult$valu.error;
760
752
  var failureType = (_ref3 = (_ref4 = (_ref5 = (_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 && _ref5 !== void 0 ? _ref5 : 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 && _ref4 !== void 0 ? _ref4 : error === null || error === void 0 || (_error$value3 = error.value) === null || _error$value3 === void 0 ? void 0 : _error$value3.type) !== null && _ref3 !== void 0 ? _ref3 : 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;
761
754
  if (typeof failureType === "string") {
762
- return failureType;
755
+ return {
756
+ failureReason: failureType,
757
+ failureIndex: failureIndex
758
+ };
763
759
  }
764
760
  if (typeof (executionResult === null || executionResult === void 0 ? void 0 : executionResult.type) === "string") {
765
- return executionResult.type;
761
+ return {
762
+ failureReason: executionResult.type,
763
+ failureIndex: failureIndex
764
+ };
766
765
  }
767
- return JSON.stringify((_ref6 = (_result$value2 = result === null || result === void 0 ? void 0 : result.value) !== null && _result$value2 !== void 0 ? _result$value2 : result) !== null && _ref6 !== void 0 ? _ref6 : "Unknown error structure", replaceBigInt);
766
+ return {
767
+ failureReason: JSON.stringify((_ref6 = (_result$value2 = result === null || result === void 0 ? void 0 : result.value) !== null && _result$value2 !== void 0 ? _result$value2 : result) !== null && _ref6 !== void 0 ? _ref6 : "Unknown error structure", replaceBigInt),
768
+ failureIndex: failureIndex
769
+ };
768
770
  };
769
771
  var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
770
772
  function DedotApi() {
@@ -1259,6 +1261,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1259
1261
  success: false,
1260
1262
  failureReason: failureErr.failureReason,
1261
1263
  failureSubReason: failureErr.failureSubReason,
1264
+ failureIndex: failureErr.failureIndex,
1262
1265
  asset: resolvedFeeAsset.asset
1263
1266
  });
1264
1267
  case 14:
@@ -1270,6 +1273,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1270
1273
  success: false,
1271
1274
  failureReason: failureErr.failureReason || "Unknown error",
1272
1275
  failureSubReason: failureErr.failureSubReason,
1276
+ failureIndex: failureErr.failureIndex,
1273
1277
  asset: resolvedFeeAsset.asset
1274
1278
  });
1275
1279
  case 15:
@@ -1595,7 +1599,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1595
1599
  value: function () {
1596
1600
  var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(_ref10) {
1597
1601
  var _result$value5;
1598
- var originLocation, xcm, asset, chain, version, supportsDryRunApi, transformedOriginLocation, result, executionResult, isSuccess, actualWeight, weight, forwardedXcms, destParaId, fee;
1602
+ var originLocation, xcm, asset, chain, version, supportsDryRunApi, transformedOriginLocation, result, executionResult, isSuccess, _extractDryRunXcmFail, failureReason, failureIndex, actualWeight, weight, forwardedXcms, destParaId, fee;
1599
1603
  return _regenerator().w(function (_context11) {
1600
1604
  while (1) switch (_context11.n) {
1601
1605
  case 0:
@@ -1618,9 +1622,11 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
1618
1622
  _context11.n = 3;
1619
1623
  break;
1620
1624
  }
1625
+ _extractDryRunXcmFail = extractDryRunXcmFailureReason(result), failureReason = _extractDryRunXcmFail.failureReason, failureIndex = _extractDryRunXcmFail.failureIndex;
1621
1626
  return _context11.a(2, {
1622
1627
  success: false,
1623
- failureReason: extractDryRunXcmFailureReason(result),
1628
+ failureReason: failureReason,
1629
+ failureIndex: failureIndex,
1624
1630
  asset: asset
1625
1631
  });
1626
1632
  case 3:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-dedot",
3
- "version": "13.7.2",
3
+ "version": "13.9.0",
4
4
  "description": "Dedot-based SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,8 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@paraspell/sdk-core": "13.7.2"
25
+ "@paraspell/sdk-common": "13.9.0",
26
+ "@paraspell/sdk-core": "13.9.0"
26
27
  },
27
28
  "peerDependencies": {
28
29
  "dedot": ">= 1.3.0",
@@ -38,8 +39,7 @@
38
39
  "@vitest/coverage-v8": "^4.1.7",
39
40
  "dotenv": "^17.4.2",
40
41
  "rollup": "^4.60.4",
41
- "rollup-plugin-dts": "^6.4.1",
42
- "tslib": "^2.8.1"
42
+ "rollup-plugin-dts": "^6.4.1"
43
43
  },
44
44
  "scripts": {
45
45
  "compile": "tsc --noEmit",