@paraspell/sdk-core 11.2.2 → 11.2.4

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
@@ -326,19 +326,17 @@ function _regeneratorDefine(e, r, n, t) {
326
326
  i = 0;
327
327
  }
328
328
  _regeneratorDefine = function (e, r, n, t) {
329
- if (r) i ? i(e, r, {
329
+ function o(r, n) {
330
+ _regeneratorDefine(e, r, function (e) {
331
+ return this._invoke(r, n, e);
332
+ });
333
+ }
334
+ r ? i ? i(e, r, {
330
335
  value: n,
331
336
  enumerable: !t,
332
337
  configurable: !t,
333
338
  writable: !t
334
- }) : e[r] = n;else {
335
- function o(r, n) {
336
- _regeneratorDefine(e, r, function (e) {
337
- return this._invoke(r, n, e);
338
- });
339
- }
340
- o("next", 0), o("throw", 1), o("return", 2);
341
- }
339
+ }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
342
340
  }, _regeneratorDefine(e, r, n, t);
343
341
  }
344
342
  function _setPrototypeOf(t, e) {
@@ -5606,21 +5604,17 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5606
5604
  initialDestParaId = _yield$getOriginXcmFe.destParaId;
5607
5605
  originWeight = _yield$getOriginXcmFe.weight;
5608
5606
  sufficientOriginFee = _yield$getOriginXcmFe.sufficient;
5609
- api.setDisconnectAllowed(true);
5610
- _context2.n = 2;
5611
- return api.disconnect();
5612
- case 2:
5613
5607
  if (!(originDryRunError || originFeeType === 'paymentInfo')) {
5614
- _context2.n = 8;
5608
+ _context2.n = 7;
5615
5609
  break;
5616
5610
  }
5617
5611
  destApi = api.clone();
5618
- _context2.p = 3;
5619
- _context2.n = 4;
5612
+ _context2.p = 2;
5613
+ _context2.n = 3;
5620
5614
  return destApi.init(destination, DRY_RUN_CLIENT_TIMEOUT_MS);
5621
- case 4:
5615
+ case 3:
5622
5616
  destApi.setDisconnectAllowed(false);
5623
- _context2.n = 5;
5617
+ _context2.n = 4;
5624
5618
  return getDestXcmFee({
5625
5619
  api: destApi,
5626
5620
  forwardedXcms: undefined,
@@ -5637,7 +5631,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5637
5631
  senderAddress: senderAddress,
5638
5632
  disableFallback: disableFallback
5639
5633
  });
5640
- case 5:
5634
+ case 4:
5641
5635
  destFeeRes = _context2.v;
5642
5636
  _result = {
5643
5637
  origin: _objectSpread2(_objectSpread2(_objectSpread2({}, originFee && {
@@ -5671,14 +5665,14 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5671
5665
  failureChain: _failureChain,
5672
5666
  failureReason: _failureReason
5673
5667
  }));
5674
- case 6:
5675
- _context2.p = 6;
5668
+ case 5:
5669
+ _context2.p = 5;
5676
5670
  destApi.setDisconnectAllowed(true);
5677
- _context2.n = 7;
5671
+ _context2.n = 6;
5678
5672
  return destApi.disconnect();
5673
+ case 6:
5674
+ return _context2.f(5);
5679
5675
  case 7:
5680
- return _context2.f(6);
5681
- case 8:
5682
5676
  processHop = /*#__PURE__*/function () {
5683
5677
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
5684
5678
  var hopApi, currentChain, currentOrigin, currentAsset, forwardedXcms, hasPassedExchange, hopResult, hopCurrency;
@@ -5726,7 +5720,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5726
5720
  return _ref3.apply(this, arguments);
5727
5721
  };
5728
5722
  }();
5729
- _context2.n = 9;
5723
+ _context2.n = 8;
5730
5724
  return traverseXcmHops({
5731
5725
  api: api,
5732
5726
  origin: origin,
@@ -5746,14 +5740,14 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5746
5740
  };
5747
5741
  }
5748
5742
  });
5749
- case 9:
5743
+ case 8:
5750
5744
  traversalResult = _context2.v;
5751
5745
  // Handle case where we failed before reaching destination
5752
5746
  destFee = 0n;
5753
5747
  destFeeType = destination === 'Ethereum' ? 'noFeeRequired' : 'paymentInfo';
5754
5748
  destSufficient = undefined;
5755
5749
  if (!traversalResult.destination) {
5756
- _context2.n = 10;
5750
+ _context2.n = 9;
5757
5751
  break;
5758
5752
  }
5759
5753
  destResult = traversalResult.destination;
@@ -5762,23 +5756,23 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5762
5756
  destDryRunError = destResult.dryRunError;
5763
5757
  destSufficient = destResult.sufficient;
5764
5758
  destCurrency = destResult.currency;
5765
- _context2.n = 14;
5759
+ _context2.n = 13;
5766
5760
  break;
5767
- case 10:
5761
+ case 9:
5768
5762
  if (!(traversalResult.hops.length > 0 && traversalResult.hops[traversalResult.hops.length - 1].result.dryRunError)) {
5769
- _context2.n = 13;
5763
+ _context2.n = 12;
5770
5764
  break;
5771
5765
  }
5772
5766
  // We failed before reaching destination, use fallback
5773
5767
  _destApi = api.clone();
5774
5768
  if (!(destination !== 'Ethereum')) {
5775
- _context2.n = 11;
5769
+ _context2.n = 10;
5776
5770
  break;
5777
5771
  }
5778
- _context2.n = 11;
5772
+ _context2.n = 10;
5779
5773
  return _destApi.init(destination, DRY_RUN_CLIENT_TIMEOUT_MS);
5780
- case 11:
5781
- _context2.n = 12;
5774
+ case 10:
5775
+ _context2.n = 11;
5782
5776
  return getDestXcmFee({
5783
5777
  api: _destApi,
5784
5778
  forwardedXcms: undefined,
@@ -5794,25 +5788,25 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5794
5788
  senderAddress: senderAddress,
5795
5789
  disableFallback: disableFallback
5796
5790
  });
5797
- case 12:
5791
+ case 11:
5798
5792
  destFallback = _context2.v;
5799
5793
  destFee = destFallback.fee;
5800
5794
  destFeeType = destFallback.feeType;
5801
5795
  destSufficient = destFallback.sufficient;
5802
5796
  destCurrency = assets.getNativeAssetSymbol(destination);
5803
- _context2.n = 14;
5797
+ _context2.n = 13;
5804
5798
  break;
5805
- case 13:
5799
+ case 12:
5806
5800
  destFee = 0n;
5807
5801
  destFeeType = 'noFeeRequired';
5808
5802
  destSufficient = true;
5809
5803
  destCurrency = assets.getNativeAssetSymbol(destination);
5810
- case 14:
5804
+ case 13:
5811
5805
  // Process Ethereum bridge fees
5812
5806
  assetHubChain = "AssetHub".concat(getRelayChainOf(origin));
5813
- _context2.n = 15;
5807
+ _context2.n = 14;
5814
5808
  return addEthereumBridgeFees(api, traversalResult.bridgeHub, destination, assetHubChain);
5815
- case 15:
5809
+ case 14:
5816
5810
  processedBridgeHub = _context2.v;
5817
5811
  // Update bridge hub fee in hops if needed
5818
5812
  if (processedBridgeHub && traversalResult.bridgeHub && processedBridgeHub.fee !== traversalResult.bridgeHub.fee) {
@@ -5886,7 +5880,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5886
5880
  failureReason: failureReason
5887
5881
  }));
5888
5882
  }
5889
- }, _callee2, null, [[3,, 6, 8]]);
5883
+ }, _callee2, null, [[2,, 5, 7]]);
5890
5884
  }));
5891
5885
  return function getXcmFeeInternal(_x, _x2) {
5892
5886
  return _ref2.apply(this, arguments);
@@ -5896,7 +5890,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5896
5890
  var getXcmFee = /*#__PURE__*/function () {
5897
5891
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
5898
5892
  var _real$assetHub, _real$bridgeHub;
5899
- var forced, real;
5893
+ var forced, real, api;
5900
5894
  return _regenerator().w(function (_context) {
5901
5895
  while (1) switch (_context.n) {
5902
5896
  case 0:
@@ -5908,6 +5902,10 @@ var getXcmFee = /*#__PURE__*/function () {
5908
5902
  return getXcmFeeInternal(options, false);
5909
5903
  case 2:
5910
5904
  real = _context.v;
5905
+ api = options.api;
5906
+ _context.n = 3;
5907
+ return api.disconnect();
5908
+ case 3:
5911
5909
  return _context.a(2, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, forced), {}, {
5912
5910
  origin: _objectSpread2(_objectSpread2({}, forced.origin), {}, {
5913
5911
  sufficient: real.origin.sufficient
@@ -6221,7 +6219,7 @@ var FEE_PADDING_PERCENTAGE$2 = 20;
6221
6219
  var FEE_PADDING_HYDRATION = 150;
6222
6220
  var computeInstructionFee = /*#__PURE__*/function () {
6223
6221
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref, version, xcm) {
6224
- var chain, api, _t, _t2, _t3;
6222
+ var chain, api, _t;
6225
6223
  return _regenerator().w(function (_context) {
6226
6224
  while (1) switch (_context.n) {
6227
6225
  case 0:
@@ -6232,9 +6230,7 @@ var computeInstructionFee = /*#__PURE__*/function () {
6232
6230
  location: DOT_LOCATION
6233
6231
  }, true);
6234
6232
  case 1:
6235
- _t2 = _context.v;
6236
- _t3 = chain === 'Hydration' ? FEE_PADDING_HYDRATION : FEE_PADDING_PERCENTAGE$2;
6237
- return _context.a(2, _t(_t2, _t3));
6233
+ return _context.a(2, _t(_context.v, chain === 'Hydration' ? FEE_PADDING_HYDRATION : FEE_PADDING_PERCENTAGE$2));
6238
6234
  }
6239
6235
  }, _callee);
6240
6236
  }));
@@ -6244,7 +6240,7 @@ var computeInstructionFee = /*#__PURE__*/function () {
6244
6240
  }();
6245
6241
  var computeAllFees = /*#__PURE__*/function () {
6246
6242
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3, customXcm, isDotAsset, refundInstruction) {
6247
- var reserve, dest, version, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10;
6243
+ var reserve, dest, version, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0;
6248
6244
  return _regenerator().w(function (_context2) {
6249
6245
  while (1) switch (_context2.n) {
6250
6246
  case 0:
@@ -6256,7 +6252,7 @@ var computeAllFees = /*#__PURE__*/function () {
6256
6252
  _context2.n = 1;
6257
6253
  return computeInstructionFee(reserve, version, [customXcm]);
6258
6254
  case 1:
6259
- _t5 = _context2.v;
6255
+ _t3 = _context2.v;
6260
6256
  if (!refundInstruction) {
6261
6257
  _context2.n = 3;
6262
6258
  break;
@@ -6264,21 +6260,21 @@ var computeAllFees = /*#__PURE__*/function () {
6264
6260
  _context2.n = 2;
6265
6261
  return computeInstructionFee(reserve, version, [refundInstruction]);
6266
6262
  case 2:
6267
- _t6 = _context2.v;
6263
+ _t4 = _context2.v;
6268
6264
  _context2.n = 4;
6269
6265
  break;
6270
6266
  case 3:
6271
- _t6 = 0n;
6267
+ _t4 = 0n;
6272
6268
  case 4:
6273
- _t7 = _t6;
6269
+ _t5 = _t4;
6274
6270
  _context2.n = 5;
6275
6271
  return computeInstructionFee(assets.hasXcmPaymentApiSupport(dest.chain) ? dest : reserve, version, customXcm.DepositReserveAsset.xcm);
6276
6272
  case 5:
6277
- _t8 = _context2.v;
6278
- _t4 = {
6279
- reserveFee: _t5,
6280
- refundFee: _t7,
6281
- destFee: _t8
6273
+ _t6 = _context2.v;
6274
+ _t2 = {
6275
+ reserveFee: _t3,
6276
+ refundFee: _t5,
6277
+ destFee: _t6
6282
6278
  };
6283
6279
  _context2.n = 13;
6284
6280
  break;
@@ -6290,13 +6286,13 @@ var computeAllFees = /*#__PURE__*/function () {
6290
6286
  _context2.n = 7;
6291
6287
  return computeInstructionFee(assets.hasXcmPaymentApiSupport(dest.chain) ? dest : reserve, version, [customXcm]);
6292
6288
  case 7:
6293
- _t9 = _context2.v;
6289
+ _t7 = _context2.v;
6294
6290
  _context2.n = 9;
6295
6291
  break;
6296
6292
  case 8:
6297
- _t9 = 0n;
6293
+ _t7 = 0n;
6298
6294
  case 9:
6299
- _t0 = _t9;
6295
+ _t8 = _t7;
6300
6296
  if (isDotAsset) {
6301
6297
  _context2.n = 11;
6302
6298
  break;
@@ -6304,20 +6300,20 @@ var computeAllFees = /*#__PURE__*/function () {
6304
6300
  _context2.n = 10;
6305
6301
  return computeInstructionFee(assets.hasXcmPaymentApiSupport(reserve.chain) ? reserve : dest, version, [refundInstruction]);
6306
6302
  case 10:
6307
- _t1 = _context2.v;
6303
+ _t9 = _context2.v;
6308
6304
  _context2.n = 12;
6309
6305
  break;
6310
6306
  case 11:
6311
- _t1 = 0n;
6307
+ _t9 = 0n;
6312
6308
  case 12:
6313
- _t10 = _t1;
6314
- _t4 = {
6309
+ _t0 = _t9;
6310
+ _t2 = {
6315
6311
  reserveFee: 0n,
6316
- destFee: _t0,
6317
- refundFee: _t10
6312
+ destFee: _t8,
6313
+ refundFee: _t0
6318
6314
  };
6319
6315
  case 13:
6320
- return _context2.a(2, _t4);
6316
+ return _context2.a(2, _t2);
6321
6317
  }
6322
6318
  }, _callee2);
6323
6319
  }));
@@ -8312,20 +8308,21 @@ var Parachain = /*#__PURE__*/function () {
8312
8308
  key: "canUseXTokens",
8313
8309
  value: function canUseXTokens(options) {
8314
8310
  var asset = options.assetInfo;
8315
- var isEthAsset = asset.location && assets.findAssetInfoByLoc(assets.getOtherAssets('Ethereum'), asset.location);
8316
- return !isEthAsset && !this.shouldUseNativeAssetTeleport(options);
8311
+ var isExternalAsset = asset.location && asset.location.parents === sdkCommon.Parents.TWO;
8312
+ return !isExternalAsset && !this.shouldUseNativeAssetTeleport(options);
8317
8313
  }
8318
8314
  }, {
8319
8315
  key: "transfer",
8320
8316
  value: function () {
8321
8317
  var _transfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(sendOptions) {
8322
- var api, asset, currency, feeAsset, feeCurrency, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, scenario, paraId, isLocalTransfer, isBifrostOrigin, isJamtonOrigin, isAssetHubDest, useMultiAssets, input, options, shouldUseTeleport, isAHPOrigin, isAHPDest, isEthAsset, isEthDest, isEthAssetViaAh, isEthAssetToAh, call;
8318
+ var api, asset, currency, feeAsset, feeCurrency, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, scenario, paraId, destChain, isLocalTransfer, isBifrostOrigin, isJamtonOrigin, isAssetHubDest, useMultiAssets, input, options, shouldUseTeleport, isAhToOtherPara, isOtherParaToAh, isAHPOrigin, isAHPDest, isExternalAsset, isEthDest, isExternalAssetViaAh, isExternalAssetToAh, call;
8323
8319
  return _regenerator().w(function (_context) {
8324
8320
  while (1) switch (_context.n) {
8325
8321
  case 0:
8326
8322
  api = sendOptions.api, asset = sendOptions.assetInfo, currency = sendOptions.currency, feeAsset = sendOptions.feeAsset, feeCurrency = sendOptions.feeCurrency, address = sendOptions.address, destination = sendOptions.to, paraIdTo = sendOptions.paraIdTo, overriddenAsset = sendOptions.overriddenAsset, version = sendOptions.version, senderAddress = sendOptions.senderAddress, ahAddress = sendOptions.ahAddress, pallet = sendOptions.pallet, method = sendOptions.method;
8327
8323
  scenario = resolveScenario(this.chain, destination);
8328
8324
  paraId = resolveParaId(paraIdTo, destination);
8325
+ destChain = paraId ? getTChain(paraId, getRelayChainOf(this.chain)) : undefined;
8329
8326
  if (!(destination === 'Polimec' && this.chain !== 'AssetHubPolkadot' && this.chain !== 'Hydration' && this.chain !== destination)) {
8330
8327
  _context.n = 1;
8331
8328
  break;
@@ -8405,6 +8402,7 @@ var Parachain = /*#__PURE__*/function () {
8405
8402
  feeCurrency: feeCurrency,
8406
8403
  scenario: scenario,
8407
8404
  destination: destination,
8405
+ destChain: destChain,
8408
8406
  paraIdTo: paraId,
8409
8407
  version: version,
8410
8408
  senderAddress: senderAddress,
@@ -8413,7 +8411,9 @@ var Parachain = /*#__PURE__*/function () {
8413
8411
  method: method
8414
8412
  };
8415
8413
  shouldUseTeleport = this.shouldUseNativeAssetTeleport(sendOptions);
8416
- if (!((this.chain.includes('AssetHub') && destination !== 'Mythos' && typeof destination === 'string' && !sdkCommon.isSystemChain(destination) || !sdkCommon.isSystemChain(this.chain) && this.chain !== 'Mythos' && typeof destination === 'string' && destination.includes('AssetHub')) && shouldUseTeleport)) {
8414
+ isAhToOtherPara = this.chain.startsWith('AssetHub') && destChain && destChain !== 'Mythos' && !sdkCommon.isSystemChain(destChain);
8415
+ isOtherParaToAh = (destChain === null || destChain === void 0 ? void 0 : destChain.startsWith('AssetHub')) && this.chain !== 'Mythos' && !sdkCommon.isSystemChain(this.chain);
8416
+ if (!((isAhToOtherPara || isOtherParaToAh) && shouldUseTeleport)) {
8417
8417
  _context.n = 6;
8418
8418
  break;
8419
8419
  }
@@ -8421,11 +8421,11 @@ var Parachain = /*#__PURE__*/function () {
8421
8421
  case 6:
8422
8422
  isAHPOrigin = this.chain.includes('AssetHub');
8423
8423
  isAHPDest = !sdkCommon.isTLocation(destination) && destination.includes('AssetHub'); // Handle common cases
8424
- isEthAsset = asset.location && assets.findAssetInfoByLoc(assets.getOtherAssets('Ethereum'), asset.location);
8425
- isEthDest = destination === 'Ethereum'; // Eth asset - Any origin to any dest via AH - DestinationReserve - multiple instructions
8426
- isEthAssetViaAh = isEthAsset && !isAHPOrigin && !isAHPDest && !isEthDest && !feeAsset; // Eth asset - Any origin to AHP - DestinationReserve - one DepositAsset instruction
8427
- isEthAssetToAh = isEthAsset && isAHPDest && !isAHPOrigin && !isEthDest && !feeAsset;
8428
- if (!(isEthAssetViaAh || isEthAssetToAh)) {
8424
+ isExternalAsset = asset.location && asset.location.parents === sdkCommon.Parents.TWO;
8425
+ isEthDest = destination === 'Ethereum'; // External asset - Any origin to any dest via AH - DestinationReserve - multiple instructions
8426
+ isExternalAssetViaAh = isExternalAsset && !isAHPOrigin && !isAHPDest && !isEthDest && !feeAsset; // External asset - Any origin to AHP - DestinationReserve - one DepositAsset instruction
8427
+ isExternalAssetToAh = isExternalAsset && isAHPDest && !isAHPOrigin && !isEthDest && !feeAsset;
8428
+ if (!(isExternalAssetViaAh || isExternalAssetToAh)) {
8429
8429
  _context.n = 8;
8430
8430
  break;
8431
8431
  }
@@ -8490,9 +8490,11 @@ var Parachain = /*#__PURE__*/function () {
8490
8490
  }
8491
8491
  }, {
8492
8492
  key: "createCurrencySpec",
8493
- value: function createCurrencySpec(amount, scenario, version, _asset, _isOverridenAsset) {
8493
+ value: function createCurrencySpec(amount, scenario, version, asset, _isOverridenAsset) {
8494
+ var isRelayAsset = sdkCommon.deepEqual(asset === null || asset === void 0 ? void 0 : asset.location, RELAY_LOCATION);
8495
+ var parents = scenario === 'ParaToRelay' || isRelayAsset && sdkCommon.isSystemChain(this.chain) ? sdkCommon.Parents.ONE : sdkCommon.Parents.ZERO;
8494
8496
  return createAsset(version, amount, {
8495
- parents: scenario === 'ParaToRelay' ? sdkCommon.Parents.ONE : sdkCommon.Parents.ZERO,
8497
+ parents: parents,
8496
8498
  interior: 'Here'
8497
8499
  });
8498
8500
  }
@@ -8770,7 +8772,7 @@ var Ajuna = /*#__PURE__*/function (_Parachain) {
8770
8772
  key: "transferPolkadotXCM",
8771
8773
  value: function () {
8772
8774
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
8773
- var api, _t, _t2;
8775
+ var api, _t;
8774
8776
  return _regenerator().w(function (_context) {
8775
8777
  while (1) switch (_context.n) {
8776
8778
  case 0:
@@ -8779,8 +8781,7 @@ var Ajuna = /*#__PURE__*/function (_Parachain) {
8779
8781
  _context.n = 1;
8780
8782
  return createTypeAndThenCall(this.chain, input);
8781
8783
  case 1:
8782
- _t2 = _context.v;
8783
- return _context.a(2, _t.callTxMethod.call(_t, _t2));
8784
+ return _context.a(2, _t.callTxMethod.call(_t, _context.v));
8784
8785
  }
8785
8786
  }, _callee, this);
8786
8787
  }));
@@ -9186,7 +9187,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
9186
9187
  key: "transferPolkadotXCM",
9187
9188
  value: function () {
9188
9189
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options) {
9189
- var api, scenario, assetInfo, destination, feeAssetInfo, overriddenAsset, call, isNativeAsset, isNativeFeeAsset, isEthereumAsset, _call, CHAINS_SUPPORT_DOT_TRANSFER, isTrusted, isDotReserveAh, method, modifiedInput, _t, _t2, _t3, _t4;
9190
+ var api, scenario, assetInfo, destination, feeAssetInfo, overriddenAsset, call, isNativeAsset, isNativeFeeAsset, isExternalAsset, _call, CHAINS_SUPPORT_DOT_TRANSFER, isTrusted, isDotReserveAh, method, modifiedInput, _t, _t2;
9190
9191
  return _regenerator().w(function (_context3) {
9191
9192
  while (1) switch (_context3.n) {
9192
9193
  case 0:
@@ -9221,8 +9222,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
9221
9222
  _context3.n = 4;
9222
9223
  return handleExecuteTransfer(this.chain, options);
9223
9224
  case 4:
9224
- _t2 = _context3.v;
9225
- return _context3.a(2, _t.callTxMethod.call(_t, _t2));
9225
+ return _context3.a(2, _t.callTxMethod.call(_t, _context3.v));
9226
9226
  case 5:
9227
9227
  if (!(destination === 'AssetHubKusama')) {
9228
9228
  _context3.n = 6;
@@ -9242,8 +9242,8 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
9242
9242
  }
9243
9243
  return _context3.a(2, this.handleMythosTransfer(options));
9244
9244
  case 8:
9245
- isEthereumAsset = assetInfo.location && assets.findAssetInfoByLoc(assets.getOtherAssets('Ethereum'), assetInfo.location);
9246
- if (!isEthereumAsset) {
9245
+ isExternalAsset = assetInfo.location && assetInfo.location.parents === sdkCommon.Parents.TWO;
9246
+ if (!isExternalAsset) {
9247
9247
  _context3.n = 10;
9248
9248
  break;
9249
9249
  }
@@ -9273,12 +9273,11 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
9273
9273
  _context3.n = 14;
9274
9274
  break;
9275
9275
  }
9276
- _t3 = api;
9276
+ _t2 = api;
9277
9277
  _context3.n = 13;
9278
9278
  return createTypeAndThenCall(this.chain, options);
9279
9279
  case 13:
9280
- _t4 = _context3.v;
9281
- return _context3.a(2, _t3.callTxMethod.call(_t3, _t4));
9280
+ return _context3.a(2, _t2.callTxMethod.call(_t2, _context3.v));
9282
9281
  case 14:
9283
9282
  modifiedInput = this.patchInput(options);
9284
9283
  return _context3.a(2, transferPolkadotXcm(modifiedInput, method, 'Unlimited'));
@@ -9515,7 +9514,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
9515
9514
  key: "transferToAssetHub",
9516
9515
  value: function () {
9517
9516
  var _transferToAssetHub = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
9518
- var api, assetInfo, _t, _t2;
9517
+ var api, assetInfo, _t;
9519
9518
  return _regenerator().w(function (_context) {
9520
9519
  while (1) switch (_context.n) {
9521
9520
  case 0:
@@ -9528,8 +9527,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
9528
9527
  _context.n = 1;
9529
9528
  return createTypeAndThenCall(this.chain, input);
9530
9529
  case 1:
9531
- _t2 = _context.v;
9532
- return _context.a(2, _t.callTxMethod.call(_t, _t2));
9530
+ return _context.a(2, _t.callTxMethod.call(_t, _context.v));
9533
9531
  case 2:
9534
9532
  assertHasLocation(assetInfo);
9535
9533
  return _context.a(2, transferPolkadotXcm(_objectSpread2(_objectSpread2({}, input), {}, {
@@ -9633,19 +9631,11 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_Parachain) {
9633
9631
  key: "transferPolkadotXCM",
9634
9632
  value: function transferPolkadotXCM(input) {
9635
9633
  var scenario = input.scenario,
9636
- destination = input.destination;
9637
- var newOverridenAsset = {
9638
- parents: 1,
9639
- interior: {
9640
- Here: null
9641
- }
9642
- };
9643
- input.overriddenAsset = newOverridenAsset;
9644
- if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
9645
- throw new ScenarioNotSupportedError(this.chain, scenario, 'Unable to use bridge hub for transfers to other Parachains.');
9634
+ destChain = input.destChain;
9635
+ if (scenario === 'ParaToPara' && !(destChain !== null && destChain !== void 0 && destChain.startsWith('AssetHub'))) {
9636
+ throw new ScenarioNotSupportedError(this.chain, scenario, "Unable to use ".concat(this.chain, " for transfers to other Parachains."));
9646
9637
  }
9647
- var method = 'limited_teleport_assets';
9648
- return transferPolkadotXcm(input, method, 'Unlimited');
9638
+ return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
9649
9639
  }
9650
9640
  }, {
9651
9641
  key: "getRelayToParaOverrides",
@@ -9734,16 +9724,9 @@ var Collectives = /*#__PURE__*/function (_Parachain) {
9734
9724
  key: "transferPolkadotXCM",
9735
9725
  value: function transferPolkadotXCM(input) {
9736
9726
  var scenario = input.scenario,
9737
- destination = input.destination;
9738
- var newOverridenAsset = {
9739
- parents: 1,
9740
- interior: {
9741
- Here: null
9742
- }
9743
- };
9744
- input.overriddenAsset = newOverridenAsset;
9745
- if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
9746
- throw new ScenarioNotSupportedError(this.chain, scenario);
9727
+ destChain = input.destChain;
9728
+ if (scenario === 'ParaToPara' && !(destChain !== null && destChain !== void 0 && destChain.startsWith('AssetHub'))) {
9729
+ throw new ScenarioNotSupportedError(this.chain, scenario, "Unable to use ".concat(this.chain, " for transfers to other Parachains."));
9747
9730
  }
9748
9731
  return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
9749
9732
  }
@@ -9822,13 +9805,6 @@ var CoretimePolkadot = /*#__PURE__*/function (_Parachain) {
9822
9805
  key: "transferPolkadotXCM",
9823
9806
  value: function transferPolkadotXCM(input) {
9824
9807
  var scenario = input.scenario;
9825
- var newOverridenAsset = {
9826
- parents: 1,
9827
- interior: {
9828
- Here: null
9829
- }
9830
- };
9831
- input.overriddenAsset = newOverridenAsset;
9832
9808
  if (scenario === 'ParaToPara') {
9833
9809
  throw new ScenarioNotSupportedError(this.chain, scenario);
9834
9810
  }
@@ -10400,7 +10376,7 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
10400
10376
  key: "transferPolkadotXCM",
10401
10377
  value: function () {
10402
10378
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
10403
- var api, destination, feeAsset, asset, overriddenAsset, isNativeAsset, isNativeFeeAsset, _t, _t2;
10379
+ var api, destination, feeAsset, asset, overriddenAsset, isNativeAsset, isNativeFeeAsset, _t;
10404
10380
  return _regenerator().w(function (_context) {
10405
10381
  while (1) switch (_context.n) {
10406
10382
  case 0:
@@ -10431,8 +10407,7 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
10431
10407
  _context.n = 3;
10432
10408
  return handleExecuteTransfer(this.chain, input);
10433
10409
  case 3:
10434
- _t2 = _context.v;
10435
- return _context.a(2, _t.callTxMethod.call(_t, _t2));
10410
+ return _context.a(2, _t.callTxMethod.call(_t, _context.v));
10436
10411
  case 4:
10437
10412
  if (!(destination === 'Polimec')) {
10438
10413
  _context.n = 5;
@@ -10912,7 +10887,7 @@ var Moonbeam = /*#__PURE__*/function (_Parachain) {
10912
10887
  key: "transferPolkadotXCM",
10913
10888
  value: function () {
10914
10889
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
10915
- var api, destination, assetInfo, scenario, version, location, _t, _t2;
10890
+ var api, destination, assetInfo, scenario, version, location, _t;
10916
10891
  return _regenerator().w(function (_context) {
10917
10892
  while (1) switch (_context.n) {
10918
10893
  case 0:
@@ -10931,8 +10906,7 @@ var Moonbeam = /*#__PURE__*/function (_Parachain) {
10931
10906
  _context.n = 2;
10932
10907
  return createTypeAndThenCall(this.chain, input);
10933
10908
  case 2:
10934
- _t2 = _context.v;
10935
- return _context.a(2, _t.callTxMethod.call(_t, _t2));
10909
+ return _context.a(2, _t.callTxMethod.call(_t, _context.v));
10936
10910
  case 3:
10937
10911
  location = this.getLocation(assetInfo, scenario);
10938
10912
  return _context.a(2, transferPolkadotXcm(_objectSpread2(_objectSpread2({}, input), {}, {
@@ -11120,7 +11094,7 @@ var Mythos = /*#__PURE__*/function (_Parachain) {
11120
11094
  key: "transferPolkadotXCM",
11121
11095
  value: function () {
11122
11096
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
11123
- var api, destination, defaultTx, _t, _t2;
11097
+ var api, destination, defaultTx, _t;
11124
11098
  return _regenerator().w(function (_context2) {
11125
11099
  while (1) switch (_context2.n) {
11126
11100
  case 0:
@@ -11143,8 +11117,7 @@ var Mythos = /*#__PURE__*/function (_Parachain) {
11143
11117
  _context2.n = 3;
11144
11118
  return createTypeAndThenTransfer(input, this.chain, this.version);
11145
11119
  case 3:
11146
- _t2 = _context2.v;
11147
- return _context2.a(2, _t.callTxMethod.call(_t, _t2));
11120
+ return _context2.a(2, _t.callTxMethod.call(_t, _context2.v));
11148
11121
  case 4:
11149
11122
  return _context2.a(2, defaultTx);
11150
11123
  }
@@ -11244,17 +11217,10 @@ var PeoplePolkadot = /*#__PURE__*/function (_Parachain) {
11244
11217
  key: "transferPolkadotXCM",
11245
11218
  value: function transferPolkadotXCM(input) {
11246
11219
  var scenario = input.scenario,
11247
- destination = input.destination;
11248
- if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
11249
- throw new ScenarioNotSupportedError(this.chain, scenario);
11220
+ destChain = input.destChain;
11221
+ if (scenario === 'ParaToPara' && !(destChain !== null && destChain !== void 0 && destChain.startsWith('AssetHub'))) {
11222
+ throw new ScenarioNotSupportedError(this.chain, scenario, "Unable to use ".concat(this.chain, " for transfers to other Parachains."));
11250
11223
  }
11251
- var newOverridenAsset = {
11252
- parents: 1,
11253
- interior: {
11254
- Here: null
11255
- }
11256
- };
11257
- input.overriddenAsset = newOverridenAsset;
11258
11224
  return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
11259
11225
  }
11260
11226
  }, {
@@ -11658,7 +11624,7 @@ var Zeitgeist = /*#__PURE__*/function (_Parachain) {
11658
11624
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Zeitgeist';
11659
11625
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zeitgeist';
11660
11626
  var ecosystem = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Polkadot';
11661
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V3;
11627
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
11662
11628
  _classCallCheck(this, Zeitgeist);
11663
11629
  return _callSuper(this, Zeitgeist, [chain, info, ecosystem, version]);
11664
11630
  }
package/dist/index.d.ts CHANGED
@@ -26,6 +26,7 @@ type TPolkadotXCMTransferOptions<TApi, TRes> = {
26
26
  feeAssetInfo?: TAssetInfo;
27
27
  feeCurrency?: TCurrencyInput;
28
28
  destination: TDestination;
29
+ destChain?: TChain;
29
30
  paraIdTo?: number;
30
31
  version: Version;
31
32
  senderAddress?: string;
@@ -1428,7 +1429,7 @@ declare abstract class Parachain<TApi, TRes> {
1428
1429
  shouldUseNativeAssetTeleport({ assetInfo: asset, to }: TSendInternalOptions<TApi, TRes>): boolean;
1429
1430
  getRelayToParaOverrides(): TRelayToParaOverrides;
1430
1431
  transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): TSerializedApiCall;
1431
- createCurrencySpec(amount: bigint, scenario: TScenario, version: Version, _asset?: TAssetInfo, _isOverridenAsset?: boolean): TAsset;
1432
+ createCurrencySpec(amount: bigint, scenario: TScenario, version: Version, asset?: TAssetInfo, _isOverridenAsset?: boolean): TAsset;
1432
1433
  getNativeAssetSymbol(): string;
1433
1434
  transferLocal(options: TSendInternalOptions<TApi, TRes>): TRes;
1434
1435
  transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
package/dist/index.mjs CHANGED
@@ -327,19 +327,17 @@ function _regeneratorDefine(e, r, n, t) {
327
327
  i = 0;
328
328
  }
329
329
  _regeneratorDefine = function (e, r, n, t) {
330
- if (r) i ? i(e, r, {
330
+ function o(r, n) {
331
+ _regeneratorDefine(e, r, function (e) {
332
+ return this._invoke(r, n, e);
333
+ });
334
+ }
335
+ r ? i ? i(e, r, {
331
336
  value: n,
332
337
  enumerable: !t,
333
338
  configurable: !t,
334
339
  writable: !t
335
- }) : e[r] = n;else {
336
- function o(r, n) {
337
- _regeneratorDefine(e, r, function (e) {
338
- return this._invoke(r, n, e);
339
- });
340
- }
341
- o("next", 0), o("throw", 1), o("return", 2);
342
- }
340
+ }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
343
341
  }, _regeneratorDefine(e, r, n, t);
344
342
  }
345
343
  function _setPrototypeOf(t, e) {
@@ -5607,21 +5605,17 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5607
5605
  initialDestParaId = _yield$getOriginXcmFe.destParaId;
5608
5606
  originWeight = _yield$getOriginXcmFe.weight;
5609
5607
  sufficientOriginFee = _yield$getOriginXcmFe.sufficient;
5610
- api.setDisconnectAllowed(true);
5611
- _context2.n = 2;
5612
- return api.disconnect();
5613
- case 2:
5614
5608
  if (!(originDryRunError || originFeeType === 'paymentInfo')) {
5615
- _context2.n = 8;
5609
+ _context2.n = 7;
5616
5610
  break;
5617
5611
  }
5618
5612
  destApi = api.clone();
5619
- _context2.p = 3;
5620
- _context2.n = 4;
5613
+ _context2.p = 2;
5614
+ _context2.n = 3;
5621
5615
  return destApi.init(destination, DRY_RUN_CLIENT_TIMEOUT_MS);
5622
- case 4:
5616
+ case 3:
5623
5617
  destApi.setDisconnectAllowed(false);
5624
- _context2.n = 5;
5618
+ _context2.n = 4;
5625
5619
  return getDestXcmFee({
5626
5620
  api: destApi,
5627
5621
  forwardedXcms: undefined,
@@ -5638,7 +5632,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5638
5632
  senderAddress: senderAddress,
5639
5633
  disableFallback: disableFallback
5640
5634
  });
5641
- case 5:
5635
+ case 4:
5642
5636
  destFeeRes = _context2.v;
5643
5637
  _result = {
5644
5638
  origin: _objectSpread2(_objectSpread2(_objectSpread2({}, originFee && {
@@ -5672,14 +5666,14 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5672
5666
  failureChain: _failureChain,
5673
5667
  failureReason: _failureReason
5674
5668
  }));
5675
- case 6:
5676
- _context2.p = 6;
5669
+ case 5:
5670
+ _context2.p = 5;
5677
5671
  destApi.setDisconnectAllowed(true);
5678
- _context2.n = 7;
5672
+ _context2.n = 6;
5679
5673
  return destApi.disconnect();
5674
+ case 6:
5675
+ return _context2.f(5);
5680
5676
  case 7:
5681
- return _context2.f(6);
5682
- case 8:
5683
5677
  processHop = /*#__PURE__*/function () {
5684
5678
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
5685
5679
  var hopApi, currentChain, currentOrigin, currentAsset, forwardedXcms, hasPassedExchange, hopResult, hopCurrency;
@@ -5727,7 +5721,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5727
5721
  return _ref3.apply(this, arguments);
5728
5722
  };
5729
5723
  }();
5730
- _context2.n = 9;
5724
+ _context2.n = 8;
5731
5725
  return traverseXcmHops({
5732
5726
  api: api,
5733
5727
  origin: origin,
@@ -5747,14 +5741,14 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5747
5741
  };
5748
5742
  }
5749
5743
  });
5750
- case 9:
5744
+ case 8:
5751
5745
  traversalResult = _context2.v;
5752
5746
  // Handle case where we failed before reaching destination
5753
5747
  destFee = 0n;
5754
5748
  destFeeType = destination === 'Ethereum' ? 'noFeeRequired' : 'paymentInfo';
5755
5749
  destSufficient = undefined;
5756
5750
  if (!traversalResult.destination) {
5757
- _context2.n = 10;
5751
+ _context2.n = 9;
5758
5752
  break;
5759
5753
  }
5760
5754
  destResult = traversalResult.destination;
@@ -5763,23 +5757,23 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5763
5757
  destDryRunError = destResult.dryRunError;
5764
5758
  destSufficient = destResult.sufficient;
5765
5759
  destCurrency = destResult.currency;
5766
- _context2.n = 14;
5760
+ _context2.n = 13;
5767
5761
  break;
5768
- case 10:
5762
+ case 9:
5769
5763
  if (!(traversalResult.hops.length > 0 && traversalResult.hops[traversalResult.hops.length - 1].result.dryRunError)) {
5770
- _context2.n = 13;
5764
+ _context2.n = 12;
5771
5765
  break;
5772
5766
  }
5773
5767
  // We failed before reaching destination, use fallback
5774
5768
  _destApi = api.clone();
5775
5769
  if (!(destination !== 'Ethereum')) {
5776
- _context2.n = 11;
5770
+ _context2.n = 10;
5777
5771
  break;
5778
5772
  }
5779
- _context2.n = 11;
5773
+ _context2.n = 10;
5780
5774
  return _destApi.init(destination, DRY_RUN_CLIENT_TIMEOUT_MS);
5781
- case 11:
5782
- _context2.n = 12;
5775
+ case 10:
5776
+ _context2.n = 11;
5783
5777
  return getDestXcmFee({
5784
5778
  api: _destApi,
5785
5779
  forwardedXcms: undefined,
@@ -5795,25 +5789,25 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5795
5789
  senderAddress: senderAddress,
5796
5790
  disableFallback: disableFallback
5797
5791
  });
5798
- case 12:
5792
+ case 11:
5799
5793
  destFallback = _context2.v;
5800
5794
  destFee = destFallback.fee;
5801
5795
  destFeeType = destFallback.feeType;
5802
5796
  destSufficient = destFallback.sufficient;
5803
5797
  destCurrency = getNativeAssetSymbol(destination);
5804
- _context2.n = 14;
5798
+ _context2.n = 13;
5805
5799
  break;
5806
- case 13:
5800
+ case 12:
5807
5801
  destFee = 0n;
5808
5802
  destFeeType = 'noFeeRequired';
5809
5803
  destSufficient = true;
5810
5804
  destCurrency = getNativeAssetSymbol(destination);
5811
- case 14:
5805
+ case 13:
5812
5806
  // Process Ethereum bridge fees
5813
5807
  assetHubChain = "AssetHub".concat(getRelayChainOf(origin));
5814
- _context2.n = 15;
5808
+ _context2.n = 14;
5815
5809
  return addEthereumBridgeFees(api, traversalResult.bridgeHub, destination, assetHubChain);
5816
- case 15:
5810
+ case 14:
5817
5811
  processedBridgeHub = _context2.v;
5818
5812
  // Update bridge hub fee in hops if needed
5819
5813
  if (processedBridgeHub && traversalResult.bridgeHub && processedBridgeHub.fee !== traversalResult.bridgeHub.fee) {
@@ -5887,7 +5881,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5887
5881
  failureReason: failureReason
5888
5882
  }));
5889
5883
  }
5890
- }, _callee2, null, [[3,, 6, 8]]);
5884
+ }, _callee2, null, [[2,, 5, 7]]);
5891
5885
  }));
5892
5886
  return function getXcmFeeInternal(_x, _x2) {
5893
5887
  return _ref2.apply(this, arguments);
@@ -5897,7 +5891,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
5897
5891
  var getXcmFee = /*#__PURE__*/function () {
5898
5892
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
5899
5893
  var _real$assetHub, _real$bridgeHub;
5900
- var forced, real;
5894
+ var forced, real, api;
5901
5895
  return _regenerator().w(function (_context) {
5902
5896
  while (1) switch (_context.n) {
5903
5897
  case 0:
@@ -5909,6 +5903,10 @@ var getXcmFee = /*#__PURE__*/function () {
5909
5903
  return getXcmFeeInternal(options, false);
5910
5904
  case 2:
5911
5905
  real = _context.v;
5906
+ api = options.api;
5907
+ _context.n = 3;
5908
+ return api.disconnect();
5909
+ case 3:
5912
5910
  return _context.a(2, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, forced), {}, {
5913
5911
  origin: _objectSpread2(_objectSpread2({}, forced.origin), {}, {
5914
5912
  sufficient: real.origin.sufficient
@@ -6222,7 +6220,7 @@ var FEE_PADDING_PERCENTAGE$2 = 20;
6222
6220
  var FEE_PADDING_HYDRATION = 150;
6223
6221
  var computeInstructionFee = /*#__PURE__*/function () {
6224
6222
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref, version, xcm) {
6225
- var chain, api, _t, _t2, _t3;
6223
+ var chain, api, _t;
6226
6224
  return _regenerator().w(function (_context) {
6227
6225
  while (1) switch (_context.n) {
6228
6226
  case 0:
@@ -6233,9 +6231,7 @@ var computeInstructionFee = /*#__PURE__*/function () {
6233
6231
  location: DOT_LOCATION
6234
6232
  }, true);
6235
6233
  case 1:
6236
- _t2 = _context.v;
6237
- _t3 = chain === 'Hydration' ? FEE_PADDING_HYDRATION : FEE_PADDING_PERCENTAGE$2;
6238
- return _context.a(2, _t(_t2, _t3));
6234
+ return _context.a(2, _t(_context.v, chain === 'Hydration' ? FEE_PADDING_HYDRATION : FEE_PADDING_PERCENTAGE$2));
6239
6235
  }
6240
6236
  }, _callee);
6241
6237
  }));
@@ -6245,7 +6241,7 @@ var computeInstructionFee = /*#__PURE__*/function () {
6245
6241
  }();
6246
6242
  var computeAllFees = /*#__PURE__*/function () {
6247
6243
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref3, customXcm, isDotAsset, refundInstruction) {
6248
- var reserve, dest, version, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10;
6244
+ var reserve, dest, version, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0;
6249
6245
  return _regenerator().w(function (_context2) {
6250
6246
  while (1) switch (_context2.n) {
6251
6247
  case 0:
@@ -6257,7 +6253,7 @@ var computeAllFees = /*#__PURE__*/function () {
6257
6253
  _context2.n = 1;
6258
6254
  return computeInstructionFee(reserve, version, [customXcm]);
6259
6255
  case 1:
6260
- _t5 = _context2.v;
6256
+ _t3 = _context2.v;
6261
6257
  if (!refundInstruction) {
6262
6258
  _context2.n = 3;
6263
6259
  break;
@@ -6265,21 +6261,21 @@ var computeAllFees = /*#__PURE__*/function () {
6265
6261
  _context2.n = 2;
6266
6262
  return computeInstructionFee(reserve, version, [refundInstruction]);
6267
6263
  case 2:
6268
- _t6 = _context2.v;
6264
+ _t4 = _context2.v;
6269
6265
  _context2.n = 4;
6270
6266
  break;
6271
6267
  case 3:
6272
- _t6 = 0n;
6268
+ _t4 = 0n;
6273
6269
  case 4:
6274
- _t7 = _t6;
6270
+ _t5 = _t4;
6275
6271
  _context2.n = 5;
6276
6272
  return computeInstructionFee(hasXcmPaymentApiSupport(dest.chain) ? dest : reserve, version, customXcm.DepositReserveAsset.xcm);
6277
6273
  case 5:
6278
- _t8 = _context2.v;
6279
- _t4 = {
6280
- reserveFee: _t5,
6281
- refundFee: _t7,
6282
- destFee: _t8
6274
+ _t6 = _context2.v;
6275
+ _t2 = {
6276
+ reserveFee: _t3,
6277
+ refundFee: _t5,
6278
+ destFee: _t6
6283
6279
  };
6284
6280
  _context2.n = 13;
6285
6281
  break;
@@ -6291,13 +6287,13 @@ var computeAllFees = /*#__PURE__*/function () {
6291
6287
  _context2.n = 7;
6292
6288
  return computeInstructionFee(hasXcmPaymentApiSupport(dest.chain) ? dest : reserve, version, [customXcm]);
6293
6289
  case 7:
6294
- _t9 = _context2.v;
6290
+ _t7 = _context2.v;
6295
6291
  _context2.n = 9;
6296
6292
  break;
6297
6293
  case 8:
6298
- _t9 = 0n;
6294
+ _t7 = 0n;
6299
6295
  case 9:
6300
- _t0 = _t9;
6296
+ _t8 = _t7;
6301
6297
  if (isDotAsset) {
6302
6298
  _context2.n = 11;
6303
6299
  break;
@@ -6305,20 +6301,20 @@ var computeAllFees = /*#__PURE__*/function () {
6305
6301
  _context2.n = 10;
6306
6302
  return computeInstructionFee(hasXcmPaymentApiSupport(reserve.chain) ? reserve : dest, version, [refundInstruction]);
6307
6303
  case 10:
6308
- _t1 = _context2.v;
6304
+ _t9 = _context2.v;
6309
6305
  _context2.n = 12;
6310
6306
  break;
6311
6307
  case 11:
6312
- _t1 = 0n;
6308
+ _t9 = 0n;
6313
6309
  case 12:
6314
- _t10 = _t1;
6315
- _t4 = {
6310
+ _t0 = _t9;
6311
+ _t2 = {
6316
6312
  reserveFee: 0n,
6317
- destFee: _t0,
6318
- refundFee: _t10
6313
+ destFee: _t8,
6314
+ refundFee: _t0
6319
6315
  };
6320
6316
  case 13:
6321
- return _context2.a(2, _t4);
6317
+ return _context2.a(2, _t2);
6322
6318
  }
6323
6319
  }, _callee2);
6324
6320
  }));
@@ -8313,20 +8309,21 @@ var Parachain = /*#__PURE__*/function () {
8313
8309
  key: "canUseXTokens",
8314
8310
  value: function canUseXTokens(options) {
8315
8311
  var asset = options.assetInfo;
8316
- var isEthAsset = asset.location && findAssetInfoByLoc(getOtherAssets('Ethereum'), asset.location);
8317
- return !isEthAsset && !this.shouldUseNativeAssetTeleport(options);
8312
+ var isExternalAsset = asset.location && asset.location.parents === Parents.TWO;
8313
+ return !isExternalAsset && !this.shouldUseNativeAssetTeleport(options);
8318
8314
  }
8319
8315
  }, {
8320
8316
  key: "transfer",
8321
8317
  value: function () {
8322
8318
  var _transfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(sendOptions) {
8323
- var api, asset, currency, feeAsset, feeCurrency, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, scenario, paraId, isLocalTransfer, isBifrostOrigin, isJamtonOrigin, isAssetHubDest, useMultiAssets, input, options, shouldUseTeleport, isAHPOrigin, isAHPDest, isEthAsset, isEthDest, isEthAssetViaAh, isEthAssetToAh, call;
8319
+ var api, asset, currency, feeAsset, feeCurrency, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, scenario, paraId, destChain, isLocalTransfer, isBifrostOrigin, isJamtonOrigin, isAssetHubDest, useMultiAssets, input, options, shouldUseTeleport, isAhToOtherPara, isOtherParaToAh, isAHPOrigin, isAHPDest, isExternalAsset, isEthDest, isExternalAssetViaAh, isExternalAssetToAh, call;
8324
8320
  return _regenerator().w(function (_context) {
8325
8321
  while (1) switch (_context.n) {
8326
8322
  case 0:
8327
8323
  api = sendOptions.api, asset = sendOptions.assetInfo, currency = sendOptions.currency, feeAsset = sendOptions.feeAsset, feeCurrency = sendOptions.feeCurrency, address = sendOptions.address, destination = sendOptions.to, paraIdTo = sendOptions.paraIdTo, overriddenAsset = sendOptions.overriddenAsset, version = sendOptions.version, senderAddress = sendOptions.senderAddress, ahAddress = sendOptions.ahAddress, pallet = sendOptions.pallet, method = sendOptions.method;
8328
8324
  scenario = resolveScenario(this.chain, destination);
8329
8325
  paraId = resolveParaId(paraIdTo, destination);
8326
+ destChain = paraId ? getTChain(paraId, getRelayChainOf(this.chain)) : undefined;
8330
8327
  if (!(destination === 'Polimec' && this.chain !== 'AssetHubPolkadot' && this.chain !== 'Hydration' && this.chain !== destination)) {
8331
8328
  _context.n = 1;
8332
8329
  break;
@@ -8406,6 +8403,7 @@ var Parachain = /*#__PURE__*/function () {
8406
8403
  feeCurrency: feeCurrency,
8407
8404
  scenario: scenario,
8408
8405
  destination: destination,
8406
+ destChain: destChain,
8409
8407
  paraIdTo: paraId,
8410
8408
  version: version,
8411
8409
  senderAddress: senderAddress,
@@ -8414,7 +8412,9 @@ var Parachain = /*#__PURE__*/function () {
8414
8412
  method: method
8415
8413
  };
8416
8414
  shouldUseTeleport = this.shouldUseNativeAssetTeleport(sendOptions);
8417
- if (!((this.chain.includes('AssetHub') && destination !== 'Mythos' && typeof destination === 'string' && !isSystemChain(destination) || !isSystemChain(this.chain) && this.chain !== 'Mythos' && typeof destination === 'string' && destination.includes('AssetHub')) && shouldUseTeleport)) {
8415
+ isAhToOtherPara = this.chain.startsWith('AssetHub') && destChain && destChain !== 'Mythos' && !isSystemChain(destChain);
8416
+ isOtherParaToAh = (destChain === null || destChain === void 0 ? void 0 : destChain.startsWith('AssetHub')) && this.chain !== 'Mythos' && !isSystemChain(this.chain);
8417
+ if (!((isAhToOtherPara || isOtherParaToAh) && shouldUseTeleport)) {
8418
8418
  _context.n = 6;
8419
8419
  break;
8420
8420
  }
@@ -8422,11 +8422,11 @@ var Parachain = /*#__PURE__*/function () {
8422
8422
  case 6:
8423
8423
  isAHPOrigin = this.chain.includes('AssetHub');
8424
8424
  isAHPDest = !isTLocation(destination) && destination.includes('AssetHub'); // Handle common cases
8425
- isEthAsset = asset.location && findAssetInfoByLoc(getOtherAssets('Ethereum'), asset.location);
8426
- isEthDest = destination === 'Ethereum'; // Eth asset - Any origin to any dest via AH - DestinationReserve - multiple instructions
8427
- isEthAssetViaAh = isEthAsset && !isAHPOrigin && !isAHPDest && !isEthDest && !feeAsset; // Eth asset - Any origin to AHP - DestinationReserve - one DepositAsset instruction
8428
- isEthAssetToAh = isEthAsset && isAHPDest && !isAHPOrigin && !isEthDest && !feeAsset;
8429
- if (!(isEthAssetViaAh || isEthAssetToAh)) {
8425
+ isExternalAsset = asset.location && asset.location.parents === Parents.TWO;
8426
+ isEthDest = destination === 'Ethereum'; // External asset - Any origin to any dest via AH - DestinationReserve - multiple instructions
8427
+ isExternalAssetViaAh = isExternalAsset && !isAHPOrigin && !isAHPDest && !isEthDest && !feeAsset; // External asset - Any origin to AHP - DestinationReserve - one DepositAsset instruction
8428
+ isExternalAssetToAh = isExternalAsset && isAHPDest && !isAHPOrigin && !isEthDest && !feeAsset;
8429
+ if (!(isExternalAssetViaAh || isExternalAssetToAh)) {
8430
8430
  _context.n = 8;
8431
8431
  break;
8432
8432
  }
@@ -8491,9 +8491,11 @@ var Parachain = /*#__PURE__*/function () {
8491
8491
  }
8492
8492
  }, {
8493
8493
  key: "createCurrencySpec",
8494
- value: function createCurrencySpec(amount, scenario, version, _asset, _isOverridenAsset) {
8494
+ value: function createCurrencySpec(amount, scenario, version, asset, _isOverridenAsset) {
8495
+ var isRelayAsset = deepEqual(asset === null || asset === void 0 ? void 0 : asset.location, RELAY_LOCATION);
8496
+ var parents = scenario === 'ParaToRelay' || isRelayAsset && isSystemChain(this.chain) ? Parents.ONE : Parents.ZERO;
8495
8497
  return createAsset(version, amount, {
8496
- parents: scenario === 'ParaToRelay' ? Parents.ONE : Parents.ZERO,
8498
+ parents: parents,
8497
8499
  interior: 'Here'
8498
8500
  });
8499
8501
  }
@@ -8771,7 +8773,7 @@ var Ajuna = /*#__PURE__*/function (_Parachain) {
8771
8773
  key: "transferPolkadotXCM",
8772
8774
  value: function () {
8773
8775
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
8774
- var api, _t, _t2;
8776
+ var api, _t;
8775
8777
  return _regenerator().w(function (_context) {
8776
8778
  while (1) switch (_context.n) {
8777
8779
  case 0:
@@ -8780,8 +8782,7 @@ var Ajuna = /*#__PURE__*/function (_Parachain) {
8780
8782
  _context.n = 1;
8781
8783
  return createTypeAndThenCall(this.chain, input);
8782
8784
  case 1:
8783
- _t2 = _context.v;
8784
- return _context.a(2, _t.callTxMethod.call(_t, _t2));
8785
+ return _context.a(2, _t.callTxMethod.call(_t, _context.v));
8785
8786
  }
8786
8787
  }, _callee, this);
8787
8788
  }));
@@ -9187,7 +9188,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
9187
9188
  key: "transferPolkadotXCM",
9188
9189
  value: function () {
9189
9190
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options) {
9190
- var api, scenario, assetInfo, destination, feeAssetInfo, overriddenAsset, call, isNativeAsset, isNativeFeeAsset, isEthereumAsset, _call, CHAINS_SUPPORT_DOT_TRANSFER, isTrusted, isDotReserveAh, method, modifiedInput, _t, _t2, _t3, _t4;
9191
+ var api, scenario, assetInfo, destination, feeAssetInfo, overriddenAsset, call, isNativeAsset, isNativeFeeAsset, isExternalAsset, _call, CHAINS_SUPPORT_DOT_TRANSFER, isTrusted, isDotReserveAh, method, modifiedInput, _t, _t2;
9191
9192
  return _regenerator().w(function (_context3) {
9192
9193
  while (1) switch (_context3.n) {
9193
9194
  case 0:
@@ -9222,8 +9223,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
9222
9223
  _context3.n = 4;
9223
9224
  return handleExecuteTransfer(this.chain, options);
9224
9225
  case 4:
9225
- _t2 = _context3.v;
9226
- return _context3.a(2, _t.callTxMethod.call(_t, _t2));
9226
+ return _context3.a(2, _t.callTxMethod.call(_t, _context3.v));
9227
9227
  case 5:
9228
9228
  if (!(destination === 'AssetHubKusama')) {
9229
9229
  _context3.n = 6;
@@ -9243,8 +9243,8 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
9243
9243
  }
9244
9244
  return _context3.a(2, this.handleMythosTransfer(options));
9245
9245
  case 8:
9246
- isEthereumAsset = assetInfo.location && findAssetInfoByLoc(getOtherAssets('Ethereum'), assetInfo.location);
9247
- if (!isEthereumAsset) {
9246
+ isExternalAsset = assetInfo.location && assetInfo.location.parents === Parents.TWO;
9247
+ if (!isExternalAsset) {
9248
9248
  _context3.n = 10;
9249
9249
  break;
9250
9250
  }
@@ -9274,12 +9274,11 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
9274
9274
  _context3.n = 14;
9275
9275
  break;
9276
9276
  }
9277
- _t3 = api;
9277
+ _t2 = api;
9278
9278
  _context3.n = 13;
9279
9279
  return createTypeAndThenCall(this.chain, options);
9280
9280
  case 13:
9281
- _t4 = _context3.v;
9282
- return _context3.a(2, _t3.callTxMethod.call(_t3, _t4));
9281
+ return _context3.a(2, _t2.callTxMethod.call(_t2, _context3.v));
9283
9282
  case 14:
9284
9283
  modifiedInput = this.patchInput(options);
9285
9284
  return _context3.a(2, transferPolkadotXcm(modifiedInput, method, 'Unlimited'));
@@ -9516,7 +9515,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
9516
9515
  key: "transferToAssetHub",
9517
9516
  value: function () {
9518
9517
  var _transferToAssetHub = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
9519
- var api, assetInfo, _t, _t2;
9518
+ var api, assetInfo, _t;
9520
9519
  return _regenerator().w(function (_context) {
9521
9520
  while (1) switch (_context.n) {
9522
9521
  case 0:
@@ -9529,8 +9528,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
9529
9528
  _context.n = 1;
9530
9529
  return createTypeAndThenCall(this.chain, input);
9531
9530
  case 1:
9532
- _t2 = _context.v;
9533
- return _context.a(2, _t.callTxMethod.call(_t, _t2));
9531
+ return _context.a(2, _t.callTxMethod.call(_t, _context.v));
9534
9532
  case 2:
9535
9533
  assertHasLocation(assetInfo);
9536
9534
  return _context.a(2, transferPolkadotXcm(_objectSpread2(_objectSpread2({}, input), {}, {
@@ -9634,19 +9632,11 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_Parachain) {
9634
9632
  key: "transferPolkadotXCM",
9635
9633
  value: function transferPolkadotXCM(input) {
9636
9634
  var scenario = input.scenario,
9637
- destination = input.destination;
9638
- var newOverridenAsset = {
9639
- parents: 1,
9640
- interior: {
9641
- Here: null
9642
- }
9643
- };
9644
- input.overriddenAsset = newOverridenAsset;
9645
- if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
9646
- throw new ScenarioNotSupportedError(this.chain, scenario, 'Unable to use bridge hub for transfers to other Parachains.');
9635
+ destChain = input.destChain;
9636
+ if (scenario === 'ParaToPara' && !(destChain !== null && destChain !== void 0 && destChain.startsWith('AssetHub'))) {
9637
+ throw new ScenarioNotSupportedError(this.chain, scenario, "Unable to use ".concat(this.chain, " for transfers to other Parachains."));
9647
9638
  }
9648
- var method = 'limited_teleport_assets';
9649
- return transferPolkadotXcm(input, method, 'Unlimited');
9639
+ return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
9650
9640
  }
9651
9641
  }, {
9652
9642
  key: "getRelayToParaOverrides",
@@ -9735,16 +9725,9 @@ var Collectives = /*#__PURE__*/function (_Parachain) {
9735
9725
  key: "transferPolkadotXCM",
9736
9726
  value: function transferPolkadotXCM(input) {
9737
9727
  var scenario = input.scenario,
9738
- destination = input.destination;
9739
- var newOverridenAsset = {
9740
- parents: 1,
9741
- interior: {
9742
- Here: null
9743
- }
9744
- };
9745
- input.overriddenAsset = newOverridenAsset;
9746
- if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
9747
- throw new ScenarioNotSupportedError(this.chain, scenario);
9728
+ destChain = input.destChain;
9729
+ if (scenario === 'ParaToPara' && !(destChain !== null && destChain !== void 0 && destChain.startsWith('AssetHub'))) {
9730
+ throw new ScenarioNotSupportedError(this.chain, scenario, "Unable to use ".concat(this.chain, " for transfers to other Parachains."));
9748
9731
  }
9749
9732
  return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
9750
9733
  }
@@ -9823,13 +9806,6 @@ var CoretimePolkadot = /*#__PURE__*/function (_Parachain) {
9823
9806
  key: "transferPolkadotXCM",
9824
9807
  value: function transferPolkadotXCM(input) {
9825
9808
  var scenario = input.scenario;
9826
- var newOverridenAsset = {
9827
- parents: 1,
9828
- interior: {
9829
- Here: null
9830
- }
9831
- };
9832
- input.overriddenAsset = newOverridenAsset;
9833
9809
  if (scenario === 'ParaToPara') {
9834
9810
  throw new ScenarioNotSupportedError(this.chain, scenario);
9835
9811
  }
@@ -10401,7 +10377,7 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
10401
10377
  key: "transferPolkadotXCM",
10402
10378
  value: function () {
10403
10379
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
10404
- var api, destination, feeAsset, asset, overriddenAsset, isNativeAsset, isNativeFeeAsset, _t, _t2;
10380
+ var api, destination, feeAsset, asset, overriddenAsset, isNativeAsset, isNativeFeeAsset, _t;
10405
10381
  return _regenerator().w(function (_context) {
10406
10382
  while (1) switch (_context.n) {
10407
10383
  case 0:
@@ -10432,8 +10408,7 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
10432
10408
  _context.n = 3;
10433
10409
  return handleExecuteTransfer(this.chain, input);
10434
10410
  case 3:
10435
- _t2 = _context.v;
10436
- return _context.a(2, _t.callTxMethod.call(_t, _t2));
10411
+ return _context.a(2, _t.callTxMethod.call(_t, _context.v));
10437
10412
  case 4:
10438
10413
  if (!(destination === 'Polimec')) {
10439
10414
  _context.n = 5;
@@ -10913,7 +10888,7 @@ var Moonbeam = /*#__PURE__*/function (_Parachain) {
10913
10888
  key: "transferPolkadotXCM",
10914
10889
  value: function () {
10915
10890
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
10916
- var api, destination, assetInfo, scenario, version, location, _t, _t2;
10891
+ var api, destination, assetInfo, scenario, version, location, _t;
10917
10892
  return _regenerator().w(function (_context) {
10918
10893
  while (1) switch (_context.n) {
10919
10894
  case 0:
@@ -10932,8 +10907,7 @@ var Moonbeam = /*#__PURE__*/function (_Parachain) {
10932
10907
  _context.n = 2;
10933
10908
  return createTypeAndThenCall(this.chain, input);
10934
10909
  case 2:
10935
- _t2 = _context.v;
10936
- return _context.a(2, _t.callTxMethod.call(_t, _t2));
10910
+ return _context.a(2, _t.callTxMethod.call(_t, _context.v));
10937
10911
  case 3:
10938
10912
  location = this.getLocation(assetInfo, scenario);
10939
10913
  return _context.a(2, transferPolkadotXcm(_objectSpread2(_objectSpread2({}, input), {}, {
@@ -11121,7 +11095,7 @@ var Mythos = /*#__PURE__*/function (_Parachain) {
11121
11095
  key: "transferPolkadotXCM",
11122
11096
  value: function () {
11123
11097
  var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
11124
- var api, destination, defaultTx, _t, _t2;
11098
+ var api, destination, defaultTx, _t;
11125
11099
  return _regenerator().w(function (_context2) {
11126
11100
  while (1) switch (_context2.n) {
11127
11101
  case 0:
@@ -11144,8 +11118,7 @@ var Mythos = /*#__PURE__*/function (_Parachain) {
11144
11118
  _context2.n = 3;
11145
11119
  return createTypeAndThenTransfer(input, this.chain, this.version);
11146
11120
  case 3:
11147
- _t2 = _context2.v;
11148
- return _context2.a(2, _t.callTxMethod.call(_t, _t2));
11121
+ return _context2.a(2, _t.callTxMethod.call(_t, _context2.v));
11149
11122
  case 4:
11150
11123
  return _context2.a(2, defaultTx);
11151
11124
  }
@@ -11245,17 +11218,10 @@ var PeoplePolkadot = /*#__PURE__*/function (_Parachain) {
11245
11218
  key: "transferPolkadotXCM",
11246
11219
  value: function transferPolkadotXCM(input) {
11247
11220
  var scenario = input.scenario,
11248
- destination = input.destination;
11249
- if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
11250
- throw new ScenarioNotSupportedError(this.chain, scenario);
11221
+ destChain = input.destChain;
11222
+ if (scenario === 'ParaToPara' && !(destChain !== null && destChain !== void 0 && destChain.startsWith('AssetHub'))) {
11223
+ throw new ScenarioNotSupportedError(this.chain, scenario, "Unable to use ".concat(this.chain, " for transfers to other Parachains."));
11251
11224
  }
11252
- var newOverridenAsset = {
11253
- parents: 1,
11254
- interior: {
11255
- Here: null
11256
- }
11257
- };
11258
- input.overriddenAsset = newOverridenAsset;
11259
11225
  return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
11260
11226
  }
11261
11227
  }, {
@@ -11659,7 +11625,7 @@ var Zeitgeist = /*#__PURE__*/function (_Parachain) {
11659
11625
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Zeitgeist';
11660
11626
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zeitgeist';
11661
11627
  var ecosystem = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Polkadot';
11662
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Version.V3;
11628
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Version.V4;
11663
11629
  _classCallCheck(this, Zeitgeist);
11664
11630
  return _callSuper(this, Zeitgeist, [chain, info, ecosystem, version]);
11665
11631
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-core",
3
- "version": "11.2.2",
3
+ "version": "11.2.4",
4
4
  "description": "SDK core for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,18 +24,18 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@noble/hashes": "^1.8.0",
27
- "@scure/base": "^1.2.6",
28
- "viem": "^2.33.2",
29
- "@paraspell/assets": "11.2.2",
30
- "@paraspell/sdk-common": "11.2.2",
31
- "@paraspell/pallets": "11.2.2"
27
+ "@scure/base": "^2.0.0",
28
+ "viem": "^2.36.0",
29
+ "@paraspell/pallets": "11.2.4",
30
+ "@paraspell/assets": "11.2.4",
31
+ "@paraspell/sdk-common": "11.2.4"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/plugin-syntax-import-attributes": "^7.27.1",
35
- "@babel/preset-env": "^7.28.0",
35
+ "@babel/preset-env": "^7.28.3",
36
36
  "@codecov/rollup-plugin": "^1.9.1",
37
- "@polkadot/api": "^16.4.3",
38
- "@polkadot/types": "^16.4.3",
37
+ "@polkadot/api": "^16.4.6",
38
+ "@polkadot/types": "^16.4.6",
39
39
  "@rollup/plugin-babel": "^6.0.4",
40
40
  "@rollup/plugin-json": "^6.1.0",
41
41
  "@rollup/plugin-typescript": "^12.1.4",
@@ -43,8 +43,8 @@
43
43
  "axios": "^1.11.0",
44
44
  "dotenv": "^17.2.1",
45
45
  "prettier": "^3.6.2",
46
- "rollup": "^4.46.2",
47
- "rollup-plugin-dts": "^6.2.1",
46
+ "rollup": "^4.50.0",
47
+ "rollup-plugin-dts": "^6.2.3",
48
48
  "ts-morph": "^26.0.0",
49
49
  "ts-node": "^10.9.2",
50
50
  "tslib": "^2.8.1"