@paraspell/sdk 13.10.0 → 13.11.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 +14 -12
  2. package/package.json +2 -2
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, 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';
1
+ import { getNativeAssetSymbol, getOtherAssets, isSenderSigner, getEvmPrivateKeyHex, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, InvalidAddressError, BatchMode, isConfig, isCustomChain, PolkadotApi, Parents, getFailingInstruction, replaceBigInt, RuntimeApiUnavailableError, wrapTxBypass, RuntimeApiError, localizeLocation, isAssetEqual, createAssetId, addXcmVersionHeader, RELAY_LOCATION, 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';
@@ -1158,7 +1158,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1158
1158
  value: function resolveDefaultFeeAsset(_ref1) {
1159
1159
  var chain = _ref1.chain,
1160
1160
  feeAsset = _ref1.feeAsset;
1161
- return feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrowImpl(chain, this._customCtx);
1161
+ return feeAsset !== null && feeAsset !== void 0 ? feeAsset : this.findNativeAssetInfoOrThrow(chain);
1162
1162
  }
1163
1163
  }, {
1164
1164
  key: "resolveFeeAsset",
@@ -1193,9 +1193,9 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1193
1193
  case 3:
1194
1194
  return _context1.a(2, {
1195
1195
  isCustomAsset: true,
1196
- asset: findAssetInfoOrThrowImpl(chain, {
1196
+ asset: this.findAssetInfoOrThrow(chain, {
1197
1197
  id: assetId
1198
- }, undefined, this._customCtx)
1198
+ })
1199
1199
  });
1200
1200
  }
1201
1201
  }, _callee1, this);
@@ -1210,12 +1210,12 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1210
1210
  value: function () {
1211
1211
  var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(options) {
1212
1212
  var _this2 = this;
1213
- var tx, chain, destination, address, feeAsset, bypassOptions, version, _options$useRootOrigi, useRootOrigin, basePayload, resolvedTx, performDryRunCall, getExecutionSuccessFromResult, findFailureObjectFromResult, extractFailureReasonFromResult, result, message, isSuccess, resolvedFeeAsset, failureOutputReason, actualWeight, weight, forwardedXcms, destParaId, USE_XCM_PAYMENT_API_CHAINS, overriddenWeight, xcmFee, _yield$this$getPaymen, executionFee, fee, _t3, _t4, _t5;
1213
+ var tx, chain, destination, address, feeAsset, bypassOptions, version, _options$useRootOrigi, useRootOrigin, basePayload, resolvedTx, performDryRunCall, getExecutionSuccessFromResult, findFailureObjectFromResult, extractFailureReasonFromResult, result, message, isSuccess, resolvedFeeAsset, _result2, failureOutputReason, actualWeight, weight, forwardedXcms, destParaId, USE_XCM_PAYMENT_API_CHAINS, overriddenWeight, xcmFee, _yield$this$getPaymen, executionFee, fee, _t3, _t4, _t5;
1214
1214
  return _regenerator().w(function (_context10) {
1215
1215
  while (1) switch (_context10.p = _context10.n) {
1216
1216
  case 0:
1217
1217
  tx = options.tx, chain = options.chain, destination = options.destination, address = options.address, feeAsset = options.feeAsset, bypassOptions = options.bypassOptions, version = options.version, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi;
1218
- if (hasDryRunSupportImpl(chain, this._customCtx)) {
1218
+ if (this.hasDryRunSupport(chain)) {
1219
1219
  _context10.n = 1;
1220
1220
  break;
1221
1221
  }
@@ -1343,6 +1343,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1343
1343
  failureReason: failureOutputReason.failureReason,
1344
1344
  failureSubReason: failureOutputReason.failureSubReason,
1345
1345
  failureIndex: failureOutputReason.failureIndex,
1346
+ failureInstruction: getFailingInstruction((_result2 = result) === null || _result2 === void 0 || (_result2 = _result2.value) === null || _result2 === void 0 ? void 0 : _result2.local_xcm, failureOutputReason.failureIndex),
1346
1347
  asset: resolvedFeeAsset.asset
1347
1348
  }));
1348
1349
  case 12:
@@ -1354,7 +1355,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1354
1355
  forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
1355
1356
  destParaId = extractDestParaId(forwardedXcms);
1356
1357
  USE_XCM_PAYMENT_API_CHAINS = ['Astar'];
1357
- if (!(hasXcmPaymentApiSupportImpl(chain, this._customCtx) && result.value.local_xcm && (feeAsset || USE_XCM_PAYMENT_API_CHAINS.includes(chain) || chain.startsWith('AssetHub') && destination === 'Ethereum') || resolvedFeeAsset.isCustomAsset)) {
1358
+ if (!(this.hasXcmPaymentApiSupport(chain) && result.value.local_xcm && (feeAsset || USE_XCM_PAYMENT_API_CHAINS.includes(chain) || chain.startsWith('AssetHub') && destination === 'Ethereum') || resolvedFeeAsset.isCustomAsset)) {
1358
1359
  _context10.n = 18;
1359
1360
  break;
1360
1361
  }
@@ -1498,7 +1499,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1498
1499
  return _context12.a(2, 0n);
1499
1500
  case 7:
1500
1501
  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;
1501
- nativeAsset = findNativeAssetInfoOrThrowImpl(chain, this._customCtx);
1502
+ nativeAsset = this.findNativeAssetInfoOrThrow(chain);
1502
1503
  if (!(isAssetEqual(asset, nativeAsset) || usedThirdParam)) {
1503
1504
  _context12.n = 8;
1504
1505
  break;
@@ -1659,7 +1660,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1659
1660
  return _context15.a(2, undefined);
1660
1661
  case 2:
1661
1662
  ahApi = this.clone();
1662
- assetHubChain = "AssetHub".concat(getRelayChainOfImpl(this, chain));
1663
+ assetHubChain = "AssetHub".concat(this.getRelayChainOf(chain));
1663
1664
  _context15.n = 3;
1664
1665
  return ahApi.init(assetHubChain);
1665
1666
  case 3:
@@ -1697,7 +1698,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1697
1698
  while (1) switch (_context16.n) {
1698
1699
  case 0:
1699
1700
  originLocation = _ref12.originLocation, xcm = _ref12.xcm, chain = _ref12.chain, origin = _ref12.origin, asset = _ref12.asset, feeAsset = _ref12.feeAsset, originFee = _ref12.originFee, amount = _ref12.amount, version = _ref12.version;
1700
- if (hasDryRunSupportImpl(chain, this._customCtx)) {
1701
+ if (this.hasDryRunSupport(chain)) {
1701
1702
  _context16.n = 1;
1702
1703
  break;
1703
1704
  }
@@ -1718,6 +1719,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1718
1719
  success: false,
1719
1720
  failureReason: failureReason,
1720
1721
  failureIndex: failureIndex,
1722
+ failureInstruction: getFailingInstruction(xcm, failureIndex),
1721
1723
  asset: asset
1722
1724
  });
1723
1725
  case 3:
@@ -1728,7 +1730,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1728
1730
  } : undefined;
1729
1731
  forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
1730
1732
  destParaId = extractDestParaId(forwardedXcms);
1731
- if (!(hasXcmPaymentApiSupportImpl(chain, this._customCtx) && asset)) {
1733
+ if (!(this.hasXcmPaymentApiSupport(chain) && asset)) {
1732
1734
  _context16.n = 5;
1733
1735
  break;
1734
1736
  }
@@ -1903,7 +1905,7 @@ var PapiApi = /*#__PURE__*/function (_PolkadotApi) {
1903
1905
  if (force) {
1904
1906
  this.api.destroy();
1905
1907
  } else {
1906
- var key = api === undefined ? getChainProvidersImpl(chain, this._customCtx) : api;
1908
+ var key = api === undefined ? this.getChainProviders(chain) : api;
1907
1909
  releaseClient(key);
1908
1910
  }
1909
1911
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "13.10.0",
3
+ "version": "13.11.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.53.1",
30
- "@paraspell/sdk-core": "13.10.0"
30
+ "@paraspell/sdk-core": "13.11.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "polkadot-api": "2.1.7"