@paraspell/sdk-pjs 10.11.9 → 11.0.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 CHANGED
@@ -1,4 +1,4 @@
1
- import { isConfig, BatchMode, MissingChainApiError, createApiInstanceForNode as createApiInstanceForNode$1, getNode, isForeignAsset, InvalidParameterError, computeFeeFromDryRunPjs, resolveModuleError, getAssetsObject, NodeNotSupportedError, assertHasLocation, localizeLocation, isRelayChain, addXcmVersionHeader, Version, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, convertSs58 as convertSs58$1, getParaId, ETH_CHAIN_ID, InvalidCurrencyError, isOverrideMultiLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
1
+ import { isConfig, BatchMode, MissingChainApiError, createChainClient as createChainClient$1, getChain, isForeignAsset, InvalidParameterError, computeFeeFromDryRunPjs, resolveModuleError, getAssetsObject, ChainNotSupportedError, assertHasLocation, localizeLocation, isRelayChain, addXcmVersionHeader, Version, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, getParaId, ETH_CHAIN_ID, findAssetInfoOrThrow, abstractDecimals, assertHasId, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
2
2
  export * from '@paraspell/sdk-core';
3
3
  import { WsProvider, ApiPromise } from '@polkadot/api';
4
4
  import { u32 } from '@polkadot/types';
@@ -305,7 +305,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
305
305
  }
306
306
  return _context.a(2);
307
307
  case 1:
308
- this._node = chain;
308
+ this._chain = chain;
309
309
  apiConfig = this.getApiConfigForChain(chain);
310
310
  if (!(isConfig(this._config) && this._config.development && !apiConfig)) {
311
311
  _context.n = 2;
@@ -348,7 +348,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
348
348
  _context2.n = 1;
349
349
  break;
350
350
  }
351
- return _context2.a(2, createApiInstanceForNode$1(this, chain));
351
+ return _context2.a(2, createChainClient$1(this, chain));
352
352
  case 1:
353
353
  if (!(typeof apiConfig === 'string' || apiConfig instanceof Array)) {
354
354
  _context2.n = 2;
@@ -546,13 +546,13 @@ var PolkadotJsApi = /*#__PURE__*/function () {
546
546
  }, {
547
547
  key: "getBalanceForeignAssetsPallet",
548
548
  value: function () {
549
- var _getBalanceForeignAssetsPallet = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(address, multiLocation) {
549
+ var _getBalanceForeignAssetsPallet = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(address, location) {
550
550
  var response, obj;
551
551
  return _regenerator().w(function (_context9) {
552
552
  while (1) switch (_context9.n) {
553
553
  case 0:
554
554
  _context9.n = 1;
555
- return this.api.query.foreignAssets.account(multiLocation, address);
555
+ return this.api.query.foreignAssets.account(location, address);
556
556
  case 1:
557
557
  response = _context9.v;
558
558
  obj = response.toJSON();
@@ -595,7 +595,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
595
595
  return _regenerator().w(function (_context1) {
596
596
  while (1) switch (_context1.n) {
597
597
  case 0:
598
- currencySelection = getNode('BifrostPolkadot').getCurrencySelection(asset);
598
+ currencySelection = getChain('BifrostPolkadot').getCurrencySelection(asset);
599
599
  _context1.n = 1;
600
600
  return this.api.query.tokens.accounts(address, currencySelection);
601
601
  case 1:
@@ -637,13 +637,13 @@ var PolkadotJsApi = /*#__PURE__*/function () {
637
637
  }, {
638
638
  key: "getBalanceForeignXTokens",
639
639
  value: function () {
640
- var _getBalanceForeignXTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(node, address, asset) {
640
+ var _getBalanceForeignXTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(chain, address, asset) {
641
641
  var pallet, response, entry, accountData;
642
642
  return _regenerator().w(function (_context11) {
643
643
  while (1) switch (_context11.n) {
644
644
  case 0:
645
645
  pallet = 'tokens';
646
- if (node === 'Centrifuge' || node === 'Altair') {
646
+ if (chain === 'Centrifuge' || chain === 'Altair') {
647
647
  pallet = 'ormlTokens';
648
648
  }
649
649
  _context11.n = 1;
@@ -736,45 +736,45 @@ var PolkadotJsApi = /*#__PURE__*/function () {
736
736
  return new PolkadotJsApi(isConfig(this._config) ? this._config : undefined);
737
737
  }
738
738
  }, {
739
- key: "createApiForNode",
739
+ key: "createApiForChain",
740
740
  value: function () {
741
- var _createApiForNode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(node) {
741
+ var _createApiForChain = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(chain) {
742
742
  var api;
743
743
  return _regenerator().w(function (_context14) {
744
744
  while (1) switch (_context14.n) {
745
745
  case 0:
746
746
  api = new PolkadotJsApi();
747
747
  _context14.n = 1;
748
- return api.init(node);
748
+ return api.init(chain);
749
749
  case 1:
750
750
  return _context14.a(2, api);
751
751
  }
752
752
  }, _callee14);
753
753
  }));
754
- function createApiForNode(_x29) {
755
- return _createApiForNode.apply(this, arguments);
754
+ function createApiForChain(_x29) {
755
+ return _createApiForChain.apply(this, arguments);
756
756
  }
757
- return createApiForNode;
757
+ return createApiForChain;
758
758
  }()
759
759
  }, {
760
760
  key: "getDryRunCall",
761
761
  value: function () {
762
762
  var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(_ref4) {
763
763
  var _this$api$call$dryRun;
764
- var tx, address, node, supportsDryRunApi, nodesRequiringVersionParam, needsVersionParam, DEFAULT_XCM_VERSION, response, result, resultJson, isSuccess, moduleError, failureReason, executionFee, fee, actualWeight, weight, forwardedXcms, destParaId;
764
+ var tx, address, chain, supportsDryRunApi, chainsRequiringVersionParam, needsVersionParam, DEFAULT_XCM_VERSION, response, result, resultJson, isSuccess, moduleError, failureReason, executionFee, fee, actualWeight, weight, forwardedXcms, destParaId;
765
765
  return _regenerator().w(function (_context15) {
766
766
  while (1) switch (_context15.n) {
767
767
  case 0:
768
- tx = _ref4.tx, address = _ref4.address, node = _ref4.node;
769
- supportsDryRunApi = getAssetsObject(node).supportsDryRunApi;
768
+ tx = _ref4.tx, address = _ref4.address, chain = _ref4.chain;
769
+ supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
770
770
  if (supportsDryRunApi) {
771
771
  _context15.n = 1;
772
772
  break;
773
773
  }
774
- throw new NodeNotSupportedError("DryRunApi is not available on node ".concat(node));
774
+ throw new ChainNotSupportedError("DryRunApi is not available on chain ".concat(chain));
775
775
  case 1:
776
- nodesRequiringVersionParam = ['BifrostPolkadot', 'BifrostKusama', 'AssetHubKusama', 'AssetHubPolkadot', 'Kusama', 'Polkadot', 'Polimec', 'Astar'];
777
- needsVersionParam = nodesRequiringVersionParam.includes(node);
776
+ chainsRequiringVersionParam = ['BifrostPolkadot', 'BifrostKusama', 'AssetHubKusama', 'AssetHubPolkadot', 'Kusama', 'Polkadot', 'Polimec', 'Astar'];
777
+ needsVersionParam = chainsRequiringVersionParam.includes(chain);
778
778
  DEFAULT_XCM_VERSION = 3;
779
779
  _context15.n = 2;
780
780
  return (_this$api$call$dryRun = this.api.call.dryRunApi).dryRunCall.apply(_this$api$call$dryRun, [{
@@ -792,7 +792,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
792
792
  break;
793
793
  }
794
794
  moduleError = result.Ok.executionResult.Err.error.Module;
795
- failureReason = resolveModuleError(node, moduleError);
795
+ failureReason = resolveModuleError(chain, moduleError);
796
796
  return _context15.a(2, {
797
797
  success: false,
798
798
  failureReason: failureReason
@@ -802,7 +802,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
802
802
  return this.calculateTransactionFee(tx, address);
803
803
  case 4:
804
804
  executionFee = _context15.v;
805
- fee = computeFeeFromDryRunPjs(result, node, executionFee);
805
+ fee = computeFeeFromDryRunPjs(result, chain, executionFee);
806
806
  actualWeight = resultJson.ok.executionResult.ok.actualWeight;
807
807
  weight = actualWeight ? {
808
808
  refTime: BigInt(actualWeight.refTime),
@@ -830,7 +830,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
830
830
  }, {
831
831
  key: "getXcmPaymentApiFee",
832
832
  value: function () {
833
- var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(node, xcm, asset) {
833
+ var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(chain, xcm, asset) {
834
834
  var weight, localizedLocation, feeResult;
835
835
  return _regenerator().w(function (_context16) {
836
836
  while (1) switch (_context16.n) {
@@ -840,7 +840,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
840
840
  case 1:
841
841
  weight = _context16.v;
842
842
  assertHasLocation(asset);
843
- localizedLocation = node === 'AssetHubPolkadot' || node === 'AssetHubKusama' || isRelayChain(node) ? localizeLocation(node, asset.multiLocation) : asset.multiLocation;
843
+ localizedLocation = chain === 'AssetHubPolkadot' || chain === 'AssetHubKusama' || isRelayChain(chain) ? localizeLocation(chain, asset.location) : asset.location;
844
844
  _context16.n = 2;
845
845
  return this.api.call.xcmPaymentApi.queryWeightToAssetFee(weight, addXcmVersionHeader(localizedLocation, Version.V4));
846
846
  case 2:
@@ -881,17 +881,17 @@ var PolkadotJsApi = /*#__PURE__*/function () {
881
881
  value: function () {
882
882
  var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18(_ref6) {
883
883
  var _ref7, _ref8, _ref9;
884
- var originLocation, xcm, node, origin, supportsDryRunApi, response, result, resultJson, isSuccess, failureReason, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee, actualWeight, weight, forwardedXcms, destParaId;
884
+ var originLocation, xcm, chain, origin, supportsDryRunApi, response, result, resultJson, isSuccess, failureReason, emitted, reversedEvents, palletsWithIssued, feeEvent, feeAmount, fee, actualWeight, weight, forwardedXcms, destParaId;
885
885
  return _regenerator().w(function (_context18) {
886
886
  while (1) switch (_context18.n) {
887
887
  case 0:
888
- originLocation = _ref6.originLocation, xcm = _ref6.xcm, node = _ref6.node, origin = _ref6.origin;
889
- supportsDryRunApi = getAssetsObject(node).supportsDryRunApi;
888
+ originLocation = _ref6.originLocation, xcm = _ref6.xcm, chain = _ref6.chain, origin = _ref6.origin;
889
+ supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
890
890
  if (supportsDryRunApi) {
891
891
  _context18.n = 1;
892
892
  break;
893
893
  }
894
- throw new NodeNotSupportedError("DryRunApi is not available on node ".concat(node));
894
+ throw new ChainNotSupportedError("DryRunApi is not available on chain ".concat(chain));
895
895
  case 1:
896
896
  _context18.n = 2;
897
897
  return this.api.call.dryRunApi.dryRunXcm(originLocation, xcm);
@@ -1016,7 +1016,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1016
1016
  }
1017
1017
  return _context20.a(2);
1018
1018
  case 2:
1019
- api = isConfig(this._config) ? (_this$_config$apiOver2 = this._config.apiOverrides) === null || _this$_config$apiOver2 === void 0 ? void 0 : _this$_config$apiOver2[this._node] : this._config; // Disconnect api only if it was created automatically
1019
+ api = isConfig(this._config) ? (_this$_config$apiOver2 = this._config.apiOverrides) === null || _this$_config$apiOver2 === void 0 ? void 0 : _this$_config$apiOver2[this._chain] : this._config; // Disconnect api only if it was created automatically
1020
1020
  if (!(force || typeof api === 'string' || api === undefined)) {
1021
1021
  _context20.n = 3;
1022
1022
  break;
@@ -1036,9 +1036,9 @@ var PolkadotJsApi = /*#__PURE__*/function () {
1036
1036
  }]);
1037
1037
  }();
1038
1038
 
1039
- var createApiInstanceForNode = function createApiInstanceForNode(node) {
1039
+ var createChainClient = function createChainClient(chain) {
1040
1040
  var pjsApi = new PolkadotJsApi();
1041
- return createApiInstanceForNode$1(pjsApi, node);
1041
+ return createChainClient$1(pjsApi, chain);
1042
1042
  };
1043
1043
  var createPolkadotJsApiCall = function createPolkadotJsApiCall(apiCall) {
1044
1044
  return /*#__PURE__*/function () {
@@ -1065,19 +1065,19 @@ var isEthersSigner = function isEthersSigner(signer) {
1065
1065
  };
1066
1066
 
1067
1067
  /**
1068
- * Retrieves the native balance for a given account on a specified node.
1068
+ * Retrieves the native balance for a given account on a specified chain.
1069
1069
  *
1070
1070
  * @returns The native balance as a bigint.
1071
1071
  */
1072
1072
  var getBalanceNative = createPolkadotJsApiCall(getBalanceNative$1);
1073
1073
  /**
1074
- * Retrieves the balance of a foreign asset for a given account on a specified node.
1074
+ * Retrieves the balance of a foreign asset for a given account on a specified chain.
1075
1075
  *
1076
1076
  * @returns The balance of the foreign asset as a bigint, or null if not found.
1077
1077
  */
1078
1078
  var getBalanceForeign = createPolkadotJsApiCall(getBalanceForeign$1);
1079
1079
  /**
1080
- * Retrieves the asset balance for a given account on a specified node.
1080
+ * Retrieves the asset balance for a given account on a specified chain.
1081
1081
  *
1082
1082
  * @returns The asset balance as a bigint.
1083
1083
  */
@@ -1091,7 +1091,7 @@ var claimAssets = createPolkadotJsApiCall(claimAssets$1);
1091
1091
  /**
1092
1092
  * @deprecated This function is deprecated and will be removed in a future version.
1093
1093
  * Please use `builder.getOriginXcmFee()` or `builder.getOriginXcmFeeEstimate()` instead,
1094
- * where `builder` is an instance of `Builder()`.
1094
+ * where `builder` is an instance of `Builder()`. Will be removed in v12
1095
1095
  * For more details, please refer to the documentation:
1096
1096
  * {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
1097
1097
  */
@@ -1104,7 +1104,7 @@ var assets = /*#__PURE__*/Object.freeze({
1104
1104
  Native: Native,
1105
1105
  Override: Override,
1106
1106
  claimAssets: claimAssets,
1107
- findAsset: findAsset,
1107
+ findAssetInfo: findAssetInfo,
1108
1108
  getAllAssetsSymbols: getAllAssetsSymbols,
1109
1109
  getAssetBalance: getAssetBalance,
1110
1110
  getAssetDecimals: getAssetDecimals,
@@ -1120,14 +1120,14 @@ var assets = /*#__PURE__*/Object.freeze({
1120
1120
  getOtherAssets: getOtherAssets,
1121
1121
  getRelayChainSymbol: getRelayChainSymbol,
1122
1122
  getSupportedAssets: getSupportedAssets,
1123
- getTNode: getTNode,
1123
+ getTChain: getTChain,
1124
1124
  hasSupportForAsset: hasSupportForAsset,
1125
- isNodeEvm: isNodeEvm
1125
+ isChainEvm: isChainEvm
1126
1126
  });
1127
1127
 
1128
- var convertSs58 = function convertSs58(address, node) {
1128
+ var convertSs58 = function convertSs58(address, chain) {
1129
1129
  var papiApi = new PolkadotJsApi();
1130
- return convertSs58$1(papiApi, address, node);
1130
+ return convertSs58$1(papiApi, address, chain);
1131
1131
  };
1132
1132
 
1133
1133
  var approveToken = /*#__PURE__*/function () {
@@ -1240,22 +1240,22 @@ var createContext = function createContext(executionUrl, env) {
1240
1240
  */
1241
1241
  var transferEthToPolkadot$1 = /*#__PURE__*/function () {
1242
1242
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
1243
- var provider, signer, address, to, currency, ethAsset, env, context, destParaId, overrides, registry, fee, sourceAddress, transfer, validation, tx, response, receipt, messageReceipt, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23;
1243
+ var api, provider, signer, address, to, currency, ethAsset, amount, env, context, destParaId, overrides, registry, fee, sourceAddress, transfer, validation, tx, response, receipt, messageReceipt, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23;
1244
1244
  return _regenerator().w(function (_context) {
1245
1245
  while (1) switch (_context.n) {
1246
1246
  case 0:
1247
- provider = _ref.provider, signer = _ref.signer, address = _ref.address, to = _ref.to, currency = _ref.currency;
1248
- if (!('multiasset' in currency)) {
1247
+ api = _ref.api, provider = _ref.provider, signer = _ref.signer, address = _ref.address, to = _ref.to, currency = _ref.currency;
1248
+ if (!Array.isArray(currency)) {
1249
1249
  _context.n = 1;
1250
1250
  break;
1251
1251
  }
1252
- throw new InvalidParameterError('Multiassets syntax is not supported for Evm transfers');
1252
+ throw new InvalidParameterError('Multi-assets are not yet supported for EVM transfers');
1253
1253
  case 1:
1254
- if (!('multilocation' in currency && isOverrideMultiLocationSpecifier(currency.multilocation))) {
1254
+ if (!('location' in currency && isOverrideLocationSpecifier(currency.location))) {
1255
1255
  _context.n = 2;
1256
1256
  break;
1257
1257
  }
1258
- throw new InvalidParameterError('Override multilocation is not supported for Evm transfers');
1258
+ throw new InvalidParameterError('Override location is not supported for EVM transfers');
1259
1259
  case 2:
1260
1260
  if (provider) {
1261
1261
  _context.n = 3;
@@ -1269,22 +1269,12 @@ var transferEthToPolkadot$1 = /*#__PURE__*/function () {
1269
1269
  }
1270
1270
  throw new InvalidParameterError('Snowbridge does not support Viem provider yet.');
1271
1271
  case 4:
1272
- ethAsset = findAsset('Ethereum', currency, to);
1273
- if (!(ethAsset === null)) {
1274
- _context.n = 5;
1275
- break;
1276
- }
1277
- throw new InvalidCurrencyError("Origin node Ethereum does not support currency ".concat(JSON.stringify(currency), "."));
1278
- case 5:
1272
+ ethAsset = findAssetInfoOrThrow('Ethereum', currency, to);
1273
+ amount = abstractDecimals(currency.amount, ethAsset.decimals, api);
1279
1274
  env = environment.SNOWBRIDGE_ENV['polkadot_mainnet'];
1280
1275
  context = createContext(provider, env);
1281
1276
  destParaId = getParaId(to);
1282
- if (!(!isForeignAsset(ethAsset) || ethAsset.assetId === undefined)) {
1283
- _context.n = 6;
1284
- break;
1285
- }
1286
- throw new InvalidCurrencyError('Selected asset has no asset id');
1287
- case 6:
1277
+ assertHasId(ethAsset);
1288
1278
  overrides = {
1289
1279
  precompiles: {
1290
1280
  '2004': '0x000000000000000000000000000000000000081A'
@@ -1304,26 +1294,26 @@ var transferEthToPolkadot$1 = /*#__PURE__*/function () {
1304
1294
  _t2 = _objectSpread2;
1305
1295
  _t3 = _objectSpread2;
1306
1296
  _t4 = {};
1307
- _context.n = 7;
1297
+ _context.n = 5;
1308
1298
  return assetsV2.fromContext(context);
1309
- case 7:
1299
+ case 5:
1310
1300
  _t5 = _context.v;
1311
1301
  _t6 = _t3(_t4, _t5);
1312
1302
  _t7 = overrides;
1313
1303
  _t8 = _t2(_t6, _t7);
1314
- _context.n = 8;
1304
+ _context.n = 6;
1315
1305
  return _t.buildRegistry.call(_t, _t8);
1316
- case 8:
1306
+ case 6:
1317
1307
  registry = _context.v;
1318
1308
  _t9 = toPolkadotV2;
1319
1309
  _t0 = context.gateway();
1320
- _context.n = 9;
1310
+ _context.n = 7;
1321
1311
  return context.assetHub();
1322
- case 9:
1312
+ case 7:
1323
1313
  _t1 = _context.v;
1324
- _context.n = 10;
1314
+ _context.n = 8;
1325
1315
  return context.parachain(destParaId);
1326
- case 10:
1316
+ case 8:
1327
1317
  _t10 = _context.v;
1328
1318
  _t11 = {
1329
1319
  gateway: _t0,
@@ -1333,42 +1323,42 @@ var transferEthToPolkadot$1 = /*#__PURE__*/function () {
1333
1323
  _t12 = registry;
1334
1324
  _t13 = ethAsset.assetId;
1335
1325
  _t14 = destParaId;
1336
- _context.n = 11;
1326
+ _context.n = 9;
1337
1327
  return _t9.getDeliveryFee.call(_t9, _t11, _t12, _t13, _t14);
1338
- case 11:
1328
+ case 9:
1339
1329
  fee = _context.v;
1340
- _context.n = 12;
1330
+ _context.n = 10;
1341
1331
  return signer.getAddress();
1342
- case 12:
1332
+ case 10:
1343
1333
  sourceAddress = _context.v;
1344
- _context.n = 13;
1345
- return toPolkadotV2.createTransfer(registry, sourceAddress, address, ethAsset.assetId, destParaId, BigInt(currency.amount), fee);
1346
- case 13:
1334
+ _context.n = 11;
1335
+ return toPolkadotV2.createTransfer(registry, sourceAddress, address, ethAsset.assetId, destParaId, amount, fee);
1336
+ case 11:
1347
1337
  transfer = _context.v;
1348
1338
  _t15 = toPolkadotV2;
1349
1339
  _t16 = context.ethereum();
1350
1340
  _t17 = context.gateway();
1351
- _context.n = 14;
1341
+ _context.n = 12;
1352
1342
  return context.bridgeHub();
1353
- case 14:
1343
+ case 12:
1354
1344
  _t18 = _context.v;
1355
- _context.n = 15;
1345
+ _context.n = 13;
1356
1346
  return context.assetHub();
1357
- case 15:
1347
+ case 13:
1358
1348
  _t19 = _context.v;
1359
1349
  if (!(destParaId !== getParaId('AssetHubPolkadot'))) {
1360
- _context.n = 17;
1350
+ _context.n = 15;
1361
1351
  break;
1362
1352
  }
1363
- _context.n = 16;
1353
+ _context.n = 14;
1364
1354
  return context.parachain(destParaId);
1365
- case 16:
1355
+ case 14:
1366
1356
  _t20 = _context.v;
1367
- _context.n = 18;
1357
+ _context.n = 16;
1368
1358
  break;
1369
- case 17:
1359
+ case 15:
1370
1360
  _t20 = undefined;
1371
- case 18:
1361
+ case 16:
1372
1362
  _t21 = _t20;
1373
1363
  _t22 = {
1374
1364
  ethereum: _t16,
@@ -1378,14 +1368,14 @@ var transferEthToPolkadot$1 = /*#__PURE__*/function () {
1378
1368
  destParachain: _t21
1379
1369
  };
1380
1370
  _t23 = transfer;
1381
- _context.n = 19;
1371
+ _context.n = 17;
1382
1372
  return _t15.validateTransfer.call(_t15, _t22, _t23);
1383
- case 19:
1373
+ case 17:
1384
1374
  validation = _context.v;
1385
1375
  if (!validation.logs.find(function (l) {
1386
1376
  return l.kind == toPolkadotV2.ValidationKind.Error;
1387
1377
  })) {
1388
- _context.n = 20;
1378
+ _context.n = 18;
1389
1379
  break;
1390
1380
  }
1391
1381
  throw new InvalidParameterError("Validation failed with following errors: \n\n ".concat(validation.logs.filter(function (l) {
@@ -1393,32 +1383,32 @@ var transferEthToPolkadot$1 = /*#__PURE__*/function () {
1393
1383
  }).map(function (l) {
1394
1384
  return l.message;
1395
1385
  }).join('\n\n')));
1396
- case 20:
1386
+ case 18:
1397
1387
  tx = transfer.tx;
1398
- _context.n = 21;
1388
+ _context.n = 19;
1399
1389
  return signer.sendTransaction(tx);
1400
- case 21:
1390
+ case 19:
1401
1391
  response = _context.v;
1402
- _context.n = 22;
1392
+ _context.n = 20;
1403
1393
  return response.wait(1);
1404
- case 22:
1394
+ case 20:
1405
1395
  receipt = _context.v;
1406
1396
  if (receipt) {
1407
- _context.n = 23;
1397
+ _context.n = 21;
1408
1398
  break;
1409
1399
  }
1410
1400
  throw new InvalidParameterError("Transaction ".concat(response.hash, " not included."));
1411
- case 23:
1412
- _context.n = 24;
1401
+ case 21:
1402
+ _context.n = 22;
1413
1403
  return toPolkadotV2.getMessageReceipt(receipt);
1414
- case 24:
1404
+ case 22:
1415
1405
  messageReceipt = _context.v;
1416
1406
  if (messageReceipt) {
1417
- _context.n = 25;
1407
+ _context.n = 23;
1418
1408
  break;
1419
1409
  }
1420
1410
  throw new InvalidParameterError("Transaction ".concat(receipt.hash, " did not emit a message."));
1421
- case 25:
1411
+ case 23:
1422
1412
  return _context.a(2, {
1423
1413
  response: response,
1424
1414
  messageReceipt: messageReceipt
@@ -1471,22 +1461,22 @@ var EvmBuilderCore = /*#__PURE__*/function () {
1471
1461
  }
1472
1462
  return _createClass(EvmBuilderCore, [{
1473
1463
  key: "from",
1474
- value: function from(node) {
1464
+ value: function from(chain) {
1475
1465
  return new EvmBuilderCore(_objectSpread2(_objectSpread2({}, this._options), {}, {
1476
- from: node
1466
+ from: chain
1477
1467
  }));
1478
1468
  }
1479
1469
  /**
1480
- * Specifies the destination node on Polkadot.
1470
+ * Specifies the destination chain on Polkadot.
1481
1471
  *
1482
- * @param node - The Polkadot node to which the transfer will be made.
1472
+ * @param chain - The Polkadot chain to which the transfer will be made.
1483
1473
  * @returns An instance of EvmBuilder
1484
1474
  */
1485
1475
  }, {
1486
1476
  key: "to",
1487
- value: function to(node) {
1477
+ value: function to(chain) {
1488
1478
  return new EvmBuilderCore(_objectSpread2(_objectSpread2({}, this._options), {}, {
1489
- to: node
1479
+ to: chain
1490
1480
  }));
1491
1481
  }
1492
1482
  /**
@@ -1625,8 +1615,8 @@ var Builder = function Builder(api) {
1625
1615
  var pjsApi = new PolkadotJsApi(api);
1626
1616
  return Builder$1(pjsApi);
1627
1617
  };
1628
- var EvmBuilder = function EvmBuilder(provider) {
1629
- var pjsApi = new PolkadotJsApi();
1618
+ var EvmBuilder = function EvmBuilder(provider, api) {
1619
+ var pjsApi = new PolkadotJsApi(api);
1630
1620
  return EvmBuilder$1(pjsApi, provider);
1631
1621
  };
1632
1622
 
@@ -1693,4 +1683,4 @@ var transfer = /*#__PURE__*/Object.freeze({
1693
1683
  transferEthToPolkadot: transferEthToPolkadot
1694
1684
  });
1695
1685
 
1696
- export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createApiInstanceForNode, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, send, transferEthToPolkadot, transfer as xcmPallet };
1686
+ export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createChainClient, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, send, transferEthToPolkadot, transfer as xcmPallet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-pjs",
3
- "version": "10.11.9",
3
+ "version": "11.0.0",
4
4
  "description": "Polkadot.js based SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "@snowbridge/contract-types": "0.1.64",
28
28
  "ethers": "^6.15.0",
29
29
  "viem": "^2.33.2",
30
- "@paraspell/sdk-core": "10.11.9"
30
+ "@paraspell/sdk-core": "11.0.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@polkadot/api": ">= 16.0 < 17",