@paraspell/sdk-core 11.14.6 → 11.14.8

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
@@ -1193,10 +1193,6 @@ var Astar$1 = {
1193
1193
  name: "Astar",
1194
1194
  endpoint: "wss://rpc.astar.network"
1195
1195
  },
1196
- {
1197
- name: "Blast",
1198
- endpoint: "wss://astar.public.blastapi.io"
1199
- },
1200
1196
  {
1201
1197
  name: "Dwellir",
1202
1198
  endpoint: "wss://astar-rpc.n.dwellir.com"
@@ -1301,10 +1297,6 @@ var Darwinia$1 = {
1301
1297
  name: "Darwinia",
1302
1298
  endpoint: "wss://rpc.darwinia.network"
1303
1299
  },
1304
- {
1305
- name: "Dwellir",
1306
- endpoint: "wss://darwinia-rpc.n.dwellir.com"
1307
- },
1308
1300
  {
1309
1301
  name: "Subquery",
1310
1302
  endpoint: "wss://darwinia.rpc.subquery.network/public/ws"
@@ -1345,17 +1337,6 @@ var Hydration$1 = {
1345
1337
  }
1346
1338
  ]
1347
1339
  };
1348
- var IntegriteePolkadot$1 = {
1349
- name: "Integritee Network",
1350
- info: "integritee",
1351
- paraId: 2039,
1352
- providers: [
1353
- {
1354
- name: "Integritee",
1355
- endpoint: "wss://polkadot.api.integritee.network"
1356
- }
1357
- ]
1358
- };
1359
1340
  var Interlay$1 = {
1360
1341
  name: "Interlay",
1361
1342
  info: "interlay",
@@ -1406,10 +1387,6 @@ var Moonbeam$1 = {
1406
1387
  name: "Allnodes",
1407
1388
  endpoint: "wss://moonbeam-rpc.publicnode.com"
1408
1389
  },
1409
- {
1410
- name: "Blast",
1411
- endpoint: "wss://moonbeam.public.blastapi.io"
1412
- },
1413
1390
  {
1414
1391
  name: "IBP1",
1415
1392
  endpoint: "wss://moonbeam.ibp.network"
@@ -1553,10 +1530,6 @@ var Nodle$1 = {
1553
1530
  info: "nodle",
1554
1531
  paraId: 2026,
1555
1532
  providers: [
1556
- {
1557
- name: "Dwellir",
1558
- endpoint: "wss://nodle-rpc.dwellir.com"
1559
- },
1560
1533
  {
1561
1534
  name: "OnFinality",
1562
1535
  endpoint: "wss://nodle-parachain.api.onfinality.io/public-ws"
@@ -1594,14 +1567,6 @@ var Phala$1 = {
1594
1567
  name: "Dwellir",
1595
1568
  endpoint: "wss://phala-rpc.n.dwellir.com"
1596
1569
  },
1597
- {
1598
- name: "Helikon",
1599
- endpoint: "wss://rpc.helikon.io/phala"
1600
- },
1601
- {
1602
- name: "OnFinality",
1603
- endpoint: "wss://phala.api.onfinality.io/public-ws"
1604
- },
1605
1570
  {
1606
1571
  name: "RadiumBlock",
1607
1572
  endpoint: "wss://phala.public.curie.radiumblock.co/ws"
@@ -1838,21 +1803,6 @@ var BridgeHubKusama$1 = {
1838
1803
  }
1839
1804
  ]
1840
1805
  };
1841
- var IntegriteeKusama$1 = {
1842
- name: "Integritee Network",
1843
- info: "integritee",
1844
- paraId: 2015,
1845
- providers: [
1846
- {
1847
- name: "Integritee",
1848
- endpoint: "wss://kusama.api.integritee.network"
1849
- },
1850
- {
1851
- name: "OnFinality",
1852
- endpoint: "wss://integritee-kusama.api.onfinality.io/public-ws"
1853
- }
1854
- ]
1855
- };
1856
1806
  var Karura$1 = {
1857
1807
  name: "Karura",
1858
1808
  info: "karura",
@@ -2067,10 +2017,6 @@ var Crab$1 = {
2067
2017
  {
2068
2018
  name: "Darwinia",
2069
2019
  endpoint: "wss://crab-rpc.darwinia.network/"
2070
- },
2071
- {
2072
- name: "Dwellir",
2073
- endpoint: "wss://darwiniacrab-rpc.n.dwellir.com"
2074
2020
  }
2075
2021
  ]
2076
2022
  };
@@ -2196,10 +2142,6 @@ var AssetHubWestend$1 = {
2196
2142
  {
2197
2143
  name: "Parity",
2198
2144
  endpoint: "wss://westend-asset-hub-rpc.polkadot.io"
2199
- },
2200
- {
2201
- name: "Permanence DAO EU",
2202
- endpoint: "wss://asset-hub-westend.rpc.permanence.io"
2203
2145
  }
2204
2146
  ]
2205
2147
  };
@@ -2328,6 +2270,10 @@ var BifrostPaseo$1 = {
2328
2270
  {
2329
2271
  name: "Liebi",
2330
2272
  endpoint: "wss://bifrost-rpc.paseo.liebi.com/ws"
2273
+ },
2274
+ {
2275
+ name: "Liebi2",
2276
+ endpoint: "wss://bifrost-rpc.paseo2.liebi.com/ws"
2331
2277
  }
2332
2278
  ]
2333
2279
  };
@@ -2394,17 +2340,6 @@ var HydrationPaseo$1 = {
2394
2340
  }
2395
2341
  ]
2396
2342
  };
2397
- var IntegriteePaseo$1 = {
2398
- name: "Integritee Network (Paseo)",
2399
- info: "integritee",
2400
- paraId: 2039,
2401
- providers: [
2402
- {
2403
- name: "Integritee",
2404
- endpoint: "wss://paseo.api.integritee.network"
2405
- }
2406
- ]
2407
- };
2408
2343
  var KiltPaseo$1 = {
2409
2344
  name: "KILT Peregrine",
2410
2345
  info: "kilt",
@@ -2438,17 +2373,6 @@ var NeuroWebPaseo$1 = {
2438
2373
  }
2439
2374
  ]
2440
2375
  };
2441
- var NodlePaseo$1 = {
2442
- name: "Nodle",
2443
- info: "NodleParadis",
2444
- paraId: 2026,
2445
- providers: [
2446
- {
2447
- name: "OnFinality",
2448
- endpoint: "wss://node-7273232234617282560.nv.onfinality.io/ws?apikey=b937a7d7-7395-49b9-b745-60a0342fa365"
2449
- }
2450
- ]
2451
- };
2452
2376
  var PAssetHub$1 = {
2453
2377
  name: "PAssetHub - Contracts",
2454
2378
  info: "PAssetHub - Contracts",
@@ -2677,7 +2601,6 @@ var configs = {
2677
2601
  Darwinia: Darwinia$1,
2678
2602
  EnergyWebX: EnergyWebX$1,
2679
2603
  Hydration: Hydration$1,
2680
- IntegriteePolkadot: IntegriteePolkadot$1,
2681
2604
  Interlay: Interlay$1,
2682
2605
  Heima: Heima$1,
2683
2606
  Jamton: Jamton$1,
@@ -2700,7 +2623,6 @@ var configs = {
2700
2623
  Xode: Xode$1,
2701
2624
  AssetHubKusama: AssetHubKusama$1,
2702
2625
  BridgeHubKusama: BridgeHubKusama$1,
2703
- IntegriteeKusama: IntegriteeKusama$1,
2704
2626
  Karura: Karura$1,
2705
2627
  Kintsugi: Kintsugi$1,
2706
2628
  Moonriver: Moonriver$1,
@@ -2732,11 +2654,9 @@ var configs = {
2732
2654
  EnergyWebXPaseo: EnergyWebXPaseo$1,
2733
2655
  HeimaPaseo: HeimaPaseo$1,
2734
2656
  HydrationPaseo: HydrationPaseo$1,
2735
- IntegriteePaseo: IntegriteePaseo$1,
2736
2657
  KiltPaseo: KiltPaseo$1,
2737
2658
  LaosPaseo: LaosPaseo$1,
2738
2659
  NeuroWebPaseo: NeuroWebPaseo$1,
2739
- NodlePaseo: NodlePaseo$1,
2740
2660
  PAssetHub: PAssetHub$1,
2741
2661
  PeoplePaseo: PeoplePaseo$1,
2742
2662
  ZeitgeistPaseo: ZeitgeistPaseo$1,
@@ -2995,7 +2915,7 @@ var getMythosOriginFee = /*#__PURE__*/function () {
2995
2915
  return ahApi.init('AssetHubPolkadot');
2996
2916
  case 1:
2997
2917
  _context.n = 2;
2998
- return getParaEthTransferFees(ahApi);
2918
+ return getParaEthTransferFees(ahApi, false);
2999
2919
  case 2:
3000
2920
  _yield$getParaEthTran = _context.v;
3001
2921
  _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
@@ -3007,12 +2927,15 @@ var getMythosOriginFee = /*#__PURE__*/function () {
3007
2927
  return ahApi.quoteAhPrice(DOT_LOCATION, nativeAsset.location, bridgeFee + ahExecutionFee);
3008
2928
  case 3:
3009
2929
  feeConverted = _context.v;
2930
+ _context.n = 4;
2931
+ return ahApi.disconnect();
2932
+ case 4:
3010
2933
  if (feeConverted) {
3011
- _context.n = 4;
2934
+ _context.n = 5;
3012
2935
  break;
3013
2936
  }
3014
2937
  throw new InvalidParameterError("Pool DOT -> ".concat(nativeAsset.symbol, " not found."));
3015
- case 4:
2938
+ case 5:
3016
2939
  return _context.a(2, padValueBy(feeConverted, 10));
3017
2940
  }
3018
2941
  }, _callee);
@@ -3798,7 +3721,9 @@ var GeneralBuilder = /*#__PURE__*/function () {
3798
3721
  }, {
3799
3722
  key: "getXcmFee",
3800
3723
  value: (function () {
3801
- var _getXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(options) {
3724
+ var _getXcmFee2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(
3725
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
3726
+ options) {
3802
3727
  var _options$disableFallb;
3803
3728
  var disableFallback, _yield$this$prepareNo2, normalizedOptions, buildTx, api, from, to, senderAddress, address, currency, feeAsset;
3804
3729
  return _regenerator().w(function (_context8) {
@@ -4598,6 +4523,30 @@ var validateBridgeAsset = function validateBridgeAsset(origin, destination, asse
4598
4523
  throw new assets.InvalidCurrencyError("Substrate bridge does not support currency ".concat(JSON.stringify(currency, sdkCommon.replaceBigInt), "."));
4599
4524
  }
4600
4525
  };
4526
+ var validateEthereumAsset = function validateEthereumAsset(origin, destination, asset) {
4527
+ var _asset$location2;
4528
+ if (!asset || destination !== 'Ethereum' || origin === 'Mythos') return;
4529
+ var ADDITIONAL_ALLOWED_LOCATIONS = [RELAY_LOCATION, {
4530
+ parents: 2,
4531
+ interior: {
4532
+ X1: [{
4533
+ GlobalConsensus: {
4534
+ Kusama: null
4535
+ }
4536
+ }]
4537
+ }
4538
+ }];
4539
+ var isEthCompatibleAsset = ((_asset$location2 = asset.location) === null || _asset$location2 === void 0 ? void 0 : _asset$location2.parents) === sdkCommon.Parents.TWO && sdkCommon.deepEqual(sdkCommon.getJunctionValue(asset.location, 'GlobalConsensus'), {
4540
+ Ethereum: {
4541
+ chainId: 1
4542
+ }
4543
+ }) || ADDITIONAL_ALLOWED_LOCATIONS.some(function (loc) {
4544
+ return sdkCommon.deepEqual(asset.location, loc);
4545
+ });
4546
+ if (!isEthCompatibleAsset) {
4547
+ throw new assets.InvalidCurrencyError("Currency ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " is not transferable to Ethereum."));
4548
+ }
4549
+ };
4601
4550
  var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled, isBridge, asset) {
4602
4551
  var origin = _ref.from,
4603
4552
  destination = _ref.to,
@@ -4611,6 +4560,7 @@ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled
4611
4560
  throwUnsupportedCurrency(currency, origin);
4612
4561
  }
4613
4562
  validateBridgeAsset(origin, destination, asset, currency, isBridge);
4563
+ validateEthereumAsset(origin, destination, asset);
4614
4564
  };
4615
4565
 
4616
4566
  var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge, assetCheckEnabled, resolvedFeeAsset) {
@@ -4838,16 +4788,32 @@ var getTChain = function getTChain(paraId, ecosystem) {
4838
4788
 
4839
4789
  var getParaEthTransferFees = /*#__PURE__*/function () {
4840
4790
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(ahApi) {
4841
- var DEFAULT_FEE, feeStorageItem, leFeeHex, bytes, reversedHex, validReversedHex, leFee, transferBridgeFee, finalBridgeFee, finalAssethubExecutionFee;
4791
+ var shouldDisconnect,
4792
+ DEFAULT_FEE,
4793
+ feeStorageItem,
4794
+ leFeeHex,
4795
+ bytes,
4796
+ reversedHex,
4797
+ validReversedHex,
4798
+ leFee,
4799
+ transferBridgeFee,
4800
+ finalBridgeFee,
4801
+ finalAssethubExecutionFee,
4802
+ _args = arguments;
4842
4803
  return _regenerator().w(function (_context) {
4843
4804
  while (1) switch (_context.n) {
4844
4805
  case 0:
4806
+ shouldDisconnect = _args.length > 1 && _args[1] !== undefined ? _args[1] : true;
4845
4807
  DEFAULT_FEE = 2750872500000n;
4846
4808
  _context.n = 1;
4847
4809
  return ahApi.getFromRpc('state', 'getStorage', '0x5fbc5c7ba58845ad1f1a9a7c5bc12fad');
4848
4810
  case 1:
4849
4811
  feeStorageItem = _context.v;
4850
4812
  leFeeHex = feeStorageItem.replace('0x', '');
4813
+ if (!shouldDisconnect) {
4814
+ _context.n = 2;
4815
+ break;
4816
+ }
4851
4817
  _context.n = 2;
4852
4818
  return ahApi.disconnect();
4853
4819
  case 2:
@@ -5234,25 +5200,9 @@ var reverseTransformLocation = function reverseTransformLocation(location) {
5234
5200
  });
5235
5201
  };
5236
5202
 
5237
- var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin, messageId) {
5238
- var api = _ref.api,
5239
- address = _ref.address,
5240
- asset = _ref.assetInfo,
5241
- senderAddress = _ref.senderAddress,
5242
- ahAddress = _ref.ahAddress,
5243
- version = _ref.version;
5244
- if (!assets.isForeignAsset(asset)) {
5245
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " is not a foreign asset"));
5246
- }
5203
+ var createMainInstruction = function createMainInstruction(origin, asset, ethAsset, address, messageId) {
5204
+ assertHasId(ethAsset);
5247
5205
  assertHasLocation(asset);
5248
- assertSenderAddress(senderAddress);
5249
- if (assets.isChainEvm(origin) && !ahAddress) {
5250
- throw new InvalidParameterError("Please provide ahAddress");
5251
- }
5252
- var ethAsset = assets.findAssetInfoByLoc(assets.getOtherAssets('Ethereum'), asset.location);
5253
- if (!ethAsset) {
5254
- throw new assets.InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt)));
5255
- }
5256
5206
  var interiorSb = ethAsset.symbol === 'ETH' ? {
5257
5207
  Here: null
5258
5208
  } : {
@@ -5263,25 +5213,91 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin, message
5263
5213
  }
5264
5214
  }]
5265
5215
  };
5266
- return _defineProperty({}, version, [{
5267
- SetAppendix: origin === 'Mythos' ? [] : [{
5216
+ var isAssetNativeToPolkadot = !sdkCommon.deepEqual(sdkCommon.getJunctionValue(asset.location, 'GlobalConsensus'), {
5217
+ Ethereum: {
5218
+ chainId: 1
5219
+ }
5220
+ // MYTH needs to use InitiateReserveWithdraw
5221
+ }) && origin !== 'Mythos';
5222
+ var beneficiary = {
5223
+ parents: sdkCommon.Parents.ZERO,
5224
+ interior: {
5225
+ X1: [{
5226
+ AccountKey20: {
5227
+ network: null,
5228
+ key: address
5229
+ }
5230
+ }]
5231
+ }
5232
+ };
5233
+ var makeBuyExecution = function makeBuyExecution(feesId) {
5234
+ return {
5235
+ BuyExecution: {
5236
+ fees: {
5237
+ id: feesId,
5238
+ fun: {
5239
+ Fungible: 1n
5240
+ }
5241
+ },
5242
+ weight_limit: 'Unlimited'
5243
+ }
5244
+ };
5245
+ };
5246
+ var makeDepositAsset = function makeDepositAsset() {
5247
+ return {
5268
5248
  DepositAsset: {
5269
5249
  assets: {
5270
- Wild: 'All'
5250
+ Wild: {
5251
+ AllCounted: 1
5252
+ }
5271
5253
  },
5272
- beneficiary: createBeneficiaryLocation({
5273
- api: api,
5274
- address: assets.isChainEvm(origin) ? ahAddress : senderAddress,
5275
- version: version
5254
+ beneficiary: beneficiary
5255
+ }
5256
+ };
5257
+ };
5258
+ var commonXcm = function commonXcm(feesId) {
5259
+ return [makeBuyExecution(feesId), makeDepositAsset(), {
5260
+ SetTopic: messageId
5261
+ }];
5262
+ };
5263
+ if (isAssetNativeToPolkadot) {
5264
+ var assetEcosystem = sdkCommon.RELAYCHAINS.find(function (chain) {
5265
+ return asset.symbol.includes(assets.getNativeAssetSymbol(chain));
5266
+ });
5267
+ if (!assetEcosystem) throw new InvalidParameterError('Unsupported native polkadot asset');
5268
+ return {
5269
+ DepositReserveAsset: {
5270
+ assets: {
5271
+ Wild: {
5272
+ AllOf: {
5273
+ id: asset.location,
5274
+ fun: 'Fungible'
5275
+ }
5276
+ }
5277
+ },
5278
+ dest: {
5279
+ parents: sdkCommon.Parents.TWO,
5280
+ interior: {
5281
+ X1: [ETHEREUM_JUNCTION]
5282
+ }
5283
+ },
5284
+ xcm: commonXcm({
5285
+ parents: sdkCommon.Parents.ONE,
5286
+ interior: {
5287
+ X1: [{
5288
+ GlobalConsensus: _defineProperty({}, assetEcosystem.toLowerCase(), null)
5289
+ }]
5290
+ }
5276
5291
  })
5277
5292
  }
5278
- }]
5279
- }, {
5293
+ };
5294
+ }
5295
+ return {
5280
5296
  InitiateReserveWithdraw: {
5281
5297
  assets: {
5282
5298
  Wild: {
5283
5299
  AllOf: {
5284
- id: asset.location,
5300
+ id: ethAsset.location,
5285
5301
  fun: 'Fungible'
5286
5302
  }
5287
5303
  }
@@ -5292,43 +5308,38 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin, message
5292
5308
  X1: [ETHEREUM_JUNCTION]
5293
5309
  }
5294
5310
  },
5295
- xcm: [{
5296
- BuyExecution: {
5297
- fees: {
5298
- id: {
5299
- parents: sdkCommon.Parents.ZERO,
5300
- interior: interiorSb
5301
- },
5302
- fun: {
5303
- Fungible: 1n
5304
- }
5305
- },
5306
- weight_limit: 'Unlimited'
5307
- }
5308
- }, {
5309
- DepositAsset: {
5310
- assets: {
5311
- Wild: {
5312
- AllCounted: 1
5313
- }
5314
- },
5315
- beneficiary: {
5316
- parents: sdkCommon.Parents.ZERO,
5317
- interior: {
5318
- X1: [{
5319
- AccountKey20: {
5320
- network: null,
5321
- key: address
5322
- }
5323
- }]
5324
- }
5325
- }
5326
- }
5327
- }, {
5328
- SetTopic: messageId
5329
- }]
5311
+ xcm: commonXcm({
5312
+ parents: sdkCommon.Parents.ZERO,
5313
+ interior: interiorSb
5314
+ })
5330
5315
  }
5331
- }, {
5316
+ };
5317
+ };
5318
+ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin, messageId, ethAsset) {
5319
+ var api = _ref.api,
5320
+ address = _ref.address,
5321
+ assetInfo = _ref.assetInfo,
5322
+ senderAddress = _ref.senderAddress,
5323
+ ahAddress = _ref.ahAddress,
5324
+ version = _ref.version;
5325
+ assertSenderAddress(senderAddress);
5326
+ if (assets.isChainEvm(origin) && !ahAddress) {
5327
+ throw new InvalidParameterError("Please provide ahAddress");
5328
+ }
5329
+ return _defineProperty({}, version, [{
5330
+ SetAppendix: origin === 'Mythos' ? [] : [{
5331
+ DepositAsset: {
5332
+ assets: {
5333
+ Wild: 'All'
5334
+ },
5335
+ beneficiary: createBeneficiaryLocation({
5336
+ api: api,
5337
+ address: assets.isChainEvm(origin) ? ahAddress : senderAddress,
5338
+ version: version
5339
+ })
5340
+ }
5341
+ }]
5342
+ }, createMainInstruction(origin, assetInfo, ethAsset, address, messageId), {
5332
5343
  SetTopic: messageId
5333
5344
  }]);
5334
5345
  };
@@ -5490,19 +5501,9 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
5490
5501
  case 5:
5491
5502
  foundAsset = assets.findAssetInfoOrThrow(from, currency, to);
5492
5503
  amount = abstractDecimals(currency.amount, foundAsset.decimals, api);
5493
- if (!(!assets.isForeignAsset(foundAsset) || !foundAsset.location)) {
5494
- _context.n = 6;
5495
- break;
5496
- }
5497
- throw new assets.InvalidCurrencyError('Currency must be a foreign asset with a valid location');
5498
- case 6:
5499
- ethAsset = assets.findAssetInfoByLoc(assets.getOtherAssets('Ethereum'), foundAsset.location);
5500
- if (!(!ethAsset || !ethAsset.assetId)) {
5501
- _context.n = 7;
5502
- break;
5503
- }
5504
- throw new assets.InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(foundAsset)));
5505
- case 7:
5504
+ ethAsset = assets.findAssetInfoOrThrow('Ethereum', {
5505
+ symbol: foundAsset.symbol
5506
+ }, null);
5506
5507
  contract = viem.getContract({
5507
5508
  abi: abi,
5508
5509
  address: xcmInterfacePrecompile,
@@ -5516,12 +5517,13 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
5516
5517
  });
5517
5518
  senderAddress = (_signer$account = signer.account) === null || _signer$account === void 0 ? void 0 : _signer$account.address;
5518
5519
  assertSenderAddress(senderAddress);
5519
- _context.n = 8;
5520
+ assertHasId(ethAsset);
5521
+ _context.n = 6;
5520
5522
  return api.init(from, TX_CLIENT_TIMEOUT_MS);
5521
- case 8:
5522
- _context.n = 9;
5523
+ case 6:
5524
+ _context.n = 7;
5523
5525
  return generateMessageId(api, senderAddress, getParaId(from), ethAsset.assetId, address, amount);
5524
- case 9:
5526
+ case 7:
5525
5527
  messageId = _context.v;
5526
5528
  customXcm = createCustomXcmOnDest({
5527
5529
  api: api,
@@ -5532,18 +5534,18 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
5532
5534
  amount: amount
5533
5535
  }),
5534
5536
  version: sdkCommon.Version.V4
5535
- }, from, messageId);
5536
- _context.n = 10;
5537
+ }, from, messageId, ethAsset);
5538
+ _context.n = 8;
5537
5539
  return api.objectToHex(customXcm, 'XcmVersionedXcm');
5538
- case 10:
5540
+ case 8:
5539
5541
  customXcmOnDest = _context.v;
5540
- _context.n = 11;
5542
+ _context.n = 9;
5541
5543
  return api.createApiForChain('AssetHubPolkadot');
5542
- case 11:
5544
+ case 9:
5543
5545
  assetHubApi = _context.v;
5544
- _context.n = 12;
5546
+ _context.n = 10;
5545
5547
  return getParaEthTransferFees(assetHubApi);
5546
- case 12:
5548
+ case 10:
5547
5549
  _yield$getParaEthTran = _context.v;
5548
5550
  _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
5549
5551
  bridgeFee = _yield$getParaEthTran2[0];
@@ -5558,7 +5560,7 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
5558
5560
  throw new InvalidParameterError('Input must be a valid number');
5559
5561
  }() : "0x".concat((num >>> 0).toString(16).padStart(8, '0'));
5560
5562
  }; // Execute the custom XCM message with the precompile
5561
- _context.n = 13;
5563
+ _context.n = 11;
5562
5564
  return createTx('transferAssetsUsingTypeAndThenAddress', [
5563
5565
  // This represents (1,X1(Parachain(1000)))
5564
5566
  [1, ['0x00' + numberToHex32(getParaId('AssetHubPolkadot')).slice(2)]],
@@ -5570,7 +5572,7 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
5570
5572
  0,
5571
5573
  // The TransferType corresponding to fee asset
5572
5574
  2, customXcmOnDest]);
5573
- case 13:
5575
+ case 11:
5574
5576
  tx = _context.v;
5575
5577
  return _context.a(2, tx);
5576
5578
  }
@@ -7468,7 +7470,7 @@ var send = /*#__PURE__*/function () {
7468
7470
 
7469
7471
  var buildDestInfo = /*#__PURE__*/function () {
7470
7472
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
7471
- var api, origin, destination, address, currency, originFee, isFeeAssetAh, destFeeDetail, totalHopFee, bridgeFee, destApi, destAsset, edDest, destBalance, destAmount, effectiveAmountForBalance, destBalanceSufficient, destBalanceSufficientResult, destBalanceAfter, destbalanceAfterResult, receivedAmount, isAssetHubToAssetHubRoute, nativeAssetOfOriginSymbol, isOriginAssetNative, destXcmFeeBalance, isDestFeeInNativeCurrency, destRecipientNativeBalance, destXcmFeeBalanceAfter;
7473
+ var api, origin, destination, address, currency, originFee, isFeeAssetAh, destFeeDetail, totalHopFee, bridgeFee, destApi, destAsset, edDest, destBalance, destAmount, destFeeAssetEqual, effectiveDestFee, effectiveAmountForBalance, destBalanceSufficient, destBalanceAfter, createUnableToComputeError, isUnableToCompute, destbalanceAfterResult, destBalanceSufficientResult, receivedAmount, isSubBridge, nativeAssetOfOriginSymbol, isOriginAssetNative, destXcmFeeBalance, isDestFeeInNativeCurrency, destRecipientNativeBalance, destXcmFeeBalanceAfter;
7472
7474
  return _regenerator().w(function (_context) {
7473
7475
  while (1) switch (_context.n) {
7474
7476
  case 0:
@@ -7489,13 +7491,19 @@ var buildDestInfo = /*#__PURE__*/function () {
7489
7491
  case 2:
7490
7492
  destBalance = _context.v;
7491
7493
  destAmount = isFeeAssetAh ? currency.amount - originFee : currency.amount;
7494
+ destFeeAssetEqual = assets.isSymbolMatch(destFeeDetail.asset.symbol, destAsset.symbol);
7495
+ effectiveDestFee = destFeeAssetEqual ? destFeeDetail.fee : 0n;
7492
7496
  effectiveAmountForBalance = destAmount - totalHopFee;
7493
- destBalanceSufficient = effectiveAmountForBalance - destFeeDetail.fee > (destBalance < edDest ? edDest : 0n);
7494
- destBalanceSufficientResult = destFeeDetail.currency !== destAsset.symbol && destination !== 'Ethereum' ? new UnableToComputeError('Unable to compute if dest balance will be sufficient. Fee currency is not the same') : destBalanceSufficient;
7495
- destBalanceAfter = destBalance - (destFeeDetail.currency === destAsset.symbol ? destFeeDetail.fee : 0n) + effectiveAmountForBalance;
7496
- destbalanceAfterResult = destFeeDetail.currency !== destAsset.symbol && destination !== 'Ethereum' ? new UnableToComputeError('Unable to compute if dest balance will be sufficient. Fee currency is not the same') : destBalanceAfter;
7497
- isAssetHubToAssetHubRoute = origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot' || origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama';
7498
- if (isAssetHubToAssetHubRoute) {
7497
+ destBalanceSufficient = effectiveAmountForBalance - effectiveDestFee > (destBalance < edDest ? edDest : 0n);
7498
+ destBalanceAfter = destBalance - effectiveDestFee + effectiveAmountForBalance;
7499
+ createUnableToComputeError = function createUnableToComputeError() {
7500
+ return new UnableToComputeError('Unable to compute if dest balance will be sufficient. Fee currency is not the same');
7501
+ };
7502
+ isUnableToCompute = destFeeDetail.feeType === 'paymentInfo' && !destFeeAssetEqual;
7503
+ destbalanceAfterResult = isUnableToCompute ? createUnableToComputeError() : destBalanceAfter;
7504
+ destBalanceSufficientResult = isUnableToCompute ? createUnableToComputeError() : destBalanceSufficient;
7505
+ isSubBridge = sdkCommon.isSubstrateBridge(origin, destination);
7506
+ if (isSubBridge) {
7499
7507
  nativeAssetOfOriginSymbol = assets.getNativeAssetSymbol(origin);
7500
7508
  isOriginAssetNative = false;
7501
7509
  if (destAsset.symbol === nativeAssetOfOriginSymbol) {
@@ -7536,7 +7544,7 @@ var buildDestInfo = /*#__PURE__*/function () {
7536
7544
  case 4:
7537
7545
  destXcmFeeBalance = destBalance;
7538
7546
  case 5:
7539
- destXcmFeeBalanceAfter = isFeeAssetAh ? destBalanceAfter : destXcmFeeBalance - destFeeDetail.fee + (destFeeDetail.currency === destAsset.symbol ? effectiveAmountForBalance : 0n);
7547
+ destXcmFeeBalanceAfter = isFeeAssetAh ? destBalanceAfter : destXcmFeeBalance - destFeeDetail.fee + (destFeeAssetEqual ? effectiveAmountForBalance : 0n);
7540
7548
  return _context.a(2, {
7541
7549
  receivedCurrency: {
7542
7550
  sufficient: destBalanceSufficientResult,
@@ -7551,7 +7559,7 @@ var buildDestInfo = /*#__PURE__*/function () {
7551
7559
  fee: destFeeDetail.fee,
7552
7560
  balance: destXcmFeeBalance,
7553
7561
  balanceAfter: destXcmFeeBalanceAfter,
7554
- currencySymbol: destFeeDetail.currency,
7562
+ currencySymbol: destFeeDetail.asset.symbol,
7555
7563
  asset: destFeeDetail.asset
7556
7564
  }
7557
7565
  });
@@ -8566,20 +8574,16 @@ var createTypeThenAutoReserve = /*#__PURE__*/function () {
8566
8574
  };
8567
8575
  }();
8568
8576
 
8569
- var calculateTotalXcmFee = function calculateTotalXcmFee(feeResult) {
8570
- var _feeResult$assetHub;
8571
- var totalFee = 0n;
8572
- if (((_feeResult$assetHub = feeResult.assetHub) === null || _feeResult$assetHub === void 0 ? void 0 : _feeResult$assetHub.fee) !== undefined) {
8573
- totalFee += feeResult.assetHub.fee;
8574
- }
8575
- if (feeResult.destination.fee !== undefined) {
8576
- totalFee += feeResult.destination.fee;
8577
- }
8578
- return totalFee;
8577
+ var calculateTotalXcmFee = function calculateTotalXcmFee(asset, feeResult) {
8578
+ var totalHopFee = feeResult.hops.reduce(function (acc, hop) {
8579
+ return assets.isAssetXcEqual(hop.result.asset, asset) ? acc + hop.result.fee : acc;
8580
+ }, 0n);
8581
+ var destFee = assets.isAssetXcEqual(feeResult.destination.asset, asset) ? feeResult.destination.fee : 0n;
8582
+ return totalHopFee + destFee;
8579
8583
  };
8580
8584
  var verifyEdOnDestinationInternal = /*#__PURE__*/function () {
8581
8585
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
8582
- var api, buildTx, origin, destination, currency, address, senderAddress, feeAsset, destApi, asset, amount, destAsset, ed, balance, xcmFeeResult, dryRunError, assetHubFeeResult, bridgeHubFeeResult, _xcmFeeResult$destina, destFee, destFeeCurrency, destDryRunError, hopDryRunError, tx, totalFee, method, feeToSubtract;
8586
+ var api, buildTx, origin, destination, currency, address, senderAddress, feeAsset, isSubBridge, destApi, asset, amount, destAsset, ed, balance, xcmFeeResult, dryRunError, hops, _xcmFeeResult$destina, destFee, destFeeType, destFeeAsset, destDryRunError, erroredHop, hopError, isUnableToCompute, tx, totalFee, method, feeToSubtract;
8583
8587
  return _regenerator().w(function (_context) {
8584
8588
  while (1) switch (_context.n) {
8585
8589
  case 0:
@@ -8591,36 +8595,31 @@ var verifyEdOnDestinationInternal = /*#__PURE__*/function () {
8591
8595
  return _context.a(2, true);
8592
8596
  case 1:
8593
8597
  validateAddress(api, address, destination, true);
8594
- if (!(origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama')) {
8598
+ isSubBridge = sdkCommon.isSubstrateBridge(origin, destination);
8599
+ if (!isSubBridge) {
8595
8600
  _context.n = 2;
8596
8601
  break;
8597
8602
  }
8598
- throw new InvalidParameterError('Kusama is outside of Polkadot ecosystem, thus function is unable to verify the existential deposit for it.');
8603
+ throw new InvalidParameterError('Unable to verify the existential deposit for substrate bridge scenarios');
8599
8604
  case 2:
8600
- if (!(origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot')) {
8601
- _context.n = 3;
8602
- break;
8603
- }
8604
- throw new InvalidParameterError('Polkadot is outside of Kusama ecosystem, thus function is unable to verify the existential deposit for it.');
8605
- case 3:
8606
8605
  destApi = api.clone();
8607
- _context.n = 4;
8606
+ _context.n = 3;
8608
8607
  return destApi.init(destination);
8609
- case 4:
8608
+ case 3:
8610
8609
  asset = assets.findAssetOnDestOrThrow(origin, destination, currency);
8611
8610
  amount = abstractDecimals(currency.amount, asset.decimals, api);
8612
8611
  destAsset = assets.findAssetOnDestOrThrow(origin, destination, currency);
8613
8612
  ed = assets.getEdFromAssetOrThrow(destAsset);
8614
- _context.n = 5;
8613
+ _context.n = 4;
8615
8614
  return getAssetBalanceInternal({
8616
8615
  address: address,
8617
8616
  chain: destination,
8618
8617
  api: destApi,
8619
8618
  asset: destAsset
8620
8619
  });
8621
- case 5:
8620
+ case 4:
8622
8621
  balance = _context.v;
8623
- _context.n = 6;
8622
+ _context.n = 5;
8624
8623
  return getXcmFeeInternal({
8625
8624
  api: api,
8626
8625
  buildTx: buildTx,
@@ -8634,39 +8633,43 @@ var verifyEdOnDestinationInternal = /*#__PURE__*/function () {
8634
8633
  feeAsset: feeAsset,
8635
8634
  disableFallback: false
8636
8635
  });
8637
- case 6:
8636
+ case 5:
8638
8637
  xcmFeeResult = _context.v;
8639
- dryRunError = xcmFeeResult.origin.dryRunError, assetHubFeeResult = xcmFeeResult.assetHub, bridgeHubFeeResult = xcmFeeResult.bridgeHub, _xcmFeeResult$destina = xcmFeeResult.destination, destFee = _xcmFeeResult$destina.fee, destFeeCurrency = _xcmFeeResult$destina.currency, destDryRunError = _xcmFeeResult$destina.dryRunError;
8638
+ dryRunError = xcmFeeResult.origin.dryRunError, hops = xcmFeeResult.hops, _xcmFeeResult$destina = xcmFeeResult.destination, destFee = _xcmFeeResult$destina.fee, destFeeType = _xcmFeeResult$destina.feeType, destFeeAsset = _xcmFeeResult$destina.asset, destDryRunError = _xcmFeeResult$destina.dryRunError;
8640
8639
  if (!dryRunError) {
8641
- _context.n = 7;
8640
+ _context.n = 6;
8642
8641
  break;
8643
8642
  }
8644
8643
  throw new DryRunFailedError(dryRunError, 'origin');
8645
- case 7:
8646
- hopDryRunError = (assetHubFeeResult === null || assetHubFeeResult === void 0 ? void 0 : assetHubFeeResult.dryRunError) || (bridgeHubFeeResult === null || bridgeHubFeeResult === void 0 ? void 0 : bridgeHubFeeResult.dryRunError);
8647
- if (!hopDryRunError) {
8648
- _context.n = 8;
8644
+ case 6:
8645
+ erroredHop = hops.find(function (hop) {
8646
+ return hop.result.dryRunError;
8647
+ });
8648
+ hopError = erroredHop === null || erroredHop === void 0 ? void 0 : erroredHop.result.dryRunError;
8649
+ if (!hopError) {
8650
+ _context.n = 7;
8649
8651
  break;
8650
8652
  }
8651
- throw new DryRunFailedError(hopDryRunError, assetHubFeeResult !== null && assetHubFeeResult !== void 0 && assetHubFeeResult.dryRunError ? 'assetHub' : 'bridgeHub');
8652
- case 8:
8653
+ throw new DryRunFailedError(hopError, erroredHop.chain);
8654
+ case 7:
8653
8655
  if (!destDryRunError) {
8654
- _context.n = 9;
8656
+ _context.n = 8;
8655
8657
  break;
8656
8658
  }
8657
8659
  throw new UnableToComputeError("Unable to compute fee for the destination asset. Destination dry run error: ".concat(destDryRunError));
8658
- case 9:
8659
- if (!(assets.normalizeSymbol(asset.symbol) !== assets.normalizeSymbol(destFeeCurrency))) {
8660
- _context.n = 10;
8660
+ case 8:
8661
+ isUnableToCompute = !assets.isSymbolMatch(assets.normalizeSymbol(destAsset.symbol), assets.normalizeSymbol(destFeeAsset.symbol)) && destFeeType === 'paymentInfo';
8662
+ if (!isUnableToCompute) {
8663
+ _context.n = 9;
8661
8664
  break;
8662
8665
  }
8663
8666
  throw new UnableToComputeError("The XCM fee could not be calculated because the origin or destination chain does not support DryRun.\n As a result, fee estimation is only available through PaymentInfo, which provides the cost in the native asset.\n This limitation restricts support to transfers involving the native asset of the Destination chain only.");
8664
- case 10:
8665
- _context.n = 11;
8667
+ case 9:
8668
+ _context.n = 10;
8666
8669
  return buildTx();
8667
- case 11:
8670
+ case 10:
8668
8671
  tx = _context.v;
8669
- totalFee = calculateTotalXcmFee(xcmFeeResult);
8672
+ totalFee = calculateTotalXcmFee(asset, xcmFeeResult);
8670
8673
  method = api.getMethod(tx);
8671
8674
  if (method === 'transfer_assets_using_type_and_then' || method === 'transferAssetsUsingTypeAndThen') {
8672
8675
  feeToSubtract = totalFee;
@@ -8795,7 +8798,7 @@ var Parachain = /*#__PURE__*/function () {
8795
8798
  throw new InvalidParameterError('Relaychain assets can only be transferred using the type-and-then method which is not supported by this chain');
8796
8799
  case 3:
8797
8800
  isSubBridge = !sdkCommon.isTLocation(destination) && sdkCommon.isSubstrateBridge(this.chain, destination);
8798
- useTypeAndThen = isRelayAsset && supportsTypeThen && destChain && !feeAsset && (!sdkCommon.isTrustedChain(this.chain) || !sdkCommon.isTrustedChain(destChain)) || isSubBridge;
8801
+ useTypeAndThen = isRelayAsset && supportsTypeThen && destChain && !sdkCommon.isExternalChain(destChain) && !feeAsset && (!sdkCommon.isTrustedChain(this.chain) || !sdkCommon.isTrustedChain(destChain)) || isSubBridge;
8799
8802
  if (!(supportsXTokens(this) && this.canUseXTokens(sendOptions) && !useTypeAndThen)) {
8800
8803
  _context.n = 5;
8801
8804
  break;
@@ -9207,6 +9210,8 @@ var Parachain = /*#__PURE__*/function () {
9207
9210
  PARA_TO_PARA_FEE_DOT,
9208
9211
  fee,
9209
9212
  ethAssetInfo,
9213
+ systemAssetInfo,
9214
+ shouldIncludeFeeAsset,
9210
9215
  customXcmOnDest,
9211
9216
  messageId,
9212
9217
  call,
@@ -9243,15 +9248,13 @@ var Parachain = /*#__PURE__*/function () {
9243
9248
  executionFee = _yield$getParaEthTran2[1];
9244
9249
  PARA_TO_PARA_FEE_DOT = 5000000000n; // 0.5 DOT
9245
9250
  fee = useOnlyDepositInstruction ? PARA_TO_PARA_FEE_DOT : bridgeFee + executionFee;
9246
- ethAssetInfo = assets.findAssetInfoByLoc(assets.getOtherAssets('Ethereum'), asset.location);
9247
- if (ethAssetInfo) {
9248
- _context4.n = 5;
9249
- break;
9250
- }
9251
- throw new assets.InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt)));
9252
- case 5:
9251
+ ethAssetInfo = assets.findAssetInfoOrThrow('Ethereum', {
9252
+ symbol: asset.symbol
9253
+ }, null);
9254
+ systemAssetInfo = assets.findNativeAssetInfoOrThrow(getRelayChainOf(this.chain));
9255
+ shouldIncludeFeeAsset = feeAsset && !assets.isAssetEqual(feeAsset, asset) || !assets.isAssetEqual(asset, systemAssetInfo);
9253
9256
  if (!useOnlyDepositInstruction) {
9254
- _context4.n = 6;
9257
+ _context4.n = 5;
9255
9258
  break;
9256
9259
  }
9257
9260
  customXcmOnDest = addXcmVersionHeader([{
@@ -9268,24 +9271,24 @@ var Parachain = /*#__PURE__*/function () {
9268
9271
  })
9269
9272
  }
9270
9273
  }], version);
9271
- _context4.n = 8;
9274
+ _context4.n = 7;
9272
9275
  break;
9273
- case 6:
9276
+ case 5:
9274
9277
  assertHasId(ethAssetInfo);
9275
- _context4.n = 7;
9278
+ _context4.n = 6;
9276
9279
  return generateMessageId(api, senderAddress, getParaId(this.chain), ethAssetInfo.assetId, address, asset.amount);
9277
- case 7:
9280
+ case 6:
9278
9281
  messageId = _context4.v;
9279
- customXcmOnDest = createCustomXcmOnDest(input, this.chain, messageId);
9280
- case 8:
9282
+ customXcmOnDest = createCustomXcmOnDest(input, this.chain, messageId, ethAssetInfo);
9283
+ case 7:
9281
9284
  call = {
9282
9285
  module: 'PolkadotXcm',
9283
9286
  method: 'transfer_assets_using_type_and_then',
9284
9287
  params: {
9285
9288
  dest: createVersionedDestination(version, this.chain, destination, getParaId('AssetHubPolkadot')),
9286
- assets: addXcmVersionHeader([].concat(_toConsumableArray(!feeAsset ? [createAsset(version, fee, DOT_LOCATION)] : []), [ethAsset]), version),
9289
+ assets: addXcmVersionHeader([].concat(_toConsumableArray(shouldIncludeFeeAsset ? [createAsset(version, fee, DOT_LOCATION)] : []), [ethAsset]), version),
9287
9290
  assets_transfer_type: 'DestinationReserve',
9288
- remote_fees_id: addXcmVersionHeader((_feeAsset$location = feeAsset === null || feeAsset === void 0 ? void 0 : feeAsset.location) !== null && _feeAsset$location !== void 0 ? _feeAsset$location : DOT_LOCATION, version),
9291
+ remote_fees_id: addXcmVersionHeader((_feeAsset$location = feeAsset === null || feeAsset === void 0 ? void 0 : feeAsset.location) !== null && _feeAsset$location !== void 0 ? _feeAsset$location : shouldIncludeFeeAsset ? DOT_LOCATION : asset.location, version),
9289
9292
  fees_transfer_type: 'DestinationReserve',
9290
9293
  custom_xcm_on_dest: customXcmOnDest,
9291
9294
  weight_limit: 'Unlimited'
@@ -9387,7 +9390,7 @@ var Acala = /*#__PURE__*/function (_Parachain) {
9387
9390
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Acala';
9388
9391
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'acala';
9389
9392
  var ecosystem = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Polkadot';
9390
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
9393
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
9391
9394
  _classCallCheck(this, Acala);
9392
9395
  return _callSuper(this, Acala, [chain, info, ecosystem, version]);
9393
9396
  }
@@ -9499,7 +9502,7 @@ var Ajuna = /*#__PURE__*/function (_Parachain) {
9499
9502
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Ajuna';
9500
9503
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ajuna';
9501
9504
  var ecosystem = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Polkadot';
9502
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
9505
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
9503
9506
  _classCallCheck(this, Ajuna);
9504
9507
  return _callSuper(this, Ajuna, [chain, info, ecosystem, version]);
9505
9508
  }
@@ -9591,7 +9594,7 @@ var transferPolkadotXcm = function transferPolkadotXcm(_ref, method) {
9591
9594
  var AjunaPaseo = /*#__PURE__*/function (_Parachain) {
9592
9595
  function AjunaPaseo() {
9593
9596
  _classCallCheck(this, AjunaPaseo);
9594
- return _callSuper(this, AjunaPaseo, ['AjunaPaseo', 'Ajuna(paseo)', 'Paseo', sdkCommon.Version.V4]);
9597
+ return _callSuper(this, AjunaPaseo, ['AjunaPaseo', 'Ajuna(paseo)', 'Paseo', sdkCommon.Version.V5]);
9595
9598
  }
9596
9599
  _inherits(AjunaPaseo, _Parachain);
9597
9600
  return _createClass(AjunaPaseo, [{
@@ -9726,7 +9729,6 @@ var AssetHubKusama = /*#__PURE__*/function (_Parachain) {
9726
9729
  key: "getMethod",
9727
9730
  value: function getMethod(scenario, destination) {
9728
9731
  var isTrusted = !sdkCommon.isTLocation(destination) && sdkCommon.isTrustedChain(destination);
9729
- if (destination === 'IntegriteeKusama') return 'transfer_assets';
9730
9732
  return scenario === 'ParaToPara' && !isTrusted ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
9731
9733
  }
9732
9734
  }, {
@@ -10673,7 +10675,6 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
10673
10675
  }
10674
10676
  throw new InvalidParameterError('Location address is not supported for Ethereum transfers');
10675
10677
  case 3:
10676
- assertIsForeign(asset);
10677
10678
  assertHasLocation(asset);
10678
10679
  _context.n = 4;
10679
10680
  return generateMessageId(api, senderAddress, getParaId(this.chain), JSON.stringify(asset.location), address, asset.amount);
@@ -10736,7 +10737,6 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
10736
10737
  }
10737
10738
  throw new BridgeHaltedError();
10738
10739
  case 2:
10739
- assertIsForeign(asset);
10740
10740
  assertHasLocation(asset);
10741
10741
  if (!(asset.symbol === this.getNativeAssetSymbol() || asset.symbol === assets.getNativeAssetSymbol('Kusama'))) {
10742
10742
  _context2.n = 3;
@@ -11936,104 +11936,6 @@ var HydrationPaseo = /*#__PURE__*/function (_Hydration) {
11936
11936
  return _createClass(HydrationPaseo);
11937
11937
  }(Hydration);
11938
11938
 
11939
- var IntegriteePolkadot = /*#__PURE__*/function (_Parachain) {
11940
- function IntegriteePolkadot() {
11941
- var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'IntegriteePolkadot';
11942
- var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'integritee';
11943
- var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Polkadot';
11944
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
11945
- _classCallCheck(this, IntegriteePolkadot);
11946
- return _callSuper(this, IntegriteePolkadot, [chain, info, type, version]);
11947
- }
11948
- _inherits(IntegriteePolkadot, _Parachain);
11949
- return _createClass(IntegriteePolkadot, [{
11950
- key: "transferPolkadotXCM",
11951
- value: function transferPolkadotXCM(input) {
11952
- return transferPolkadotXcm(input, 'transfer_assets', 'Unlimited');
11953
- }
11954
- }, {
11955
- key: "transferRelayToPara",
11956
- value: function transferRelayToPara() {
11957
- throw new ChainNotSupportedError();
11958
- }
11959
- }, {
11960
- key: "isSendingTempDisabled",
11961
- value: function isSendingTempDisabled(_options) {
11962
- return true;
11963
- }
11964
- }, {
11965
- key: "isReceivingTempDisabled",
11966
- value: function isReceivingTempDisabled(_scenario) {
11967
- return true;
11968
- }
11969
- }, {
11970
- key: "transferLocalNonNativeAsset",
11971
- value: function transferLocalNonNativeAsset(options) {
11972
- var api = options.api,
11973
- asset = options.assetInfo,
11974
- address = options.address,
11975
- isAmountAll = options.isAmountAll;
11976
- assertHasId(asset);
11977
- var assetId = Number(asset.assetId);
11978
- var dest = {
11979
- Id: address
11980
- };
11981
- if (isAmountAll) {
11982
- return api.deserializeExtrinsics({
11983
- module: 'Assets',
11984
- method: 'transfer_all',
11985
- params: {
11986
- id: assetId,
11987
- dest: dest,
11988
- keep_alive: false
11989
- }
11990
- });
11991
- }
11992
- return api.deserializeExtrinsics({
11993
- module: 'Assets',
11994
- method: 'transfer',
11995
- params: {
11996
- id: assetId,
11997
- target: dest,
11998
- amount: asset.amount
11999
- }
12000
- });
12001
- }
12002
- }]);
12003
- }(Parachain);
12004
-
12005
- var IntegriteeKusama = /*#__PURE__*/function (_IntegriteePolkadot) {
12006
- function IntegriteeKusama() {
12007
- var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'IntegriteeKusama';
12008
- var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'integritee';
12009
- var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Kusama';
12010
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
12011
- _classCallCheck(this, IntegriteeKusama);
12012
- return _callSuper(this, IntegriteeKusama, [chain, info, type, version]);
12013
- }
12014
- _inherits(IntegriteeKusama, _IntegriteePolkadot);
12015
- return _createClass(IntegriteeKusama);
12016
- }(IntegriteePolkadot);
12017
-
12018
- var IntegriteePaseo = /*#__PURE__*/function (_IntegriteeKusama) {
12019
- function IntegriteePaseo() {
12020
- _classCallCheck(this, IntegriteePaseo);
12021
- return _callSuper(this, IntegriteePaseo, ['IntegriteePaseo', 'integritee', 'Paseo', sdkCommon.Version.V4]);
12022
- }
12023
- _inherits(IntegriteePaseo, _IntegriteeKusama);
12024
- return _createClass(IntegriteePaseo, [{
12025
- key: "isSendingTempDisabled",
12026
- value: function isSendingTempDisabled(_options) {
12027
- return true;
12028
- }
12029
- }, {
12030
- key: "isReceivingTempDisabled",
12031
- value: function isReceivingTempDisabled(_scenario) {
12032
- return true;
12033
- }
12034
- }]);
12035
- }(IntegriteeKusama);
12036
-
12037
11939
  var Interlay = /*#__PURE__*/function (_Parachain) {
12038
11940
  function Interlay() {
12039
11941
  _classCallCheck(this, Interlay);
@@ -12154,7 +12056,7 @@ Jamton.NATIVE_ASSET_IDS = {
12154
12056
  var Karura = /*#__PURE__*/function (_Acala) {
12155
12057
  function Karura() {
12156
12058
  _classCallCheck(this, Karura);
12157
- return _callSuper(this, Karura, ['Karura', 'karura', 'Kusama', sdkCommon.Version.V4]);
12059
+ return _callSuper(this, Karura, ['Karura', 'karura', 'Kusama', sdkCommon.Version.V5]);
12158
12060
  }
12159
12061
  _inherits(Karura, _Acala);
12160
12062
  return _createClass(Karura);
@@ -12194,7 +12096,17 @@ var KiltPaseo = /*#__PURE__*/function (_KiltSpiritnet) {
12194
12096
  return _callSuper(this, KiltPaseo, ['KiltPaseo', 'kilt', 'Paseo', sdkCommon.Version.V4]);
12195
12097
  }
12196
12098
  _inherits(KiltPaseo, _KiltSpiritnet);
12197
- return _createClass(KiltPaseo);
12099
+ return _createClass(KiltPaseo, [{
12100
+ key: "isSendingTempDisabled",
12101
+ value: function isSendingTempDisabled(_options) {
12102
+ return true;
12103
+ }
12104
+ }, {
12105
+ key: "isReceivingTempDisabled",
12106
+ value: function isReceivingTempDisabled(_scenario) {
12107
+ return true;
12108
+ }
12109
+ }]);
12198
12110
  }(KiltSpiritnet);
12199
12111
 
12200
12112
  var Kintsugi = /*#__PURE__*/function (_Parachain) {
@@ -12327,16 +12239,6 @@ var Manta = /*#__PURE__*/function (_Parachain) {
12327
12239
  };
12328
12240
  return transferXTokens(input, currencySelection);
12329
12241
  }
12330
- }, {
12331
- key: "isSendingTempDisabled",
12332
- value: function isSendingTempDisabled(_options) {
12333
- return true;
12334
- }
12335
- }, {
12336
- key: "isReceivingTempDisabled",
12337
- value: function isReceivingTempDisabled(_scenario) {
12338
- return true;
12339
- }
12340
12242
  }, {
12341
12243
  key: "transferLocalNonNativeAsset",
12342
12244
  value: function transferLocalNonNativeAsset(options) {
@@ -12433,27 +12335,25 @@ var Moonriver = /*#__PURE__*/function (_Parachain) {
12433
12335
 
12434
12336
  var createTypeAndThenTransfer = /*#__PURE__*/function () {
12435
12337
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options, chain, version) {
12436
- var api, asset, senderAddress, address, destination, messageId, nativeMythAmount;
12338
+ var api, asset, senderAddress, address, destination, ethAsset, messageId, nativeMythAmount;
12437
12339
  return _regenerator().w(function (_context) {
12438
12340
  while (1) switch (_context.n) {
12439
12341
  case 0:
12440
12342
  api = options.api, asset = options.assetInfo, senderAddress = options.senderAddress, address = options.address, destination = options.destination;
12441
- assertHasLocation(asset);
12343
+ ethAsset = assets.findAssetInfoOrThrow('Ethereum', {
12344
+ symbol: asset.symbol
12345
+ }, null);
12346
+ assertHasLocation(ethAsset);
12347
+ assertHasId(ethAsset);
12442
12348
  assertAddressIsString(address);
12443
12349
  assertSenderAddress(senderAddress);
12444
- if (!(!assets.isForeignAsset(asset) || !asset.assetId)) {
12445
- _context.n = 1;
12446
- break;
12447
- }
12448
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " is not a foreign asset"));
12350
+ _context.n = 1;
12351
+ return generateMessageId(api, senderAddress, getParaId(chain), ethAsset.assetId, address, asset.amount);
12449
12352
  case 1:
12450
- _context.n = 2;
12451
- return generateMessageId(api, senderAddress, getParaId(chain), asset.assetId, address, asset.amount);
12452
- case 2:
12453
12353
  messageId = _context.v;
12454
- _context.n = 3;
12354
+ _context.n = 2;
12455
12355
  return getMythosOriginFee(api);
12456
- case 3:
12356
+ case 2:
12457
12357
  nativeMythAmount = _context.v;
12458
12358
  return _context.a(2, {
12459
12359
  module: 'PolkadotXcm',
@@ -12463,14 +12363,14 @@ var createTypeAndThenTransfer = /*#__PURE__*/function () {
12463
12363
  assets: _defineProperty({}, version, [createAsset(version, nativeMythAmount, {
12464
12364
  parents: sdkCommon.Parents.ZERO,
12465
12365
  interior: 'Here'
12466
- }), createAsset(version, asset.amount, asset.location)]),
12366
+ }), createAsset(version, asset.amount, ethAsset.location)]),
12467
12367
  assets_transfer_type: 'DestinationReserve',
12468
12368
  remote_fees_id: _defineProperty({}, version, {
12469
12369
  parents: sdkCommon.Parents.ZERO,
12470
12370
  interior: 'Here'
12471
12371
  }),
12472
12372
  fees_transfer_type: 'Teleport',
12473
- custom_xcm_on_dest: createCustomXcmOnDest(options, chain, messageId),
12373
+ custom_xcm_on_dest: createCustomXcmOnDest(options, chain, messageId, ethAsset),
12474
12374
  weight_limit: 'Unlimited'
12475
12375
  }
12476
12376
  });
@@ -12491,15 +12391,10 @@ var Mythos = /*#__PURE__*/function (_Parachain) {
12491
12391
  key: "createTx",
12492
12392
  value: function createTx(input) {
12493
12393
  var scenario = input.scenario,
12494
- asset = input.assetInfo,
12495
12394
  destination = input.destination;
12496
12395
  if (scenario !== 'ParaToPara') {
12497
12396
  throw new ScenarioNotSupportedError(this.chain, scenario);
12498
12397
  }
12499
- var nativeSymbol = this.getNativeAssetSymbol();
12500
- if (asset.symbol !== nativeSymbol) {
12501
- throw new assets.InvalidCurrencyError("Chain ".concat(this.chain, " does not support currency ").concat(asset.symbol));
12502
- }
12503
12398
  return transferPolkadotXcm(input, destination === 'AssetHubPolkadot' ? 'limited_teleport_assets' : 'limited_reserve_transfer_assets', 'Unlimited');
12504
12399
  }
12505
12400
  }, {
@@ -12653,25 +12548,6 @@ var Nodle = /*#__PURE__*/function (_Parachain) {
12653
12548
  }]);
12654
12549
  }(Parachain);
12655
12550
 
12656
- var NodlePaseo = /*#__PURE__*/function (_Nodle) {
12657
- function NodlePaseo() {
12658
- _classCallCheck(this, NodlePaseo);
12659
- return _callSuper(this, NodlePaseo, ['NodlePaseo', 'NodleParadis', 'Paseo', sdkCommon.Version.V4]);
12660
- }
12661
- _inherits(NodlePaseo, _Nodle);
12662
- return _createClass(NodlePaseo, [{
12663
- key: "isSendingTempDisabled",
12664
- value: function isSendingTempDisabled(_options) {
12665
- return true;
12666
- }
12667
- }, {
12668
- key: "isReceivingTempDisabled",
12669
- value: function isReceivingTempDisabled(_scenario) {
12670
- return true;
12671
- }
12672
- }]);
12673
- }(Nodle);
12674
-
12675
12551
  var PeoplePolkadot = /*#__PURE__*/function (_Parachain) {
12676
12552
  function PeoplePolkadot() {
12677
12553
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'PeoplePolkadot';
@@ -12743,16 +12619,6 @@ var Peaq = /*#__PURE__*/function (_Parachain) {
12743
12619
  value: function transferRelayToPara() {
12744
12620
  throw new ChainNotSupportedError();
12745
12621
  }
12746
- }, {
12747
- key: "isSendingTempDisabled",
12748
- value: function isSendingTempDisabled(_options) {
12749
- return true;
12750
- }
12751
- }, {
12752
- key: "isReceivingTempDisabled",
12753
- value: function isReceivingTempDisabled(_scenario) {
12754
- return true;
12755
- }
12756
12622
  }, {
12757
12623
  key: "transferLocalNonNativeAsset",
12758
12624
  value: function transferLocalNonNativeAsset(options) {
@@ -13010,6 +12876,16 @@ var RobonomicsKusama = /*#__PURE__*/function (_Parachain) {
13010
12876
  value: function transferLocalNonNativeAsset(options) {
13011
12877
  return getChain('RobonomicsPolkadot').transferLocalNonNativeAsset(options);
13012
12878
  }
12879
+ }, {
12880
+ key: "isSendingTempDisabled",
12881
+ value: function isSendingTempDisabled(_options) {
12882
+ return true;
12883
+ }
12884
+ }, {
12885
+ key: "isReceivingTempDisabled",
12886
+ value: function isReceivingTempDisabled(_scenario) {
12887
+ return true;
12888
+ }
13013
12889
  }]);
13014
12890
  }(Parachain);
13015
12891
 
@@ -13275,7 +13151,6 @@ var chains = function chains() {
13275
13151
  Darwinia: new Darwinia(),
13276
13152
  EnergyWebX: new EnergyWebX(),
13277
13153
  Hydration: new Hydration(),
13278
- IntegriteePolkadot: new IntegriteePolkadot(),
13279
13154
  Interlay: new Interlay(),
13280
13155
  Heima: new Heima(),
13281
13156
  Jamton: new Jamton(),
@@ -13298,7 +13173,6 @@ var chains = function chains() {
13298
13173
  AssetHubKusama: new AssetHubKusama(),
13299
13174
  BridgeHubKusama: new BridgeHubKusama(),
13300
13175
  CoretimeKusama: new CoretimeKusama(),
13301
- IntegriteeKusama: new IntegriteeKusama(),
13302
13176
  Encointer: new Encointer(),
13303
13177
  Altair: new Altair(),
13304
13178
  Amplitude: new Amplitude(),
@@ -13327,7 +13201,6 @@ var chains = function chains() {
13327
13201
  BridgeHubPaseo: new BridgeHubPaseo(),
13328
13202
  CoretimePaseo: new CoretimePaseo(),
13329
13203
  EnergyWebXPaseo: new EnergyWebXPaseo(),
13330
- IntegriteePaseo: new IntegriteePaseo(),
13331
13204
  KiltPaseo: new KiltPaseo(),
13332
13205
  PAssetHub: new PAssetHub(),
13333
13206
  PeoplePaseo: new PeoplePaseo(),
@@ -13337,7 +13210,6 @@ var chains = function chains() {
13337
13210
  HydrationPaseo: new HydrationPaseo(),
13338
13211
  LaosPaseo: new LaosPaseo(),
13339
13212
  NeuroWebPaseo: new NeuroWebPaseo(),
13340
- NodlePaseo: new NodlePaseo(),
13341
13213
  ZeitgeistPaseo: new ZeitgeistPaseo()
13342
13214
  };
13343
13215
  };