@paraspell/sdk-core 8.2.1 → 8.3.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.cjs CHANGED
@@ -8,6 +8,9 @@ function _arrayLikeToArray(r, a) {
8
8
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
9
9
  return n;
10
10
  }
11
+ function _arrayWithHoles(r) {
12
+ if (Array.isArray(r)) return r;
13
+ }
11
14
  function _arrayWithoutHoles(r) {
12
15
  if (Array.isArray(r)) return _arrayLikeToArray(r);
13
16
  }
@@ -164,6 +167,33 @@ function _isNativeReflectConstruct() {
164
167
  function _iterableToArray(r) {
165
168
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
166
169
  }
170
+ function _iterableToArrayLimit(r, l) {
171
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
172
+ if (null != t) {
173
+ var e,
174
+ n,
175
+ i,
176
+ u,
177
+ a = [],
178
+ f = true,
179
+ o = false;
180
+ try {
181
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
182
+ } catch (r) {
183
+ o = true, n = r;
184
+ } finally {
185
+ try {
186
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
187
+ } finally {
188
+ if (o) throw n;
189
+ }
190
+ }
191
+ return a;
192
+ }
193
+ }
194
+ function _nonIterableRest() {
195
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
196
+ }
167
197
  function _nonIterableSpread() {
168
198
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
169
199
  }
@@ -499,6 +529,9 @@ function _setPrototypeOf(t, e) {
499
529
  return t.__proto__ = e, t;
500
530
  }, _setPrototypeOf(t, e);
501
531
  }
532
+ function _slicedToArray(r, e) {
533
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
534
+ }
502
535
  function _superPropBase(t, o) {
503
536
  for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
504
537
  return t;
@@ -11811,6 +11844,10 @@ var isForeignAsset = function isForeignAsset(asset) {
11811
11844
  return _typeof(asset) === 'object' && asset !== null && ('assetId' in asset || 'multiLocation' in asset || 'xcmInterior' in asset);
11812
11845
  };
11813
11846
 
11847
+ var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
11848
+ return _typeof(currencySymbolValue) === 'object' && 'type' in currencySymbolValue && 'value' in currencySymbolValue;
11849
+ };
11850
+
11814
11851
  /**
11815
11852
  * Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
11816
11853
  */
@@ -16214,10 +16251,6 @@ var isOverrideMultiLocationSpecifier = function isOverrideMultiLocationSpecifier
16214
16251
  return _typeof(multiLocationSpecifier) === 'object' && 'type' in multiLocationSpecifier && 'value' in multiLocationSpecifier;
16215
16252
  };
16216
16253
 
16217
- var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
16218
- return _typeof(currencySymbolValue) === 'object' && 'type' in currencySymbolValue && 'value' in currencySymbolValue;
16219
- };
16220
-
16221
16254
  // Contains function for getting Asset ID or Symbol used in XCM call creation
16222
16255
  var throwDuplicateAssetError = function throwDuplicateAssetError(symbol, nativeMatches, foreignMatches) {
16223
16256
  if (nativeMatches.length > 0 && foreignMatches.length > 0) {
@@ -16488,6 +16521,29 @@ var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency, destina
16488
16521
  return null;
16489
16522
  };
16490
16523
 
16524
+ var getAssetMultiLocation = function getAssetMultiLocation(node, currency) {
16525
+ var asset = getAssetBySymbolOrId(node, currency, null);
16526
+ if (!asset || !isForeignAsset(asset)) {
16527
+ return null;
16528
+ }
16529
+ if (asset.multiLocation) {
16530
+ return asset.multiLocation;
16531
+ }
16532
+ if (asset.xcmInterior) {
16533
+ var _asset$xcmInterior$sl = asset.xcmInterior.slice(-2),
16534
+ _asset$xcmInterior$sl2 = _slicedToArray(_asset$xcmInterior$sl, 2),
16535
+ secondLast = _asset$xcmInterior$sl2[0],
16536
+ last = _asset$xcmInterior$sl2[1];
16537
+ return {
16538
+ parents: exports.Parents.ZERO,
16539
+ interior: {
16540
+ X2: [secondLast, last]
16541
+ }
16542
+ };
16543
+ }
16544
+ return null;
16545
+ };
16546
+
16491
16547
  /**
16492
16548
  * Retrieves the existential deposit value for a given node.
16493
16549
  *
@@ -19298,31 +19354,25 @@ var getDryRun = /*#__PURE__*/function () {
19298
19354
  while (1) switch (_context.prev = _context.next) {
19299
19355
  case 0:
19300
19356
  api = options.api, node = options.node;
19301
- if (!(node === 'Kusama')) {
19302
- _context.next = 3;
19303
- break;
19304
- }
19305
- throw new Error('Kusama is temporarily disable due to unknown error in DryRun.');
19306
- case 3:
19307
- _context.next = 5;
19357
+ _context.next = 3;
19308
19358
  return api.init(node);
19309
- case 5:
19310
- _context.prev = 5;
19311
- _context.next = 8;
19359
+ case 3:
19360
+ _context.prev = 3;
19361
+ _context.next = 6;
19312
19362
  return api.getDryRun(options);
19313
- case 8:
19363
+ case 6:
19314
19364
  return _context.abrupt("return", _context.sent);
19315
- case 9:
19316
- _context.prev = 9;
19317
- _context.next = 12;
19365
+ case 7:
19366
+ _context.prev = 7;
19367
+ _context.next = 10;
19318
19368
  return api.disconnect();
19319
- case 12:
19320
- return _context.finish(9);
19321
- case 13:
19369
+ case 10:
19370
+ return _context.finish(7);
19371
+ case 11:
19322
19372
  case "end":
19323
19373
  return _context.stop();
19324
19374
  }
19325
- }, _callee, null, [[5,, 9, 13]]);
19375
+ }, _callee, null, [[3,, 7, 11]]);
19326
19376
  }));
19327
19377
  return function getDryRun(_x) {
19328
19378
  return _ref.apply(this, arguments);
@@ -19587,6 +19637,10 @@ exports.createApiInstanceForNode = createApiInstanceForNode;
19587
19637
  exports.createX1Payload = createX1Payload;
19588
19638
  exports.deepEqual = _deepEqual;
19589
19639
  exports.determineRelayChain = determineRelayChain;
19640
+ exports.findAssetById = findAssetById;
19641
+ exports.findAssetByMultiLocation = findAssetByMultiLocation;
19642
+ exports.findAssetBySymbol = findAssetBySymbol;
19643
+ exports.findBestMatches = findBestMatches;
19590
19644
  exports.generateAddressMultiLocationV4 = generateAddressMultiLocationV4;
19591
19645
  exports.generateAddressPayload = generateAddressPayload;
19592
19646
  exports.getAllAssetsSymbols = getAllAssetsSymbols;
@@ -19595,6 +19649,7 @@ exports.getAssetBalanceInternal = getAssetBalanceInternal;
19595
19649
  exports.getAssetBySymbolOrId = getAssetBySymbolOrId;
19596
19650
  exports.getAssetDecimals = getAssetDecimals;
19597
19651
  exports.getAssetId = getAssetId;
19652
+ exports.getAssetMultiLocation = getAssetMultiLocation;
19598
19653
  exports.getAssets = getAssets;
19599
19654
  exports.getAssetsObject = getAssetsObject;
19600
19655
  exports.getBalanceForeign = getBalanceForeign;
@@ -19628,6 +19683,8 @@ exports.isForeignAsset = isForeignAsset;
19628
19683
  exports.isNodeEvm = isNodeEvm;
19629
19684
  exports.isOverrideMultiLocationSpecifier = isOverrideMultiLocationSpecifier;
19630
19685
  exports.isRelayChain = isRelayChain;
19686
+ exports.isSymbolSpecifier = isSymbolSpecifier;
19687
+ exports.normalizeSymbol = normalizeSymbol;
19631
19688
  exports.resolveModuleError = resolveModuleError;
19632
19689
  exports.resolveParaId = resolveParaId;
19633
19690
  exports.send = send;
package/dist/index.d.ts CHANGED
@@ -1317,6 +1317,8 @@ declare const getDryRun: <TApi, TRes>(options: TDryRunOptions<TApi, TRes>) => Pr
1317
1317
 
1318
1318
  declare const transferMoonbeamEvm: <TApi, TRes>({ api, from, to, signer, address, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<string>;
1319
1319
 
1320
+ declare const getAssetMultiLocation: (node: TNodeWithRelayChains, currency: TCurrencyInput) => TMultiLocation | null;
1321
+
1320
1322
  /**
1321
1323
  * Retrieves the existential deposit value for a given node.
1322
1324
  *
@@ -1437,6 +1439,13 @@ declare const ForeignAbstract: (symbol: string) => TSymbolSpecifier;
1437
1439
 
1438
1440
  declare const Override: (multiLocation: TMultiLocation) => TOverrideMultiLocationSpecifier;
1439
1441
 
1442
+ /**
1443
+ * Normalizes an asset symbol by stripping the 'xc' prefix (if present) and converting it to lowercase.
1444
+ *
1445
+ * @param symbol - The symbol to normalize.
1446
+ * @returns The normalized symbol.
1447
+ */
1448
+ declare const normalizeSymbol: (symbol: string | undefined) => string;
1440
1449
  /**
1441
1450
  * Retrieves the list of assets that are supported for transfers between two specified nodes.
1442
1451
  *
@@ -1452,6 +1461,15 @@ declare const getTransferableAmount: <TApi, TRes>({ api, address, node, currency
1452
1461
 
1453
1462
  declare const getAssetBySymbolOrId: (node: TNodeWithRelayChains, currency: TCurrencyInput, destination: TNodeWithRelayChains | null) => TAsset | null;
1454
1463
 
1464
+ declare const findBestMatches: <T extends {
1465
+ symbol: string;
1466
+ alias?: string;
1467
+ }>(assets: T[], value: string, property?: "symbol" | "alias") => T[];
1468
+ declare const findAssetBySymbol: (node: TNodeWithRelayChains, destination: TNodeWithRelayChains | null, otherAssets: TForeignAsset[], nativeAssets: TNativeAsset[], symbol: TCurrencySymbolValue) => TAsset | undefined;
1469
+ declare const findAssetById: (assets: TForeignAsset[], assetId: TCurrency) => TForeignAsset | undefined;
1470
+
1471
+ declare const findAssetByMultiLocation: (foreignAssets: TForeignAsset[], multiLocation: string | TMultiLocation | TJunction[]) => TForeignAsset | undefined;
1472
+
1455
1473
  /**
1456
1474
  * Retrieves the default pallet for a specified node.
1457
1475
  *
@@ -1594,6 +1612,8 @@ declare const createApiInstanceForNode: <TApi, TRes>(api: IPolkadotApi<TApi, TRe
1594
1612
 
1595
1613
  declare const isForeignAsset: (asset: TAsset) => asset is TForeignAsset;
1596
1614
 
1615
+ declare const isSymbolSpecifier: (currencySymbolValue: TCurrencySymbolValue) => currencySymbolValue is TSymbolSpecifier;
1616
+
1597
1617
  declare const resolveModuleError: (node: TNodeDotKsmWithRelayChains, error: TModuleError) => XTokensError | PolkadotXcmError;
1598
1618
 
1599
1619
  declare const computeFeeFromDryRun: (dryRun: any, node: TNodeDotKsmWithRelayChains, executionFee: bigint) => bigint;
@@ -1729,4 +1749,4 @@ declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
1729
1749
  */
1730
1750
  declare const getParaId: (node: TNodeDotKsmWithRelayChains) => number;
1731
1751
 
1732
- export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyCoreV1WithAmount, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionGeneralIndex, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TRelaychain, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, Version, type WithAmount, type WithApi, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara };
1752
+ export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyCoreV1WithAmount, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionGeneralIndex, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TRelaychain, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, Version, type WithAmount, type WithApi, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findBestMatches, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara };
package/dist/index.mjs CHANGED
@@ -6,6 +6,9 @@ function _arrayLikeToArray(r, a) {
6
6
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
7
7
  return n;
8
8
  }
9
+ function _arrayWithHoles(r) {
10
+ if (Array.isArray(r)) return r;
11
+ }
9
12
  function _arrayWithoutHoles(r) {
10
13
  if (Array.isArray(r)) return _arrayLikeToArray(r);
11
14
  }
@@ -162,6 +165,33 @@ function _isNativeReflectConstruct() {
162
165
  function _iterableToArray(r) {
163
166
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
164
167
  }
168
+ function _iterableToArrayLimit(r, l) {
169
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
170
+ if (null != t) {
171
+ var e,
172
+ n,
173
+ i,
174
+ u,
175
+ a = [],
176
+ f = true,
177
+ o = false;
178
+ try {
179
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
180
+ } catch (r) {
181
+ o = true, n = r;
182
+ } finally {
183
+ try {
184
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
185
+ } finally {
186
+ if (o) throw n;
187
+ }
188
+ }
189
+ return a;
190
+ }
191
+ }
192
+ function _nonIterableRest() {
193
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
194
+ }
165
195
  function _nonIterableSpread() {
166
196
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
167
197
  }
@@ -497,6 +527,9 @@ function _setPrototypeOf(t, e) {
497
527
  return t.__proto__ = e, t;
498
528
  }, _setPrototypeOf(t, e);
499
529
  }
530
+ function _slicedToArray(r, e) {
531
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
532
+ }
500
533
  function _superPropBase(t, o) {
501
534
  for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
502
535
  return t;
@@ -11809,6 +11842,10 @@ var isForeignAsset = function isForeignAsset(asset) {
11809
11842
  return _typeof(asset) === 'object' && asset !== null && ('assetId' in asset || 'multiLocation' in asset || 'xcmInterior' in asset);
11810
11843
  };
11811
11844
 
11845
+ var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
11846
+ return _typeof(currencySymbolValue) === 'object' && 'type' in currencySymbolValue && 'value' in currencySymbolValue;
11847
+ };
11848
+
11812
11849
  /**
11813
11850
  * Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
11814
11851
  */
@@ -16212,10 +16249,6 @@ var isOverrideMultiLocationSpecifier = function isOverrideMultiLocationSpecifier
16212
16249
  return _typeof(multiLocationSpecifier) === 'object' && 'type' in multiLocationSpecifier && 'value' in multiLocationSpecifier;
16213
16250
  };
16214
16251
 
16215
- var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
16216
- return _typeof(currencySymbolValue) === 'object' && 'type' in currencySymbolValue && 'value' in currencySymbolValue;
16217
- };
16218
-
16219
16252
  // Contains function for getting Asset ID or Symbol used in XCM call creation
16220
16253
  var throwDuplicateAssetError = function throwDuplicateAssetError(symbol, nativeMatches, foreignMatches) {
16221
16254
  if (nativeMatches.length > 0 && foreignMatches.length > 0) {
@@ -16486,6 +16519,29 @@ var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency, destina
16486
16519
  return null;
16487
16520
  };
16488
16521
 
16522
+ var getAssetMultiLocation = function getAssetMultiLocation(node, currency) {
16523
+ var asset = getAssetBySymbolOrId(node, currency, null);
16524
+ if (!asset || !isForeignAsset(asset)) {
16525
+ return null;
16526
+ }
16527
+ if (asset.multiLocation) {
16528
+ return asset.multiLocation;
16529
+ }
16530
+ if (asset.xcmInterior) {
16531
+ var _asset$xcmInterior$sl = asset.xcmInterior.slice(-2),
16532
+ _asset$xcmInterior$sl2 = _slicedToArray(_asset$xcmInterior$sl, 2),
16533
+ secondLast = _asset$xcmInterior$sl2[0],
16534
+ last = _asset$xcmInterior$sl2[1];
16535
+ return {
16536
+ parents: Parents.ZERO,
16537
+ interior: {
16538
+ X2: [secondLast, last]
16539
+ }
16540
+ };
16541
+ }
16542
+ return null;
16543
+ };
16544
+
16489
16545
  /**
16490
16546
  * Retrieves the existential deposit value for a given node.
16491
16547
  *
@@ -19296,31 +19352,25 @@ var getDryRun = /*#__PURE__*/function () {
19296
19352
  while (1) switch (_context.prev = _context.next) {
19297
19353
  case 0:
19298
19354
  api = options.api, node = options.node;
19299
- if (!(node === 'Kusama')) {
19300
- _context.next = 3;
19301
- break;
19302
- }
19303
- throw new Error('Kusama is temporarily disable due to unknown error in DryRun.');
19304
- case 3:
19305
- _context.next = 5;
19355
+ _context.next = 3;
19306
19356
  return api.init(node);
19307
- case 5:
19308
- _context.prev = 5;
19309
- _context.next = 8;
19357
+ case 3:
19358
+ _context.prev = 3;
19359
+ _context.next = 6;
19310
19360
  return api.getDryRun(options);
19311
- case 8:
19361
+ case 6:
19312
19362
  return _context.abrupt("return", _context.sent);
19313
- case 9:
19314
- _context.prev = 9;
19315
- _context.next = 12;
19363
+ case 7:
19364
+ _context.prev = 7;
19365
+ _context.next = 10;
19316
19366
  return api.disconnect();
19317
- case 12:
19318
- return _context.finish(9);
19319
- case 13:
19367
+ case 10:
19368
+ return _context.finish(7);
19369
+ case 11:
19320
19370
  case "end":
19321
19371
  return _context.stop();
19322
19372
  }
19323
- }, _callee, null, [[5,, 9, 13]]);
19373
+ }, _callee, null, [[3,, 7, 11]]);
19324
19374
  }));
19325
19375
  return function getDryRun(_x) {
19326
19376
  return _ref.apply(this, arguments);
@@ -19559,4 +19609,4 @@ var transferMoonbeamEvm = /*#__PURE__*/function () {
19559
19609
  };
19560
19610
  }();
19561
19611
 
19562
- export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, _deepEqual as deepEqual, determineRelayChain, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara };
19612
+ export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, _deepEqual as deepEqual, determineRelayChain, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findBestMatches, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-core",
3
- "version": "8.2.1",
3
+ "version": "8.3.0",
4
4
  "description": "SDK core for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "ethers": "^6.13.5",
27
- "viem": "^2.22.13"
27
+ "viem": "^2.22.22"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@babel/plugin-syntax-import-attributes": "^7.26.0",