@paraspell/sdk-pjs 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 +8 -11
  2. package/package.json +4 -5
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { getNativeAssetSymbol, getOtherAssets, hasJunction, getJunctionValue, getEvmPrivateKeyHex, UnsupportedOperationError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, isCustomChain, getChainProvidersImpl, isSenderSigner, PolkadotApi, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, resolveModuleError, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, normalizeLocation, localizeLocation, createAssetId, addXcmVersionHeader, isAssetXcEqual, RELAY_LOCATION, getRelayChainOfImpl, 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, findAssetInfoOrThrow, assertHasId, getParaId, RoutingResolutionError, abstractDecimals, MissingParameterError, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress as validateAddress$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 { Keyring, WsProvider, ApiPromise } from '@polkadot/api';
4
+ import { snakeToCamel, lowercaseFirstLetter } from '@paraspell/sdk-common';
4
5
  import { u8aConcat, compactToU8a, u8aEq, isHex, u8aToHex, hexToU8a, stringToU8a } from '@polkadot/util';
5
6
  import { decodeAddress, blake2AsHex, validateAddress } from '@polkadot/util-crypto';
6
7
  import { WETH9__factory } from '@snowbridge/contract-types';
@@ -393,15 +394,6 @@ var createKeyringPair = function createKeyringPair(path) {
393
394
  return evmPrivateKey ? keyring.createFromUri(evmPrivateKey, undefined, 'ethereum') : keyring.addFromUri(path);
394
395
  };
395
396
 
396
- var lowercaseFirstLetter = function lowercaseFirstLetter(value) {
397
- return value.charAt(0).toLowerCase() + value.slice(1);
398
- };
399
- var snakeToCamel = function snakeToCamel(str) {
400
- return str.toLowerCase().replace(/([-_][a-z])/g, function (group) {
401
- return group.toUpperCase().replace('-', '').replace('_', '');
402
- });
403
- };
404
-
405
397
  var txFromHex = function txFromHex(api, hex) {
406
398
  var _api$tx$section;
407
399
  // Try as full extrinsic
@@ -1020,6 +1012,7 @@ var PolkadotJsApi = /*#__PURE__*/function (_PolkadotApi) {
1020
1012
  success: false,
1021
1013
  failureReason: failureErr.failureReason,
1022
1014
  failureSubReason: failureErr.failureSubReason,
1015
+ failureIndex: failureErr.failureIndex,
1023
1016
  asset: resolvedFeeAsset.asset
1024
1017
  });
1025
1018
  case 14:
@@ -1031,6 +1024,7 @@ var PolkadotJsApi = /*#__PURE__*/function (_PolkadotApi) {
1031
1024
  success: false,
1032
1025
  failureReason: failureErr.failureReason || 'Unknown error',
1033
1026
  failureSubReason: failureErr.failureSubReason,
1027
+ failureIndex: failureErr.failureIndex,
1034
1028
  asset: resolvedFeeAsset.asset
1035
1029
  });
1036
1030
  case 15:
@@ -1325,7 +1319,7 @@ var PolkadotJsApi = /*#__PURE__*/function (_PolkadotApi) {
1325
1319
  value: function () {
1326
1320
  var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13(_ref1) {
1327
1321
  var _ref11, _ref12, _ref13;
1328
- var originLocation, xcm, asset, chain, version, origin, supportsDryRunApi, response, result, resultJson, isSuccess, _result$Ok, _execRes$Incomplete$e, _execRes$Incomplete, _execRes$Error, execRes, error, failureReason, forwardedXcms, actualWeight, weight, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee;
1322
+ var originLocation, xcm, asset, chain, version, origin, supportsDryRunApi, response, result, resultJson, isSuccess, _result$Ok, _execRes$Incomplete$e, _execRes$Incomplete, _execRes$Error, execRes, error, isInstructionError, failureReason, failureIndex, forwardedXcms, actualWeight, weight, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee;
1329
1323
  return _regenerator().w(function (_context13) {
1330
1324
  while (1) switch (_context13.n) {
1331
1325
  case 0:
@@ -1350,10 +1344,13 @@ var PolkadotJsApi = /*#__PURE__*/function (_PolkadotApi) {
1350
1344
  }
1351
1345
  execRes = (_result$Ok = result.Ok) === null || _result$Ok === void 0 ? void 0 : _result$Ok.executionResult;
1352
1346
  error = (_execRes$Incomplete$e = execRes === null || execRes === void 0 || (_execRes$Incomplete = execRes.Incomplete) === null || _execRes$Incomplete === void 0 ? void 0 : _execRes$Incomplete.error) !== null && _execRes$Incomplete$e !== void 0 ? _execRes$Incomplete$e : execRes === null || execRes === void 0 || (_execRes$Error = execRes.Error) === null || _execRes$Error === void 0 ? void 0 : _execRes$Error.error;
1353
- failureReason = typeof error === 'string' ? error : error.error;
1347
+ isInstructionError = typeof error !== 'string';
1348
+ failureReason = isInstructionError ? error.error : error;
1349
+ failureIndex = isInstructionError && (error === null || error === void 0 ? void 0 : error.index) != null ? Number(error.index) : undefined;
1354
1350
  return _context13.a(2, {
1355
1351
  success: false,
1356
1352
  failureReason: failureReason,
1353
+ failureIndex: failureIndex,
1357
1354
  asset: asset
1358
1355
  });
1359
1356
  case 3:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-pjs",
3
- "version": "13.7.2",
3
+ "version": "13.9.0",
4
4
  "description": "Polkadot.js based SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,7 +29,8 @@
29
29
  "@snowbridge/registry": "^1.1.6",
30
30
  "ethers": "^6.16.0",
31
31
  "viem": "^2.51.3",
32
- "@paraspell/sdk-core": "13.7.2"
32
+ "@paraspell/sdk-common": "13.9.0",
33
+ "@paraspell/sdk-core": "13.9.0"
33
34
  },
34
35
  "peerDependencies": {
35
36
  "@polkadot/api": ">= 16.0 < 17",
@@ -46,11 +47,9 @@
46
47
  "@rollup/plugin-json": "^6.1.0",
47
48
  "@rollup/plugin-typescript": "^12.3.0",
48
49
  "@vitest/coverage-v8": "^4.1.7",
49
- "axios": "^1.16.1",
50
50
  "dotenv": "^17.4.2",
51
51
  "rollup": "^4.60.4",
52
- "rollup-plugin-dts": "^6.4.1",
53
- "tslib": "^2.8.1"
52
+ "rollup-plugin-dts": "^6.4.1"
54
53
  },
55
54
  "scripts": {
56
55
  "compile": "tsc --noEmit",