@paraspell/sdk-core 8.0.3 → 8.1.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
@@ -9654,6 +9654,81 @@ var Unique$3 = {
9654
9654
  }
9655
9655
  ],
9656
9656
  otherAssets: [
9657
+ {
9658
+ assetId: "459",
9659
+ symbol: "PINK",
9660
+ decimals: 10,
9661
+ multiLocation: {
9662
+ parents: 1,
9663
+ interior: {
9664
+ X3: [
9665
+ {
9666
+ Parachain: 1000
9667
+ },
9668
+ {
9669
+ PalletInstance: 50
9670
+ },
9671
+ {
9672
+ GeneralIndex: 23
9673
+ }
9674
+ ]
9675
+ }
9676
+ },
9677
+ existentialDeposit: "0"
9678
+ },
9679
+ {
9680
+ assetId: "473",
9681
+ symbol: "USDt",
9682
+ decimals: 6,
9683
+ multiLocation: {
9684
+ parents: 1,
9685
+ interior: {
9686
+ X3: [
9687
+ {
9688
+ Parachain: 1000
9689
+ },
9690
+ {
9691
+ PalletInstance: 50
9692
+ },
9693
+ {
9694
+ GeneralIndex: 1984
9695
+ }
9696
+ ]
9697
+ }
9698
+ },
9699
+ existentialDeposit: "0"
9700
+ },
9701
+ {
9702
+ assetId: "498",
9703
+ symbol: "GLMR",
9704
+ decimals: 18,
9705
+ multiLocation: {
9706
+ parents: 1,
9707
+ interior: {
9708
+ X2: [
9709
+ {
9710
+ Parachain: 2004
9711
+ },
9712
+ {
9713
+ PalletInstance: 10
9714
+ }
9715
+ ]
9716
+ }
9717
+ },
9718
+ existentialDeposit: "0"
9719
+ },
9720
+ {
9721
+ assetId: "437",
9722
+ symbol: "DOT",
9723
+ decimals: 10,
9724
+ multiLocation: {
9725
+ parents: 1,
9726
+ interior: {
9727
+ Here: null
9728
+ }
9729
+ },
9730
+ existentialDeposit: "0"
9731
+ }
9657
9732
  ]
9658
9733
  };
9659
9734
  var Crust$3 = {
@@ -13586,16 +13661,17 @@ var Unique$1 = /*#__PURE__*/function (_ParachainNode) {
13586
13661
  key: "transferXTokens",
13587
13662
  value: function transferXTokens(input) {
13588
13663
  var asset = input.asset;
13664
+ if (asset.symbol === this.getNativeAssetSymbol()) {
13665
+ return XTokensTransferImpl.transferXTokens(input, Unique.NATIVE_ASSET_ID);
13666
+ }
13589
13667
  if (!isForeignAsset(asset) || !asset.assetId) {
13590
13668
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
13591
13669
  }
13592
- var currencySelection = {
13593
- ForeignAssetId: BigInt(asset.assetId)
13594
- };
13595
- return XTokensTransferImpl.transferXTokens(input, currencySelection);
13670
+ return XTokensTransferImpl.transferXTokens(input, Number(asset.assetId));
13596
13671
  }
13597
13672
  }]);
13598
13673
  }(ParachainNode);
13674
+ Unique$1.NATIVE_ASSET_ID = 0;
13599
13675
 
13600
13676
  var Crust$1 = /*#__PURE__*/function (_ParachainNode) {
13601
13677
  function Crust() {
@@ -15138,20 +15214,25 @@ var Crab$1 = /*#__PURE__*/function (_ParachainNode) {
15138
15214
 
15139
15215
  var Quartz$1 = /*#__PURE__*/function (_ParachainNode) {
15140
15216
  function Quartz() {
15141
- var _this;
15142
15217
  _classCallCheck(this, Quartz);
15143
- _this = _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', exports.Version.V3]);
15144
- _this._assetCheckEnabled = false;
15145
- return _this;
15218
+ return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', exports.Version.V3]);
15146
15219
  }
15147
15220
  _inherits(Quartz, _ParachainNode);
15148
15221
  return _createClass(Quartz, [{
15149
15222
  key: "transferXTokens",
15150
15223
  value: function transferXTokens(input) {
15151
- return getNode('Unique').transferXTokens(input);
15224
+ var asset = input.asset;
15225
+ if (asset.symbol === this.getNativeAssetSymbol()) {
15226
+ return XTokensTransferImpl.transferXTokens(input, Quartz.NATIVE_ASSET_ID);
15227
+ }
15228
+ if (!isForeignAsset(asset) || !asset.assetId) {
15229
+ throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
15230
+ }
15231
+ return XTokensTransferImpl.transferXTokens(input, Number(asset.assetId));
15152
15232
  }
15153
15233
  }]);
15154
15234
  }(ParachainNode);
15235
+ Quartz$1.NATIVE_ASSET_ID = 0;
15155
15236
 
15156
15237
  var Shiden$1 = /*#__PURE__*/function (_ParachainNode) {
15157
15238
  function Shiden() {
@@ -15340,14 +15421,14 @@ var Collectives$1 = /*#__PURE__*/function (_ParachainNode) {
15340
15421
  var determineDestWeight = function determineDestWeight(destNode) {
15341
15422
  if (destNode === 'Astar') {
15342
15423
  return {
15343
- refTime: '6000000000',
15344
- proofSize: '1000000'
15424
+ ref_time: 6000000000n,
15425
+ proof_size: 1000000n
15345
15426
  };
15346
15427
  }
15347
15428
  if (destNode === 'Moonbeam' || destNode === 'Hydration') {
15348
15429
  return {
15349
- refTime: '5000000000',
15350
- proofSize: '0'
15430
+ ref_time: 5000000000n,
15431
+ proof_size: 0n
15351
15432
  };
15352
15433
  }
15353
15434
  throw new NodeNotSupportedError("Node ".concat(destNode, " is not supported"));
@@ -15427,7 +15508,7 @@ var Khala$1 = /*#__PURE__*/function (_ParachainNode) {
15427
15508
  key: "transferXTransfer",
15428
15509
  value: function transferXTransfer(input) {
15429
15510
  var asset = input.asset;
15430
- if (asset.symbol !== 'PHA') {
15511
+ if (asset.symbol !== this.getNativeAssetSymbol()) {
15431
15512
  throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(asset.symbol));
15432
15513
  }
15433
15514
  return XTransferTransferImpl.transferXTransfer(input);
@@ -17465,10 +17546,6 @@ var getAssetBalance = /*#__PURE__*/function () {
17465
17546
  };
17466
17547
  }();
17467
17548
 
17468
- var isPjsClient = function isPjsClient(api) {
17469
- return _typeof(api) === 'object' && api !== null && 'disconnect' in api && typeof api.disconnect === 'function';
17470
- };
17471
-
17472
17549
  var buildBeneficiaryInput = function buildBeneficiaryInput(api, address) {
17473
17550
  if (isTMultiLocation(address)) {
17474
17551
  return address;
@@ -17512,7 +17589,6 @@ var claimAssets = /*#__PURE__*/function () {
17512
17589
  _context.next = 3;
17513
17590
  return api.init(node);
17514
17591
  case 3:
17515
- _context.prev = 3;
17516
17592
  args = buildClaimAssetsInput(options);
17517
17593
  module = isRelayChain(node) ? 'XcmPallet' : 'PolkadotXcm';
17518
17594
  call = {
@@ -17521,21 +17597,11 @@ var claimAssets = /*#__PURE__*/function () {
17521
17597
  parameters: args
17522
17598
  };
17523
17599
  return _context.abrupt("return", api.callTxMethod(call));
17524
- case 8:
17525
- _context.prev = 8;
17526
- if (!isPjsClient(api.getApi())) {
17527
- _context.next = 12;
17528
- break;
17529
- }
17530
- _context.next = 12;
17531
- return api.disconnect();
17532
- case 12:
17533
- return _context.finish(8);
17534
- case 13:
17600
+ case 7:
17535
17601
  case "end":
17536
17602
  return _context.stop();
17537
17603
  }
17538
- }, _callee, null, [[3,, 8, 13]]);
17604
+ }, _callee);
17539
17605
  }));
17540
17606
  return function claimAssets(_x) {
17541
17607
  return _ref.apply(this, arguments);
@@ -17628,6 +17694,25 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
17628
17694
  }
17629
17695
  return build;
17630
17696
  }())
17697
+ }, {
17698
+ key: "disconnect",
17699
+ value: function () {
17700
+ var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
17701
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
17702
+ while (1) switch (_context2.prev = _context2.next) {
17703
+ case 0:
17704
+ return _context2.abrupt("return", this.api.disconnect(true));
17705
+ case 1:
17706
+ case "end":
17707
+ return _context2.stop();
17708
+ }
17709
+ }, _callee2, this);
17710
+ }));
17711
+ function disconnect() {
17712
+ return _disconnect.apply(this, arguments);
17713
+ }
17714
+ return disconnect;
17715
+ }()
17631
17716
  }], [{
17632
17717
  key: "create",
17633
17718
  value: function create(api, node) {
@@ -17944,6 +18029,25 @@ var GeneralBuilder = /*#__PURE__*/function () {
17944
18029
  }
17945
18030
  return dryRun;
17946
18031
  }()
18032
+ }, {
18033
+ key: "disconnect",
18034
+ value: function () {
18035
+ var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
18036
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
18037
+ while (1) switch (_context4.prev = _context4.next) {
18038
+ case 0:
18039
+ return _context4.abrupt("return", this.api.disconnect(true));
18040
+ case 1:
18041
+ case "end":
18042
+ return _context4.stop();
18043
+ }
18044
+ }, _callee4, this);
18045
+ }));
18046
+ function disconnect() {
18047
+ return _disconnect.apply(this, arguments);
18048
+ }
18049
+ return disconnect;
18050
+ }()
17947
18051
  }]);
17948
18052
  }();
17949
18053
  /**
@@ -18766,7 +18870,6 @@ var transferRelayToPara = /*#__PURE__*/function () {
18766
18870
  _context.next = 6;
18767
18871
  return api.init(origin);
18768
18872
  case 6:
18769
- _context.prev = 6;
18770
18873
  serializedApiCall = getNode(isMultiLocationDestination ? resolveTNodeFromMultiLocation(origin, destination) : destination).transferRelayToPara({
18771
18874
  api: api,
18772
18875
  origin: origin,
@@ -18779,21 +18882,11 @@ var transferRelayToPara = /*#__PURE__*/function () {
18779
18882
  method: method
18780
18883
  });
18781
18884
  return _context.abrupt("return", api.callTxMethod(serializedApiCall));
18782
- case 9:
18783
- _context.prev = 9;
18784
- if (!isPjsClient(api.getApi())) {
18785
- _context.next = 13;
18786
- break;
18787
- }
18788
- _context.next = 13;
18789
- return api.disconnect();
18790
- case 13:
18791
- return _context.finish(9);
18792
- case 14:
18885
+ case 8:
18793
18886
  case "end":
18794
18887
  return _context.stop();
18795
18888
  }
18796
- }, _callee, null, [[6,, 9, 14]]);
18889
+ }, _callee);
18797
18890
  }));
18798
18891
  return function transferRelayToPara(_x) {
18799
18892
  return _ref.apply(this, arguments);
@@ -18887,14 +18980,12 @@ var send = /*#__PURE__*/function () {
18887
18980
  _context.next = 20;
18888
18981
  return api.init(origin);
18889
18982
  case 20:
18890
- _context.prev = 20;
18891
18983
  // In case asset check is disabled, we create asset object from currency symbol
18892
18984
  resolvedAsset = asset !== null && asset !== void 0 ? asset : {
18893
18985
  symbol: 'symbol' in currency ? currency.symbol : undefined
18894
18986
  };
18895
18987
  originNode = getNode(origin);
18896
- _context.next = 25;
18897
- return originNode.transfer({
18988
+ return _context.abrupt("return", originNode.transfer({
18898
18989
  api: api,
18899
18990
  asset: _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
18900
18991
  amount: 'multiasset' in currency ? 0 : currency.amount
@@ -18907,24 +18998,12 @@ var send = /*#__PURE__*/function () {
18907
18998
  ahAddress: ahAddress,
18908
18999
  pallet: pallet,
18909
19000
  method: method
18910
- });
18911
- case 25:
18912
- return _context.abrupt("return", _context.sent);
18913
- case 26:
18914
- _context.prev = 26;
18915
- if (!isPjsClient(api.getApi())) {
18916
- _context.next = 30;
18917
- break;
18918
- }
18919
- _context.next = 30;
18920
- return api.disconnect();
18921
- case 30:
18922
- return _context.finish(26);
18923
- case 31:
19001
+ }));
19002
+ case 23:
18924
19003
  case "end":
18925
19004
  return _context.stop();
18926
19005
  }
18927
- }, _callee, null, [[20,, 26, 31]]);
19006
+ }, _callee);
18928
19007
  }));
18929
19008
  return function send(_x) {
18930
19009
  return _ref.apply(this, arguments);
package/dist/index.d.ts CHANGED
@@ -54,6 +54,7 @@ declare class Acala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
54
54
  }
55
55
 
56
56
  declare class Unique<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
57
+ private static NATIVE_ASSET_ID;
57
58
  constructor();
58
59
  transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
59
60
  }
@@ -640,8 +641,8 @@ type TSerializedApiCall = {
640
641
  parameters: Record<string, unknown>;
641
642
  };
642
643
  type TDestWeight = {
643
- refTime: string;
644
- proofSize: string;
644
+ ref_time: bigint;
645
+ proof_size: bigint;
645
646
  };
646
647
  type TXTransferSection = 'transfer';
647
648
  type TXTokensSection = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
@@ -736,8 +737,8 @@ declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPol
736
737
  }
737
738
 
738
739
  declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
740
+ private static NATIVE_ASSET_ID;
739
741
  constructor();
740
- _assetCheckEnabled: boolean;
741
742
  transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
742
743
  }
743
744
 
@@ -1059,6 +1060,7 @@ interface IFromBuilder<TApi, TRes> {
1059
1060
  from: (node: TNodeDotKsmWithRelayChains) => IToBuilder<TApi, TRes>;
1060
1061
  claimFrom: (node: TNodeWithRelayChains) => IFungibleBuilder<TRes>;
1061
1062
  buildBatch: (options?: TBatchOptions) => Promise<TRes>;
1063
+ disconnect: () => Promise<void>;
1062
1064
  }
1063
1065
  interface IToBuilder<TApi, TRes> {
1064
1066
  to: (node: TDestination, paraIdTo?: number) => ICurrencyBuilder<TApi, TRes>;
@@ -1067,6 +1069,7 @@ interface ICurrencyBuilder<TApi, TRes> {
1067
1069
  currency: (currency: TCurrencyInputWithAmount) => IAddressBuilder<TApi, TRes>;
1068
1070
  }
1069
1071
  interface IFinalBuilder<TRes> {
1072
+ disconnect: () => Promise<void>;
1070
1073
  build: () => Promise<TRes>;
1071
1074
  }
1072
1075
  interface IAddressBuilder<TApi, TRes> {
@@ -1087,6 +1090,7 @@ interface IAddToBatchBuilder<TApi, TRes> {
1087
1090
  interface IFinalBuilderWithOptions<TApi, TRes> extends IAddToBatchBuilder<TApi, TRes> {
1088
1091
  xcmVersion: (version: Version) => this;
1089
1092
  customPallet: (pallet: string, method: string) => this;
1093
+ disconnect: () => Promise<void>;
1090
1094
  build: () => Promise<TRes>;
1091
1095
  dryRun: () => Promise<TDryRunResult>;
1092
1096
  }
@@ -1301,7 +1305,7 @@ interface IPolkadotApi<TApi, TRes> {
1301
1305
  getDryRun(options: TDryRunBaseOptions<TRes>): Promise<TDryRunResult>;
1302
1306
  setDisconnectAllowed(allowed: boolean): void;
1303
1307
  getDisconnectAllowed(): boolean;
1304
- disconnect(): Promise<void>;
1308
+ disconnect(force?: boolean): Promise<void>;
1305
1309
  }
1306
1310
 
1307
1311
  declare const send: <TApi, TRes>(options: TSendOptions<TApi, TRes>) => Promise<TRes>;
@@ -1557,6 +1561,7 @@ declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICur
1557
1561
  */
1558
1562
  build(): Promise<TRes>;
1559
1563
  dryRun(): Promise<TDryRunResult>;
1564
+ disconnect(): Promise<void>;
1560
1565
  }
1561
1566
  /**
1562
1567
  * Creates a new Builder instance.
@@ -1723,4 +1728,4 @@ declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
1723
1728
  */
1724
1729
  declare const getParaId: (node: TNodeDotKsmWithRelayChains) => number;
1725
1730
 
1726
- 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 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 };
1731
+ 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 };
package/dist/index.mjs CHANGED
@@ -9652,6 +9652,81 @@ var Unique$3 = {
9652
9652
  }
9653
9653
  ],
9654
9654
  otherAssets: [
9655
+ {
9656
+ assetId: "459",
9657
+ symbol: "PINK",
9658
+ decimals: 10,
9659
+ multiLocation: {
9660
+ parents: 1,
9661
+ interior: {
9662
+ X3: [
9663
+ {
9664
+ Parachain: 1000
9665
+ },
9666
+ {
9667
+ PalletInstance: 50
9668
+ },
9669
+ {
9670
+ GeneralIndex: 23
9671
+ }
9672
+ ]
9673
+ }
9674
+ },
9675
+ existentialDeposit: "0"
9676
+ },
9677
+ {
9678
+ assetId: "473",
9679
+ symbol: "USDt",
9680
+ decimals: 6,
9681
+ multiLocation: {
9682
+ parents: 1,
9683
+ interior: {
9684
+ X3: [
9685
+ {
9686
+ Parachain: 1000
9687
+ },
9688
+ {
9689
+ PalletInstance: 50
9690
+ },
9691
+ {
9692
+ GeneralIndex: 1984
9693
+ }
9694
+ ]
9695
+ }
9696
+ },
9697
+ existentialDeposit: "0"
9698
+ },
9699
+ {
9700
+ assetId: "498",
9701
+ symbol: "GLMR",
9702
+ decimals: 18,
9703
+ multiLocation: {
9704
+ parents: 1,
9705
+ interior: {
9706
+ X2: [
9707
+ {
9708
+ Parachain: 2004
9709
+ },
9710
+ {
9711
+ PalletInstance: 10
9712
+ }
9713
+ ]
9714
+ }
9715
+ },
9716
+ existentialDeposit: "0"
9717
+ },
9718
+ {
9719
+ assetId: "437",
9720
+ symbol: "DOT",
9721
+ decimals: 10,
9722
+ multiLocation: {
9723
+ parents: 1,
9724
+ interior: {
9725
+ Here: null
9726
+ }
9727
+ },
9728
+ existentialDeposit: "0"
9729
+ }
9655
9730
  ]
9656
9731
  };
9657
9732
  var Crust$3 = {
@@ -13584,16 +13659,17 @@ var Unique$1 = /*#__PURE__*/function (_ParachainNode) {
13584
13659
  key: "transferXTokens",
13585
13660
  value: function transferXTokens(input) {
13586
13661
  var asset = input.asset;
13662
+ if (asset.symbol === this.getNativeAssetSymbol()) {
13663
+ return XTokensTransferImpl.transferXTokens(input, Unique.NATIVE_ASSET_ID);
13664
+ }
13587
13665
  if (!isForeignAsset(asset) || !asset.assetId) {
13588
13666
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
13589
13667
  }
13590
- var currencySelection = {
13591
- ForeignAssetId: BigInt(asset.assetId)
13592
- };
13593
- return XTokensTransferImpl.transferXTokens(input, currencySelection);
13668
+ return XTokensTransferImpl.transferXTokens(input, Number(asset.assetId));
13594
13669
  }
13595
13670
  }]);
13596
13671
  }(ParachainNode);
13672
+ Unique$1.NATIVE_ASSET_ID = 0;
13597
13673
 
13598
13674
  var Crust$1 = /*#__PURE__*/function (_ParachainNode) {
13599
13675
  function Crust() {
@@ -15136,20 +15212,25 @@ var Crab$1 = /*#__PURE__*/function (_ParachainNode) {
15136
15212
 
15137
15213
  var Quartz$1 = /*#__PURE__*/function (_ParachainNode) {
15138
15214
  function Quartz() {
15139
- var _this;
15140
15215
  _classCallCheck(this, Quartz);
15141
- _this = _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', Version.V3]);
15142
- _this._assetCheckEnabled = false;
15143
- return _this;
15216
+ return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', Version.V3]);
15144
15217
  }
15145
15218
  _inherits(Quartz, _ParachainNode);
15146
15219
  return _createClass(Quartz, [{
15147
15220
  key: "transferXTokens",
15148
15221
  value: function transferXTokens(input) {
15149
- return getNode('Unique').transferXTokens(input);
15222
+ var asset = input.asset;
15223
+ if (asset.symbol === this.getNativeAssetSymbol()) {
15224
+ return XTokensTransferImpl.transferXTokens(input, Quartz.NATIVE_ASSET_ID);
15225
+ }
15226
+ if (!isForeignAsset(asset) || !asset.assetId) {
15227
+ throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
15228
+ }
15229
+ return XTokensTransferImpl.transferXTokens(input, Number(asset.assetId));
15150
15230
  }
15151
15231
  }]);
15152
15232
  }(ParachainNode);
15233
+ Quartz$1.NATIVE_ASSET_ID = 0;
15153
15234
 
15154
15235
  var Shiden$1 = /*#__PURE__*/function (_ParachainNode) {
15155
15236
  function Shiden() {
@@ -15338,14 +15419,14 @@ var Collectives$1 = /*#__PURE__*/function (_ParachainNode) {
15338
15419
  var determineDestWeight = function determineDestWeight(destNode) {
15339
15420
  if (destNode === 'Astar') {
15340
15421
  return {
15341
- refTime: '6000000000',
15342
- proofSize: '1000000'
15422
+ ref_time: 6000000000n,
15423
+ proof_size: 1000000n
15343
15424
  };
15344
15425
  }
15345
15426
  if (destNode === 'Moonbeam' || destNode === 'Hydration') {
15346
15427
  return {
15347
- refTime: '5000000000',
15348
- proofSize: '0'
15428
+ ref_time: 5000000000n,
15429
+ proof_size: 0n
15349
15430
  };
15350
15431
  }
15351
15432
  throw new NodeNotSupportedError("Node ".concat(destNode, " is not supported"));
@@ -15425,7 +15506,7 @@ var Khala$1 = /*#__PURE__*/function (_ParachainNode) {
15425
15506
  key: "transferXTransfer",
15426
15507
  value: function transferXTransfer(input) {
15427
15508
  var asset = input.asset;
15428
- if (asset.symbol !== 'PHA') {
15509
+ if (asset.symbol !== this.getNativeAssetSymbol()) {
15429
15510
  throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(asset.symbol));
15430
15511
  }
15431
15512
  return XTransferTransferImpl.transferXTransfer(input);
@@ -17463,10 +17544,6 @@ var getAssetBalance = /*#__PURE__*/function () {
17463
17544
  };
17464
17545
  }();
17465
17546
 
17466
- var isPjsClient = function isPjsClient(api) {
17467
- return _typeof(api) === 'object' && api !== null && 'disconnect' in api && typeof api.disconnect === 'function';
17468
- };
17469
-
17470
17547
  var buildBeneficiaryInput = function buildBeneficiaryInput(api, address) {
17471
17548
  if (isTMultiLocation(address)) {
17472
17549
  return address;
@@ -17510,7 +17587,6 @@ var claimAssets = /*#__PURE__*/function () {
17510
17587
  _context.next = 3;
17511
17588
  return api.init(node);
17512
17589
  case 3:
17513
- _context.prev = 3;
17514
17590
  args = buildClaimAssetsInput(options);
17515
17591
  module = isRelayChain(node) ? 'XcmPallet' : 'PolkadotXcm';
17516
17592
  call = {
@@ -17519,21 +17595,11 @@ var claimAssets = /*#__PURE__*/function () {
17519
17595
  parameters: args
17520
17596
  };
17521
17597
  return _context.abrupt("return", api.callTxMethod(call));
17522
- case 8:
17523
- _context.prev = 8;
17524
- if (!isPjsClient(api.getApi())) {
17525
- _context.next = 12;
17526
- break;
17527
- }
17528
- _context.next = 12;
17529
- return api.disconnect();
17530
- case 12:
17531
- return _context.finish(8);
17532
- case 13:
17598
+ case 7:
17533
17599
  case "end":
17534
17600
  return _context.stop();
17535
17601
  }
17536
- }, _callee, null, [[3,, 8, 13]]);
17602
+ }, _callee);
17537
17603
  }));
17538
17604
  return function claimAssets(_x) {
17539
17605
  return _ref.apply(this, arguments);
@@ -17626,6 +17692,25 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
17626
17692
  }
17627
17693
  return build;
17628
17694
  }())
17695
+ }, {
17696
+ key: "disconnect",
17697
+ value: function () {
17698
+ var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
17699
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
17700
+ while (1) switch (_context2.prev = _context2.next) {
17701
+ case 0:
17702
+ return _context2.abrupt("return", this.api.disconnect(true));
17703
+ case 1:
17704
+ case "end":
17705
+ return _context2.stop();
17706
+ }
17707
+ }, _callee2, this);
17708
+ }));
17709
+ function disconnect() {
17710
+ return _disconnect.apply(this, arguments);
17711
+ }
17712
+ return disconnect;
17713
+ }()
17629
17714
  }], [{
17630
17715
  key: "create",
17631
17716
  value: function create(api, node) {
@@ -17942,6 +18027,25 @@ var GeneralBuilder = /*#__PURE__*/function () {
17942
18027
  }
17943
18028
  return dryRun;
17944
18029
  }()
18030
+ }, {
18031
+ key: "disconnect",
18032
+ value: function () {
18033
+ var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
18034
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
18035
+ while (1) switch (_context4.prev = _context4.next) {
18036
+ case 0:
18037
+ return _context4.abrupt("return", this.api.disconnect(true));
18038
+ case 1:
18039
+ case "end":
18040
+ return _context4.stop();
18041
+ }
18042
+ }, _callee4, this);
18043
+ }));
18044
+ function disconnect() {
18045
+ return _disconnect.apply(this, arguments);
18046
+ }
18047
+ return disconnect;
18048
+ }()
17945
18049
  }]);
17946
18050
  }();
17947
18051
  /**
@@ -18764,7 +18868,6 @@ var transferRelayToPara = /*#__PURE__*/function () {
18764
18868
  _context.next = 6;
18765
18869
  return api.init(origin);
18766
18870
  case 6:
18767
- _context.prev = 6;
18768
18871
  serializedApiCall = getNode(isMultiLocationDestination ? resolveTNodeFromMultiLocation(origin, destination) : destination).transferRelayToPara({
18769
18872
  api: api,
18770
18873
  origin: origin,
@@ -18777,21 +18880,11 @@ var transferRelayToPara = /*#__PURE__*/function () {
18777
18880
  method: method
18778
18881
  });
18779
18882
  return _context.abrupt("return", api.callTxMethod(serializedApiCall));
18780
- case 9:
18781
- _context.prev = 9;
18782
- if (!isPjsClient(api.getApi())) {
18783
- _context.next = 13;
18784
- break;
18785
- }
18786
- _context.next = 13;
18787
- return api.disconnect();
18788
- case 13:
18789
- return _context.finish(9);
18790
- case 14:
18883
+ case 8:
18791
18884
  case "end":
18792
18885
  return _context.stop();
18793
18886
  }
18794
- }, _callee, null, [[6,, 9, 14]]);
18887
+ }, _callee);
18795
18888
  }));
18796
18889
  return function transferRelayToPara(_x) {
18797
18890
  return _ref.apply(this, arguments);
@@ -18885,14 +18978,12 @@ var send = /*#__PURE__*/function () {
18885
18978
  _context.next = 20;
18886
18979
  return api.init(origin);
18887
18980
  case 20:
18888
- _context.prev = 20;
18889
18981
  // In case asset check is disabled, we create asset object from currency symbol
18890
18982
  resolvedAsset = asset !== null && asset !== void 0 ? asset : {
18891
18983
  symbol: 'symbol' in currency ? currency.symbol : undefined
18892
18984
  };
18893
18985
  originNode = getNode(origin);
18894
- _context.next = 25;
18895
- return originNode.transfer({
18986
+ return _context.abrupt("return", originNode.transfer({
18896
18987
  api: api,
18897
18988
  asset: _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
18898
18989
  amount: 'multiasset' in currency ? 0 : currency.amount
@@ -18905,24 +18996,12 @@ var send = /*#__PURE__*/function () {
18905
18996
  ahAddress: ahAddress,
18906
18997
  pallet: pallet,
18907
18998
  method: method
18908
- });
18909
- case 25:
18910
- return _context.abrupt("return", _context.sent);
18911
- case 26:
18912
- _context.prev = 26;
18913
- if (!isPjsClient(api.getApi())) {
18914
- _context.next = 30;
18915
- break;
18916
- }
18917
- _context.next = 30;
18918
- return api.disconnect();
18919
- case 30:
18920
- return _context.finish(26);
18921
- case 31:
18999
+ }));
19000
+ case 23:
18922
19001
  case "end":
18923
19002
  return _context.stop();
18924
19003
  }
18925
- }, _callee, null, [[20,, 26, 31]]);
19004
+ }, _callee);
18926
19005
  }));
18927
19006
  return function send(_x) {
18928
19007
  return _ref.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-core",
3
- "version": "8.0.3",
3
+ "version": "8.1.0",
4
4
  "description": "SDK core for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",