@paraspell/sdk-core 10.10.10 → 10.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -522,6 +522,26 @@ var InvalidParameterError = /*#__PURE__*/function (_Error) {
522
522
  return _createClass(InvalidParameterError);
523
523
  }(/*#__PURE__*/_wrapNativeSuper(Error));
524
524
 
525
+ /**
526
+ * Error development mode is on and no API override is provided for a specific chain.
527
+ */
528
+ var MissingChainApiError = /*#__PURE__*/function (_Error) {
529
+ /**
530
+ * Constructs a new MissingChainApiError.
531
+ *
532
+ * @param chain - The node for which the API is missing.
533
+ */
534
+ function MissingChainApiError(chain) {
535
+ var _this;
536
+ _classCallCheck(this, MissingChainApiError);
537
+ _this = _callSuper(this, MissingChainApiError, ["Development mode requires an API override for ".concat(chain, ". ") + "Please provide an API client or WebSocket URL in the apiOverrides configuration."]);
538
+ _this.name = 'MissingChainApiError';
539
+ return _this;
540
+ }
541
+ _inherits(MissingChainApiError, _Error);
542
+ return _createClass(MissingChainApiError);
543
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
544
+
525
545
  /**
526
546
  * Used to inform user, that Parachain they wish to use is not supported yet
527
547
  */
@@ -723,10 +743,28 @@ var assertAddressIsString = function assertAddressIsString(address) {
723
743
  };
724
744
  var assertHasLocation = function assertHasLocation(asset) {
725
745
  if (!asset.multiLocation) {
726
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is missing multi-location"));
746
+ throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " is missing multi-location"));
747
+ }
748
+ };
749
+ var assertHasId = function assertHasId(asset) {
750
+ assertIsForeign(asset);
751
+ if (asset.assetId === undefined) {
752
+ throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " has no assetId"));
753
+ }
754
+ };
755
+ var assertIsForeign = function assertIsForeign(asset) {
756
+ if (!assets.isForeignAsset(asset)) {
757
+ throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " is not a foreign asset"));
727
758
  }
728
759
  };
729
760
 
761
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
762
+ var isConfig = function isConfig(value) {
763
+ return _typeof(value) === 'object' && value !== null && !Array.isArray(value) && (
764
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
765
+ Object.keys(value).length === 0 || 'apiOverrides' in value || 'development' in value);
766
+ };
767
+
730
768
  /**
731
769
  * Retrieves the node instance for a given node.
732
770
  *
@@ -740,7 +778,7 @@ var getNode = function getNode(node) {
740
778
 
741
779
  var getChainVersion = function getChainVersion(chain) {
742
780
  if (sdkCommon.isRelayChain(chain) || chain === 'Ethereum') {
743
- return sdkCommon.Version.V4;
781
+ return sdkCommon.Version.V5;
744
782
  }
745
783
  return getNode(chain).version;
746
784
  };
@@ -1055,6 +1093,28 @@ var Darwinia$1 = {
1055
1093
  }
1056
1094
  ]
1057
1095
  };
1096
+ var EnergyWebX$1 = {
1097
+ name: "Energy Web X",
1098
+ info: "ewx",
1099
+ paraId: 3345,
1100
+ providers: [
1101
+ {
1102
+ name: "Energy Web",
1103
+ endpoint: "wss://public-rpc.mainnet.energywebx.com/"
1104
+ }
1105
+ ]
1106
+ };
1107
+ var EnergyWebXPaseo$1 = {
1108
+ name: "PEX",
1109
+ info: "paseoEwx",
1110
+ paraId: 3345,
1111
+ providers: [
1112
+ {
1113
+ name: "Energy Web",
1114
+ endpoint: "wss://public-rpc.testnet.energywebx.com/"
1115
+ }
1116
+ ]
1117
+ };
1058
1118
  var Hydration$1 = {
1059
1119
  name: "Hydration",
1060
1120
  info: "hydradx",
@@ -1078,6 +1138,32 @@ var Hydration$1 = {
1078
1138
  }
1079
1139
  ]
1080
1140
  };
1141
+ var IntegriteeKusama$1 = {
1142
+ name: "Integritee Network",
1143
+ info: "integritee",
1144
+ paraId: 2015,
1145
+ providers: [
1146
+ {
1147
+ name: "Integritee",
1148
+ endpoint: "wss://kusama.api.integritee.network"
1149
+ },
1150
+ {
1151
+ name: "OnFinality",
1152
+ endpoint: "wss://integritee-kusama.api.onfinality.io/public-ws"
1153
+ }
1154
+ ]
1155
+ };
1156
+ var IntegriteePaseo$1 = {
1157
+ name: "Integritee Network (Paseo)",
1158
+ info: "integritee",
1159
+ paraId: 2039,
1160
+ providers: [
1161
+ {
1162
+ name: "Integritee",
1163
+ endpoint: "wss://paseo.api.integritee.network"
1164
+ }
1165
+ ]
1166
+ };
1081
1167
  var Interlay$1 = {
1082
1168
  name: "Interlay",
1083
1169
  info: "interlay",
@@ -1912,14 +1998,6 @@ var AssetHubWestend$1 = {
1912
1998
  name: "Dwellir Tunisia",
1913
1999
  endpoint: "wss://westmint-rpc-tn.dwellir.com"
1914
2000
  },
1915
- {
1916
- name: "IBP1",
1917
- endpoint: "wss://sys.ibp.network/asset-hub-westend"
1918
- },
1919
- {
1920
- name: "IBP2",
1921
- endpoint: "wss://asset-hub-westend.dotters.network"
1922
- },
1923
2001
  {
1924
2002
  name: "Parity",
1925
2003
  endpoint: "wss://westend-asset-hub-rpc.polkadot.io"
@@ -1943,14 +2021,6 @@ var BridgeHubWestend$1 = {
1943
2021
  name: "Dwellir Tunisia",
1944
2022
  endpoint: "wss://westend-bridge-hub-rpc-tn.dwellir.com"
1945
2023
  },
1946
- {
1947
- name: "IBP1",
1948
- endpoint: "wss://sys.ibp.network/bridgehub-westend"
1949
- },
1950
- {
1951
- name: "IBP2",
1952
- endpoint: "wss://bridge-hub-westend.dotters.network"
1953
- },
1954
2024
  {
1955
2025
  name: "Parity",
1956
2026
  endpoint: "wss://westend-bridge-hub-rpc.polkadot.io"
@@ -1970,14 +2040,6 @@ var CollectivesWestend$1 = {
1970
2040
  name: "Dwellir Tunisia",
1971
2041
  endpoint: "wss://westend-collectives-rpc-tn.dwellir.com"
1972
2042
  },
1973
- {
1974
- name: "IBP1",
1975
- endpoint: "wss://sys.ibp.network/collectives-westend"
1976
- },
1977
- {
1978
- name: "IBP2",
1979
- endpoint: "wss://collectives-westend.dotters.network"
1980
- },
1981
2043
  {
1982
2044
  name: "Parity",
1983
2045
  endpoint: "wss://westend-collectives-rpc.polkadot.io"
@@ -1993,14 +2055,6 @@ var CoretimeWestend$1 = {
1993
2055
  name: "Dwellir",
1994
2056
  endpoint: "wss://coretime-westend-rpc.n.dwellir.com"
1995
2057
  },
1996
- {
1997
- name: "IBP1",
1998
- endpoint: "wss://sys.ibp.network/coretime-westend"
1999
- },
2000
- {
2001
- name: "IBP2",
2002
- endpoint: "wss://coretime-westend.dotters.network"
2003
- },
2004
2058
  {
2005
2059
  name: "Parity",
2006
2060
  endpoint: "wss://westend-coretime-rpc.polkadot.io"
@@ -2016,14 +2070,6 @@ var PeopleWestend$1 = {
2016
2070
  name: "Dwellir",
2017
2071
  endpoint: "wss://people-westend-rpc.n.dwellir.com"
2018
2072
  },
2019
- {
2020
- name: "IBP1",
2021
- endpoint: "wss://sys.ibp.network/people-westend"
2022
- },
2023
- {
2024
- name: "IBP2",
2025
- endpoint: "wss://people-westend.dotters.network"
2026
- },
2027
2073
  {
2028
2074
  name: "Parity",
2029
2075
  endpoint: "wss://westend-people-rpc.polkadot.io"
@@ -2107,6 +2153,10 @@ var PAssetHub$1 = {
2107
2153
  name: "IBP1",
2108
2154
  endpoint: "wss://passet-hub-paseo.ibp.network"
2109
2155
  },
2156
+ {
2157
+ name: "IBP2",
2158
+ endpoint: "wss://passet-hub-paseo.dotters.network"
2159
+ },
2110
2160
  {
2111
2161
  name: "Parity",
2112
2162
  endpoint: "wss://testnet-passet-hub.polkadot.io"
@@ -2280,6 +2330,10 @@ var Polkadot = {
2280
2330
  name: "RadiumBlock",
2281
2331
  endpoint: "wss://polkadot.public.curie.radiumblock.co/ws"
2282
2332
  },
2333
+ {
2334
+ name: "Simply Staking",
2335
+ endpoint: "wss://spectrum-01.simplystaking.xyz/cG9sa2Fkb3QtMDEtOTFkMmYwZGYtcG9sa2Fkb3Q/uj77qtNEPueW1w/polkadot/mainnet/"
2336
+ },
2283
2337
  {
2284
2338
  name: "Stakeworld",
2285
2339
  endpoint: "wss://dot-rpc.stakeworld.io"
@@ -2350,14 +2404,6 @@ var Westend = {
2350
2404
  name: "Dwellir Tunisia",
2351
2405
  endpoint: "wss://westend-rpc-tn.dwellir.com"
2352
2406
  },
2353
- {
2354
- name: "IBP1",
2355
- endpoint: "wss://rpc.ibp.network/westend"
2356
- },
2357
- {
2358
- name: "IBP2",
2359
- endpoint: "wss://westend.dotters.network"
2360
- },
2361
2407
  {
2362
2408
  name: "OnFinality",
2363
2409
  endpoint: "wss://westend.api.onfinality.io/public-ws"
@@ -2410,7 +2456,11 @@ var configs = {
2410
2456
  Centrifuge: Centrifuge$1,
2411
2457
  ComposableFinance: ComposableFinance$1,
2412
2458
  Darwinia: Darwinia$1,
2459
+ EnergyWebX: EnergyWebX$1,
2460
+ EnergyWebXPaseo: EnergyWebXPaseo$1,
2413
2461
  Hydration: Hydration$1,
2462
+ IntegriteeKusama: IntegriteeKusama$1,
2463
+ IntegriteePaseo: IntegriteePaseo$1,
2414
2464
  Interlay: Interlay$1,
2415
2465
  Heima: Heima$1,
2416
2466
  Jamton: Jamton$1,
@@ -3142,7 +3192,7 @@ var prepareExecuteContext = function prepareExecuteContext(_ref) {
3142
3192
  version = _ref.version;
3143
3193
  assertHasLocation(asset);
3144
3194
  if (feeAsset) assertHasLocation(feeAsset);
3145
- var amount = BigInt(asset.amount);
3195
+ var amount = asset.amount;
3146
3196
  var reserveChain = getAssetReserveChain(chain, destChain, asset.multiLocation);
3147
3197
  var multiAsset = createMultiAsset(version, amount, asset.multiLocation);
3148
3198
  var multiAssetLocalized = createMultiAsset(version, amount, localizeLocation(chain, asset.multiLocation));
@@ -3314,7 +3364,7 @@ var createExecuteExchangeXcm = function createExecuteExchangeXcm(input, origin,
3314
3364
  WithdrawAsset: [{
3315
3365
  id: transformedMultiLocation,
3316
3366
  fun: {
3317
- Fungible: BigInt(asset.amount)
3367
+ Fungible: asset.amount
3318
3368
  }
3319
3369
  }]
3320
3370
  }, {
@@ -3503,55 +3553,40 @@ var getBalanceForeignPolkadotXcm = /*#__PURE__*/function () {
3503
3553
  while (1) switch (_context.n) {
3504
3554
  case 0:
3505
3555
  if (!(node === 'Moonbeam' || node === 'Moonriver')) {
3506
- _context.n = 2;
3507
- break;
3508
- }
3509
- if (!(!assets.isForeignAsset(asset) || !asset.assetId || !asset.multiLocation)) {
3510
3556
  _context.n = 1;
3511
3557
  break;
3512
3558
  }
3513
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no multi-location or assetId"));
3514
- case 1:
3559
+ assertHasId(asset);
3515
3560
  return _context.a(2, getMoonbeamErc20Balance(node, asset.assetId, address));
3516
- case 2:
3561
+ case 1:
3517
3562
  if (!(node === 'Mythos')) {
3518
- _context.n = 3;
3563
+ _context.n = 2;
3519
3564
  break;
3520
3565
  }
3521
3566
  return _context.a(2, api.getMythosForeignBalance(address));
3522
- case 3:
3523
- if (assets.isForeignAsset(asset)) {
3524
- _context.n = 4;
3525
- break;
3526
- }
3527
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
3528
- case 4:
3567
+ case 2:
3568
+ assertIsForeign(asset);
3529
3569
  if (!(node === 'Polimec')) {
3530
- _context.n = 6;
3531
- break;
3532
- }
3533
- if (!(asset.multiLocation === undefined)) {
3534
- _context.n = 5;
3570
+ _context.n = 3;
3535
3571
  break;
3536
3572
  }
3537
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no multi-location"));
3538
- case 5:
3573
+ assertHasLocation(asset);
3539
3574
  return _context.a(2, api.getBalanceForeignAssetsPallet(address, asset.multiLocation));
3540
- case 6:
3575
+ case 3:
3541
3576
  if (!(node === 'AssetHubPolkadot')) {
3542
- _context.n = 8;
3577
+ _context.n = 5;
3543
3578
  break;
3544
3579
  }
3545
3580
  ASSETS_PALLET_ID = 50;
3546
3581
  hasRequiredJunctions = asset.multiLocation && sdkCommon.hasJunction(asset.multiLocation, 'PalletInstance', ASSETS_PALLET_ID) && sdkCommon.hasJunction(asset.multiLocation, 'GeneralIndex');
3547
3582
  if (!(!asset.multiLocation || hasRequiredJunctions)) {
3548
- _context.n = 7;
3583
+ _context.n = 4;
3549
3584
  break;
3550
3585
  }
3551
3586
  return _context.a(2, api.getBalanceAssetsPallet(address, Number(asset.assetId)));
3552
- case 7:
3587
+ case 4:
3553
3588
  return _context.a(2, api.getBalanceForeignAssetsPallet(address, asset.multiLocation));
3554
- case 8:
3589
+ case 5:
3555
3590
  return _context.a(2, api.getBalanceForeignPolkadotXcm(address, asset.assetId));
3556
3591
  }
3557
3592
  }, _callee);
@@ -3567,23 +3602,18 @@ var getBalanceForeignXTokens = /*#__PURE__*/function () {
3567
3602
  while (1) switch (_context.n) {
3568
3603
  case 0:
3569
3604
  if (!(node === 'Astar' || node === 'Shiden')) {
3570
- _context.n = 2;
3571
- break;
3572
- }
3573
- if (!(!assets.isForeignAsset(asset) || !asset.assetId)) {
3574
3605
  _context.n = 1;
3575
3606
  break;
3576
3607
  }
3577
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
3578
- case 1:
3608
+ assertHasId(asset);
3579
3609
  return _context.a(2, api.getBalanceAssetsPallet(address, BigInt(asset.assetId)));
3580
- case 2:
3610
+ case 1:
3581
3611
  if (!(node === 'BifrostPolkadot' || node === 'BifrostKusama')) {
3582
- _context.n = 3;
3612
+ _context.n = 2;
3583
3613
  break;
3584
3614
  }
3585
3615
  return _context.a(2, api.getBalanceForeignBifrost(address, asset));
3586
- case 3:
3616
+ case 2:
3587
3617
  return _context.a(2, api.getBalanceForeignXTokens(node, address, asset));
3588
3618
  }
3589
3619
  }, _callee);
@@ -3617,31 +3647,26 @@ var getEthErc20Balance = /*#__PURE__*/function () {
3617
3647
  transport: viem.http('https://ethereum.publicnode.com/')
3618
3648
  });
3619
3649
  asset = assets.findAssetForNodeOrThrow('Ethereum', currency, null);
3620
- if (!(!assets.isForeignAsset(asset) || !asset.assetId)) {
3621
- _context.n = 1;
3622
- break;
3623
- }
3624
- throw new InvalidParameterError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset."));
3625
- case 1:
3650
+ assertHasId(asset);
3626
3651
  if (!(asset.symbol === 'ETH')) {
3627
- _context.n = 3;
3652
+ _context.n = 2;
3628
3653
  break;
3629
3654
  }
3630
- _context.n = 2;
3655
+ _context.n = 1;
3631
3656
  return client.getBalance({
3632
3657
  address: address
3633
3658
  });
3634
- case 2:
3659
+ case 1:
3635
3660
  return _context.a(2, _context.v);
3636
- case 3:
3637
- _context.n = 4;
3661
+ case 2:
3662
+ _context.n = 3;
3638
3663
  return client.readContract({
3639
3664
  address: asset.assetId,
3640
3665
  abi: ERC20_ABI,
3641
3666
  functionName: 'balanceOf',
3642
3667
  args: [address]
3643
3668
  });
3644
- case 4:
3669
+ case 3:
3645
3670
  return _context.a(2, _context.v);
3646
3671
  }
3647
3672
  }, _callee);
@@ -3695,7 +3720,7 @@ var getBalanceForeign = /*#__PURE__*/function () {
3695
3720
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
3696
3721
  var api;
3697
3722
  return _regenerator().w(function (_context2) {
3698
- while (1) switch (_context2.n) {
3723
+ while (1) switch (_context2.p = _context2.n) {
3699
3724
  case 0:
3700
3725
  api = options.api;
3701
3726
  _context2.p = 1;
@@ -3774,7 +3799,7 @@ var getBalanceNative = /*#__PURE__*/function () {
3774
3799
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
3775
3800
  var api;
3776
3801
  return _regenerator().w(function (_context2) {
3777
- while (1) switch (_context2.n) {
3802
+ while (1) switch (_context2.p = _context2.n) {
3778
3803
  case 0:
3779
3804
  api = options.api;
3780
3805
  _context2.p = 1;
@@ -3866,7 +3891,7 @@ var getAssetBalance = /*#__PURE__*/function () {
3866
3891
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
3867
3892
  var api;
3868
3893
  return _regenerator().w(function (_context2) {
3869
- while (1) switch (_context2.n) {
3894
+ while (1) switch (_context2.p = _context2.n) {
3870
3895
  case 0:
3871
3896
  api = options.api;
3872
3897
  _context2.p = 1;
@@ -3935,7 +3960,7 @@ var getOriginFeeDetails = /*#__PURE__*/function () {
3935
3960
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
3936
3961
  var api;
3937
3962
  return _regenerator().w(function (_context2) {
3938
- while (1) switch (_context2.n) {
3963
+ while (1) switch (_context2.p = _context2.n) {
3939
3964
  case 0:
3940
3965
  api = options.api;
3941
3966
  api.setDisconnectAllowed(false);
@@ -4105,6 +4130,8 @@ var isSufficientOrigin = /*#__PURE__*/function () {
4105
4130
  return _context.a(2, isSufficientNative && isSufficientAsset);
4106
4131
  case 5:
4107
4132
  return _context.a(2, balanceNative - edNative - feeNative - BigInt(currency.amount) > 0n);
4133
+ case 6:
4134
+ return _context.a(2);
4108
4135
  }
4109
4136
  }, _callee);
4110
4137
  }));
@@ -4166,7 +4193,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
4166
4193
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
4167
4194
  var originAsset, _t;
4168
4195
  return _regenerator().w(function (_context) {
4169
- while (1) switch (_context.n) {
4196
+ while (1) switch (_context.p = _context.n) {
4170
4197
  case 0:
4171
4198
  if (!(destination === 'Ethereum')) {
4172
4199
  _context.n = 1;
@@ -4536,7 +4563,7 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin, message
4536
4563
  ahAddress = _ref.ahAddress,
4537
4564
  version = _ref.version;
4538
4565
  if (!assets.isForeignAsset(asset)) {
4539
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
4566
+ throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " is not a foreign asset"));
4540
4567
  }
4541
4568
  assertHasLocation(asset);
4542
4569
  if (!senderAddress) {
@@ -4547,7 +4574,7 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, origin, message
4547
4574
  }
4548
4575
  var ethAsset = assets.findAssetByMultiLocation(assets.getOtherAssets('Ethereum'), asset.multiLocation);
4549
4576
  if (!ethAsset) {
4550
- throw new assets.InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset)));
4577
+ throw new assets.InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt)));
4551
4578
  }
4552
4579
  var interiorSb = ethAsset.symbol === 'ETH' ? {
4553
4580
  Here: null
@@ -4653,7 +4680,7 @@ var generateMessageId = /*#__PURE__*/function () {
4653
4680
  var getBridgeStatus = /*#__PURE__*/function () {
4654
4681
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api) {
4655
4682
  return _regenerator().w(function (_context) {
4656
- while (1) switch (_context.n) {
4683
+ while (1) switch (_context.p = _context.n) {
4657
4684
  case 0:
4658
4685
  _context.n = 1;
4659
4686
  return api.init('BridgeHubPolkadot');
@@ -4829,7 +4856,7 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
4829
4856
  senderAddress: senderAddress,
4830
4857
  ahAddress: ahAddress,
4831
4858
  asset: _objectSpread2(_objectSpread2({}, foundAsset), {}, {
4832
- amount: currency.amount
4859
+ amount: BigInt(currency.amount)
4833
4860
  }),
4834
4861
  version: sdkCommon.Version.V4
4835
4862
  }, from, messageId);
@@ -4888,7 +4915,7 @@ function _traverseXcmHops() {
4888
4915
  _traverseXcmHops = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(config) {
4889
4916
  var api, origin, destination, currency, initialForwardedXcms, initialDestParaId, swapConfig, processHop, shouldContinue, extractNextHopData, assetHubNode, bridgeHubNode, currentOrigin, forwardedXcms, nextParaId, asset, currentAsset, hasPassedExchange, hops, intermediateResults, destinationResult, nextChain, hopApi, isDestination, isAssetHub, isBridgeHub, hopResult, _extractNextHopData, newXcms, destParaId;
4890
4917
  return _regenerator().w(function (_context2) {
4891
- while (1) switch (_context2.n) {
4918
+ while (1) switch (_context2.p = _context2.n) {
4892
4919
  case 0:
4893
4920
  api = config.api, origin = config.origin, destination = config.destination, currency = config.currency, initialForwardedXcms = config.initialForwardedXcms, initialDestParaId = config.initialDestParaId, swapConfig = config.swapConfig, processHop = config.processHop, shouldContinue = config.shouldContinue, extractNextHopData = config.extractNextHopData;
4894
4921
  assetHubNode = "AssetHub".concat(getRelayChainOf(origin));
@@ -5226,7 +5253,7 @@ var dryRun = /*#__PURE__*/function () {
5226
5253
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
5227
5254
  var api, senderAddress, origin;
5228
5255
  return _regenerator().w(function (_context) {
5229
- while (1) switch (_context.n) {
5256
+ while (1) switch (_context.p = _context.n) {
5230
5257
  case 0:
5231
5258
  api = options.api, senderAddress = options.senderAddress, origin = options.origin;
5232
5259
  validateAddress(senderAddress, origin, false);
@@ -5258,7 +5285,7 @@ var dryRunOrigin = /*#__PURE__*/function () {
5258
5285
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
5259
5286
  var api, node, address, result;
5260
5287
  return _regenerator().w(function (_context) {
5261
- while (1) switch (_context.n) {
5288
+ while (1) switch (_context.p = _context.n) {
5262
5289
  case 0:
5263
5290
  api = options.api, node = options.node, address = options.address;
5264
5291
  validateAddress(address, node, false);
@@ -5435,6 +5462,9 @@ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge,
5435
5462
  return currency.multiasset.map(function (multiAsset) {
5436
5463
  var ml = assets.extractMultiAssetLoc(multiAsset);
5437
5464
  return _objectSpread2(_objectSpread2({}, multiAsset), {}, {
5465
+ fun: {
5466
+ Fungible: BigInt(multiAsset.fun.Fungible)
5467
+ },
5438
5468
  isFeeAsset: sdkCommon.deepEqual(ml, feeAsset.multilocation)
5439
5469
  });
5440
5470
  });
@@ -5456,7 +5486,7 @@ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge,
5456
5486
  var originNode = getNode(originTyped);
5457
5487
  return _objectSpread2({
5458
5488
  isFeeAsset: assets.isAssetEqual(resolvedFeeAsset, asset)
5459
- }, createMultiAsset(originNode.version, currency.amount, asset.multiLocation));
5489
+ }, createMultiAsset(originNode.version, BigInt(currency.amount), asset.multiLocation));
5460
5490
  });
5461
5491
  if (assets$1.filter(function (asset) {
5462
5492
  return asset.isFeeAsset;
@@ -5474,14 +5504,9 @@ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge,
5474
5504
  };
5475
5505
 
5476
5506
  var selectXcmVersion = function selectXcmVersion(forcedVersion, originVersion, destMaxVersion) {
5477
- if (forcedVersion) {
5478
- return forcedVersion;
5479
- }
5507
+ if (forcedVersion) return forcedVersion;
5480
5508
  var destVersion = destMaxVersion !== null && destMaxVersion !== void 0 ? destMaxVersion : originVersion;
5481
- if (originVersion === sdkCommon.Version.V4 && destVersion === sdkCommon.Version.V3) {
5482
- return sdkCommon.Version.V3;
5483
- }
5484
- return originVersion;
5509
+ return destVersion < originVersion ? destVersion : originVersion;
5485
5510
  };
5486
5511
 
5487
5512
  var shouldPerformAssetCheck = function shouldPerformAssetCheck(origin, currency) {
@@ -5614,7 +5639,7 @@ var getXcmFee = /*#__PURE__*/function () {
5614
5639
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
5615
5640
  var api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, swapConfig, asset, _yield$getOriginXcmFe, originFee, originCurrency, originFeeType, originDryRunError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, processHop, traversalResult, destFee, destCurrency, destFeeType, destDryRunError, destSufficient, destResult, _destApi, destFallback, assetHubNode, processedBridgeHub, bridgeHubNode, bridgeHubHopIndex, convertToFeeDetail, result, _getFailureInfo2, failureChain, failureReason;
5616
5641
  return _regenerator().w(function (_context2) {
5617
- while (1) switch (_context2.n) {
5642
+ while (1) switch (_context2.p = _context2.n) {
5618
5643
  case 0:
5619
5644
  api = _ref.api, tx = _ref.tx, origin = _ref.origin, destination = _ref.destination, senderAddress = _ref.senderAddress, address = _ref.address, currency = _ref.currency, feeAsset = _ref.feeAsset, disableFallback = _ref.disableFallback, swapConfig = _ref.swapConfig;
5620
5645
  asset = assets.findAssetForNodeOrThrow(origin, currency, destination);
@@ -6020,7 +6045,7 @@ var transferRelayToPara = /*#__PURE__*/function () {
6020
6045
  case 0:
6021
6046
  api = options.api, origin = options.origin, destination = options.destination, asset = options.asset, address = options.address, paraIdTo = options.paraIdTo, version = options.version, pallet = options.pallet, method = options.method;
6022
6047
  isMultiLocationDestination = _typeof(destination) === 'object';
6023
- if (!(api.getApiOrUrl() === undefined && isMultiLocationDestination)) {
6048
+ if (!(api.getConfig() === undefined && isMultiLocationDestination)) {
6024
6049
  _context.n = 1;
6025
6050
  break;
6026
6051
  }
@@ -6116,7 +6141,7 @@ var send = /*#__PURE__*/function () {
6116
6141
  destination: destination,
6117
6142
  address: address,
6118
6143
  asset: _objectSpread2(_objectSpread2({}, asset), {}, {
6119
- amount: 'multiasset' in currency ? 0 : currency.amount
6144
+ amount: 'multiasset' in currency ? 0n : BigInt(currency.amount)
6120
6145
  }),
6121
6146
  paraIdTo: paraIdTo,
6122
6147
  version: resolvedVersion,
@@ -6133,11 +6158,11 @@ var send = /*#__PURE__*/function () {
6133
6158
  symbol: 'symbol' in currency ? currency.symbol : undefined
6134
6159
  };
6135
6160
  finalAsset = 'multiasset' in currency ? _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
6136
- amount: 0,
6161
+ amount: 0n,
6137
6162
  assetId: '1'
6138
6163
  }) : // Ensure amount is at least 2 to avoid Rust panic
6139
6164
  _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
6140
- amount: BigInt(currency.amount) < 2n ? 2n : currency.amount
6165
+ amount: BigInt(currency.amount) < 2n ? 2n : BigInt(currency.amount)
6141
6166
  });
6142
6167
  finalVersion = selectXcmVersion(version, originVersion, destVersion);
6143
6168
  normalizedAsset = finalAsset.multiLocation ? _objectSpread2(_objectSpread2({}, finalAsset), {}, {
@@ -6284,7 +6309,7 @@ var getTransferableAmount = /*#__PURE__*/function () {
6284
6309
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
6285
6310
  var api;
6286
6311
  return _regenerator().w(function (_context2) {
6287
- while (1) switch (_context2.n) {
6312
+ while (1) switch (_context2.p = _context2.n) {
6288
6313
  case 0:
6289
6314
  api = options.api;
6290
6315
  api.setDisconnectAllowed(false);
@@ -6428,7 +6453,7 @@ var buildHopInfo = /*#__PURE__*/function () {
6428
6453
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
6429
6454
  var api, node, feeData, originNode, currency, senderAddress, ahAddress, hopApi, resolvedAddress, nativeBalanceOnHop, nativeAssetSymbolOnHop, xcmFeeDetails, isBridgeHubNode, hopAsset, hopCurrencyPayload, balance, ed;
6430
6455
  return _regenerator().w(function (_context) {
6431
- while (1) switch (_context.n) {
6456
+ while (1) switch (_context.p = _context.n) {
6432
6457
  case 0:
6433
6458
  api = _ref.api, node = _ref.node, feeData = _ref.feeData, originNode = _ref.originNode, currency = _ref.currency, senderAddress = _ref.senderAddress, ahAddress = _ref.ahAddress;
6434
6459
  hopApi = api.clone();
@@ -6511,7 +6536,7 @@ var getTransferInfo = /*#__PURE__*/function () {
6511
6536
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
6512
6537
  var api, tx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset, resolvedFeeAsset, originAsset, originBalanceFee, originBalance, edOrigin, _yield$getXcmFee, _yield$getXcmFee$orig, originFee, originFeeCurrency, assetHubFeeResult, bridgeHubFeeResult, destFeeDetail, hops, isFeeAssetAh, originBalanceAfter, originBalanceFeeAfter, originBalanceNativeSufficient, originBalanceSufficient, assetHub, bridgeHub, bridgeHubNode, builtHops, destinationInfo, _t;
6513
6538
  return _regenerator().w(function (_context2) {
6514
- while (1) switch (_context2.n) {
6539
+ while (1) switch (_context2.p = _context2.n) {
6515
6540
  case 0:
6516
6541
  api = _ref.api, tx = _ref.tx, origin = _ref.origin, destination = _ref.destination, senderAddress = _ref.senderAddress, ahAddress = _ref.ahAddress, address = _ref.address, currency = _ref.currency, feeAsset = _ref.feeAsset;
6517
6542
  if (!(assets.isNodeEvm(origin) && !ahAddress)) {
@@ -6850,7 +6875,7 @@ var verifyEdOnDestination = /*#__PURE__*/function () {
6850
6875
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
6851
6876
  var api;
6852
6877
  return _regenerator().w(function (_context) {
6853
- while (1) switch (_context.n) {
6878
+ while (1) switch (_context.p = _context.n) {
6854
6879
  case 0:
6855
6880
  api = options.api;
6856
6881
  _context.p = 1;
@@ -6932,7 +6957,7 @@ var handleExecuteTransfer = /*#__PURE__*/function () {
6932
6957
  case 4:
6933
6958
  feeAssetBalance = _t;
6934
6959
  checkAmount = function checkAmount(fee) {
6935
- if (BigInt(asset.amount) <= fee) {
6960
+ if (asset.amount <= fee) {
6936
6961
  throw new InvalidParameterError("Asset amount is too low, please increase the amount or use a different fee asset.");
6937
6962
  }
6938
6963
  };
@@ -7018,7 +7043,7 @@ var createExchangeInstructions = /*#__PURE__*/function () {
7018
7043
  nativeSymbol = assets.getNativeAssetSymbol(exchangeChain);
7019
7044
  needsMultiHop = isMultiHopSwap(exchangeChain, assetFrom, assetTo);
7020
7045
  nativeAsset = assets.findAssetForNodeOrThrow(exchangeChain, {
7021
- symbol: nativeSymbol
7046
+ symbol: assets.Native(nativeSymbol)
7022
7047
  }, null);
7023
7048
  assertHasLocation(nativeAsset);
7024
7049
  shouldUseMaximal = !chain || exchangeChain === 'Hydration' && exchangeFee === 0n;
@@ -7379,7 +7404,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
7379
7404
  case 7:
7380
7405
  recalculatedMinAmountOut = _context3.v;
7381
7406
  updatedAssetTo = _objectSpread2(_objectSpread2({}, assetTo), {}, {
7382
- amount: recalculatedMinAmountOut.toString()
7407
+ amount: recalculatedMinAmountOut
7383
7408
  });
7384
7409
  case 8:
7385
7410
  _context3.n = 9;
@@ -7418,7 +7443,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
7418
7443
  case 11:
7419
7444
  finalMinAmountOut = _context3.v;
7420
7445
  finalAssetTo = _objectSpread2(_objectSpread2({}, assetTo), {}, {
7421
- amount: finalMinAmountOut.toString()
7446
+ amount: finalMinAmountOut
7422
7447
  });
7423
7448
  _context3.n = 12;
7424
7449
  return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
@@ -7486,7 +7511,7 @@ var handleToAhTeleport = /*#__PURE__*/function () {
7486
7511
  // If the default tx dry run failed, we need to create execute transaction
7487
7512
  dummyTx = createExecuteExchangeXcm(input, origin, MAX_WEIGHT,
7488
7513
  // Enter dummy fee values just to get the dry run to pass
7489
- BigInt(asset.amount), BigInt(asset.amount) / 2n);
7514
+ asset.amount, asset.amount / 2n);
7490
7515
  _context.n = 6;
7491
7516
  return getXcmFee({
7492
7517
  api: api,
@@ -7896,7 +7921,7 @@ var ParachainNode = /*#__PURE__*/function () {
7896
7921
  dest: assets.isNodeEvm(this.node) ? address : {
7897
7922
  Id: address
7898
7923
  },
7899
- value: BigInt(asset.amount)
7924
+ value: asset.amount
7900
7925
  }
7901
7926
  });
7902
7927
  }
@@ -7906,12 +7931,7 @@ var ParachainNode = /*#__PURE__*/function () {
7906
7931
  var api = options.api,
7907
7932
  asset = options.asset,
7908
7933
  address = options.address;
7909
- if (!assets.isForeignAsset(asset)) {
7910
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
7911
- }
7912
- if (asset.assetId === undefined) {
7913
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
7914
- }
7934
+ assertHasId(asset);
7915
7935
  return api.callTxMethod({
7916
7936
  module: 'Tokens',
7917
7937
  method: 'transfer',
@@ -7920,7 +7940,7 @@ var ParachainNode = /*#__PURE__*/function () {
7920
7940
  Id: address
7921
7941
  },
7922
7942
  currency_id: BigInt(asset.assetId),
7923
- amount: BigInt(asset.amount)
7943
+ amount: asset.amount
7924
7944
  }
7925
7945
  });
7926
7946
  }
@@ -7953,7 +7973,7 @@ var ParachainNode = /*#__PURE__*/function () {
7953
7973
  AH_EXECUTION_FEE_PADDED = ASSET_HUB_EXECUTION_FEE * 125n / 100n; // Perform a dry run AH -> dest to calculate the BuyExecution amount
7954
7974
  _context2.n = 3;
7955
7975
  return Builder(api.clone()).from('AssetHubPolkadot').to(destination).currency({
7956
- symbol: 'DOT',
7976
+ symbol: assets.Native('DOT'),
7957
7977
  amount: AH_EXECUTION_FEE_PADDED
7958
7978
  }).address(address).senderAddress(senderAddress).dryRun();
7959
7979
  case 3:
@@ -8098,14 +8118,14 @@ var ParachainNode = /*#__PURE__*/function () {
8098
8118
  _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
8099
8119
  bridgeFee = _yield$getParaEthTran2[0];
8100
8120
  executionFee = _yield$getParaEthTran2[1];
8101
- PARA_TO_PARA_FEE_DOT = 500000000; // 0.5 DOT
8102
- fee = useOnlyDepositInstruction ? PARA_TO_PARA_FEE_DOT : (bridgeFee + executionFee).toString();
8121
+ PARA_TO_PARA_FEE_DOT = 500000000n; // 0.5 DOT
8122
+ fee = useOnlyDepositInstruction ? PARA_TO_PARA_FEE_DOT : bridgeFee + executionFee;
8103
8123
  ethAsset = assets.findAssetByMultiLocation(assets.getOtherAssets('Ethereum'), asset.multiLocation);
8104
8124
  if (ethAsset) {
8105
8125
  _context3.n = 7;
8106
8126
  break;
8107
8127
  }
8108
- throw new assets.InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset)));
8128
+ throw new assets.InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt)));
8109
8129
  case 7:
8110
8130
  if (!useOnlyDepositInstruction) {
8111
8131
  _context3.n = 8;
@@ -8125,21 +8145,16 @@ var ParachainNode = /*#__PURE__*/function () {
8125
8145
  })
8126
8146
  }
8127
8147
  }], version);
8128
- _context3.n = 11;
8148
+ _context3.n = 10;
8129
8149
  break;
8130
8150
  case 8:
8131
- if (ethAsset.assetId) {
8132
- _context3.n = 9;
8133
- break;
8134
- }
8135
- throw new assets.InvalidCurrencyError("Ethereum asset ".concat(JSON.stringify(ethAsset), " has no assetId"));
8136
- case 9:
8137
- _context3.n = 10;
8151
+ assertHasId(ethAsset);
8152
+ _context3.n = 9;
8138
8153
  return generateMessageId(api, senderAddress, getParaId(this.node), ethAsset.assetId, address, asset.amount);
8139
- case 10:
8154
+ case 9:
8140
8155
  messageId = _context3.v;
8141
8156
  customXcmOnDest = createCustomXcmOnDest(input, this.node, messageId);
8142
- case 11:
8157
+ case 10:
8143
8158
  call = {
8144
8159
  module: 'PolkadotXcm',
8145
8160
  method: 'transfer_assets_using_type_and_then',
@@ -8201,7 +8216,7 @@ var Acala = /*#__PURE__*/function (_ParachainNode) {
8201
8216
  dest: {
8202
8217
  Id: address
8203
8218
  },
8204
- amount: BigInt(asset.amount)
8219
+ amount: asset.amount
8205
8220
  }
8206
8221
  });
8207
8222
  }
@@ -8222,7 +8237,7 @@ var Acala = /*#__PURE__*/function (_ParachainNode) {
8222
8237
  Id: address
8223
8238
  },
8224
8239
  currency_id: this.getCurrencySelection(asset),
8225
- amount: BigInt(asset.amount)
8240
+ amount: asset.amount
8226
8241
  }
8227
8242
  });
8228
8243
  }
@@ -8305,12 +8320,7 @@ var Ajuna = /*#__PURE__*/function (_ParachainNode) {
8305
8320
  var api = options.api,
8306
8321
  asset = options.asset,
8307
8322
  address = options.address;
8308
- if (!assets.isForeignAsset(asset)) {
8309
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
8310
- }
8311
- if (asset.assetId === undefined) {
8312
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
8313
- }
8323
+ assertHasId(asset);
8314
8324
  return api.callTxMethod({
8315
8325
  module: 'Assets',
8316
8326
  method: 'transfer',
@@ -8319,7 +8329,7 @@ var Ajuna = /*#__PURE__*/function (_ParachainNode) {
8319
8329
  target: {
8320
8330
  Id: address
8321
8331
  },
8322
- amount: BigInt(asset.amount)
8332
+ amount: asset.amount
8323
8333
  }
8324
8334
  });
8325
8335
  }
@@ -8345,9 +8355,7 @@ var Altair = /*#__PURE__*/function (_ParachainNode) {
8345
8355
  key: "getCurrencySelection",
8346
8356
  value: function getCurrencySelection(asset) {
8347
8357
  if (asset.symbol === this.getNativeAssetSymbol()) return 'Native';
8348
- if (!assets.isForeignAsset(asset)) {
8349
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
8350
- }
8358
+ assertHasId(asset);
8351
8359
  return {
8352
8360
  ForeignAsset: Number(asset.assetId)
8353
8361
  };
@@ -8365,12 +8373,7 @@ var Altair = /*#__PURE__*/function (_ParachainNode) {
8365
8373
  var api = options.api,
8366
8374
  asset = options.asset,
8367
8375
  address = options.address;
8368
- if (!assets.isForeignAsset(asset)) {
8369
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
8370
- }
8371
- if (asset.assetId === undefined) {
8372
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
8373
- }
8376
+ assertHasId(asset);
8374
8377
  return api.callTxMethod({
8375
8378
  module: 'Tokens',
8376
8379
  method: 'transfer',
@@ -8379,7 +8382,7 @@ var Altair = /*#__PURE__*/function (_ParachainNode) {
8379
8382
  Id: address
8380
8383
  },
8381
8384
  currency_id: this.getCurrencySelection(asset),
8382
- amount: BigInt(asset.amount)
8385
+ amount: asset.amount
8383
8386
  }
8384
8387
  });
8385
8388
  }
@@ -8396,9 +8399,7 @@ var Amplitude = /*#__PURE__*/function (_ParachainNode) {
8396
8399
  key: "transferXTokens",
8397
8400
  value: function transferXTokens$1(input) {
8398
8401
  var asset = input.asset;
8399
- if (!assets.isForeignAsset(asset)) {
8400
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
8401
- }
8402
+ assertHasId(asset);
8402
8403
  var currencySelection = {
8403
8404
  XCM: Number(asset.assetId)
8404
8405
  };
@@ -8410,7 +8411,7 @@ var Amplitude = /*#__PURE__*/function (_ParachainNode) {
8410
8411
  var AssetHubKusama = /*#__PURE__*/function (_ParachainNode) {
8411
8412
  function AssetHubKusama() {
8412
8413
  _classCallCheck(this, AssetHubKusama);
8413
- return _callSuper(this, AssetHubKusama, ['AssetHubKusama', 'KusamaAssetHub', 'kusama', sdkCommon.Version.V4]);
8414
+ return _callSuper(this, AssetHubKusama, ['AssetHubKusama', 'KusamaAssetHub', 'kusama', sdkCommon.Version.V5]);
8414
8415
  }
8415
8416
  _inherits(AssetHubKusama, _ParachainNode);
8416
8417
  return _createClass(AssetHubKusama, [{
@@ -8477,7 +8478,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
8477
8478
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'AssetHubPolkadot';
8478
8479
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'PolkadotAssetHub';
8479
8480
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
8480
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
8481
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
8481
8482
  _classCallCheck(this, AssetHubPolkadot);
8482
8483
  _this = _callSuper(this, AssetHubPolkadot, [chain, info, type, version]);
8483
8484
  _this.handleLocalReserveTransfer = function (input) {
@@ -8487,9 +8488,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
8487
8488
  destination = input.destination,
8488
8489
  asset = input.asset,
8489
8490
  paraIdTo = input.paraIdTo;
8490
- if (!assets.isForeignAsset(asset)) {
8491
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
8492
- }
8491
+ assertIsForeign(asset);
8493
8492
  assertHasLocation(asset);
8494
8493
  var PARA_TO_PARA_FEE_DOT = 500000000n; // 0.5 DOT
8495
8494
  var call = {
@@ -8571,16 +8570,11 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
8571
8570
  }
8572
8571
  throw new InvalidParameterError('Multi-location address is not supported for Ethereum transfers');
8573
8572
  case 4:
8574
- if (assets.isForeignAsset(asset)) {
8575
- _context.n = 5;
8576
- break;
8577
- }
8578
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
8579
- case 5:
8573
+ assertIsForeign(asset);
8580
8574
  assertHasLocation(asset);
8581
- _context.n = 6;
8575
+ _context.n = 5;
8582
8576
  return generateMessageId(api, senderAddress, getParaId(this.node), JSON.stringify(asset.multiLocation), address, asset.amount);
8583
- case 6:
8577
+ case 5:
8584
8578
  messageId = _context.v;
8585
8579
  multiLocation = asset.symbol === this.getNativeAssetSymbol() ? DOT_MULTILOCATION : asset.multiLocation;
8586
8580
  call = {
@@ -8639,19 +8633,14 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
8639
8633
  }
8640
8634
  throw new BridgeHaltedError();
8641
8635
  case 2:
8642
- if (assets.isForeignAsset(asset)) {
8643
- _context2.n = 3;
8644
- break;
8645
- }
8646
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
8647
- case 3:
8636
+ assertIsForeign(asset);
8648
8637
  assertHasLocation(asset);
8649
8638
  if (!(asset.symbol === this.getNativeAssetSymbol() || asset.symbol === assets.getNativeAssetSymbol('Kusama'))) {
8650
- _context2.n = 4;
8639
+ _context2.n = 3;
8651
8640
  break;
8652
8641
  }
8653
8642
  return _context2.a(2, this.handleEthBridgeNativeTransfer(input));
8654
- case 4:
8643
+ case 3:
8655
8644
  modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
8656
8645
  destLocation: createDestination(this.version, this.node, destination, paraIdTo, ETHEREUM_JUNCTION, sdkCommon.Parents.TWO),
8657
8646
  beneficiaryLocation: createBeneficiaryLocation({
@@ -8848,9 +8837,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
8848
8837
  var api = options.api,
8849
8838
  asset = options.asset,
8850
8839
  address = options.address;
8851
- if (!assets.isForeignAsset(asset)) {
8852
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
8853
- }
8840
+ assertIsForeign(asset);
8854
8841
  if (asset.assetId !== undefined) {
8855
8842
  return api.callTxMethod({
8856
8843
  module: 'Assets',
@@ -8860,7 +8847,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
8860
8847
  target: {
8861
8848
  Id: address
8862
8849
  },
8863
- amount: BigInt(asset.amount)
8850
+ amount: asset.amount
8864
8851
  }
8865
8852
  });
8866
8853
  }
@@ -8872,7 +8859,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
8872
8859
  target: {
8873
8860
  Id: address
8874
8861
  },
8875
- amount: BigInt(asset.amount)
8862
+ amount: asset.amount
8876
8863
  }
8877
8864
  });
8878
8865
  }
@@ -8882,7 +8869,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
8882
8869
  var AssetHubPaseo = /*#__PURE__*/function (_AssetHubPolkadot) {
8883
8870
  function AssetHubPaseo() {
8884
8871
  _classCallCheck(this, AssetHubPaseo);
8885
- return _callSuper(this, AssetHubPaseo, ['AssetHubPaseo', 'PaseoAssetHub', 'paseo', sdkCommon.Version.V4]);
8872
+ return _callSuper(this, AssetHubPaseo, ['AssetHubPaseo', 'PaseoAssetHub', 'paseo', sdkCommon.Version.V5]);
8886
8873
  }
8887
8874
  _inherits(AssetHubPaseo, _AssetHubPolkadot);
8888
8875
  return _createClass(AssetHubPaseo);
@@ -8891,7 +8878,7 @@ var AssetHubPaseo = /*#__PURE__*/function (_AssetHubPolkadot) {
8891
8878
  var AssetHubWestend = /*#__PURE__*/function (_AssetHubPolkadot) {
8892
8879
  function AssetHubWestend() {
8893
8880
  _classCallCheck(this, AssetHubWestend);
8894
- return _callSuper(this, AssetHubWestend, ['AssetHubWestend', 'WestendAssetHub', 'westend', sdkCommon.Version.V4]);
8881
+ return _callSuper(this, AssetHubWestend, ['AssetHubWestend', 'WestendAssetHub', 'westend', sdkCommon.Version.V5]);
8895
8882
  }
8896
8883
  _inherits(AssetHubWestend, _AssetHubPolkadot);
8897
8884
  return _createClass(AssetHubWestend);
@@ -8900,7 +8887,7 @@ var AssetHubWestend = /*#__PURE__*/function (_AssetHubPolkadot) {
8900
8887
  var Astar = /*#__PURE__*/function (_ParachainNode) {
8901
8888
  function Astar() {
8902
8889
  _classCallCheck(this, Astar);
8903
- return _callSuper(this, Astar, ['Astar', 'astar', 'polkadot', sdkCommon.Version.V4]);
8890
+ return _callSuper(this, Astar, ['Astar', 'astar', 'polkadot', sdkCommon.Version.V5]);
8904
8891
  }
8905
8892
  _inherits(Astar, _ParachainNode);
8906
8893
  return _createClass(Astar, [{
@@ -8929,12 +8916,7 @@ var Astar = /*#__PURE__*/function (_ParachainNode) {
8929
8916
  var api = options.api,
8930
8917
  asset = options.asset,
8931
8918
  address = options.address;
8932
- if (!assets.isForeignAsset(asset)) {
8933
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
8934
- }
8935
- if (asset.assetId === undefined) {
8936
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
8937
- }
8919
+ assertHasId(asset);
8938
8920
  return api.callTxMethod({
8939
8921
  module: 'Assets',
8940
8922
  method: 'transfer',
@@ -8943,7 +8925,7 @@ var Astar = /*#__PURE__*/function (_ParachainNode) {
8943
8925
  target: {
8944
8926
  Id: address
8945
8927
  },
8946
- amount: BigInt(asset.amount)
8928
+ amount: asset.amount
8947
8929
  }
8948
8930
  });
8949
8931
  }
@@ -8960,9 +8942,7 @@ var Basilisk = /*#__PURE__*/function (_ParachainNode) {
8960
8942
  key: "transferXTokens",
8961
8943
  value: function transferXTokens$1(input) {
8962
8944
  var asset = input.asset;
8963
- if (!assets.isForeignAsset(asset)) {
8964
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
8965
- }
8945
+ assertHasId(asset);
8966
8946
  return transferXTokens(input, Number(asset.assetId));
8967
8947
  }
8968
8948
  }, {
@@ -8981,7 +8961,7 @@ var Basilisk = /*#__PURE__*/function (_ParachainNode) {
8981
8961
  var BifrostKusama = /*#__PURE__*/function (_ParachainNode) {
8982
8962
  function BifrostKusama() {
8983
8963
  _classCallCheck(this, BifrostKusama);
8984
- return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'kusama', sdkCommon.Version.V4]);
8964
+ return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'kusama', sdkCommon.Version.V5]);
8985
8965
  }
8986
8966
  _inherits(BifrostKusama, _ParachainNode);
8987
8967
  return _createClass(BifrostKusama, [{
@@ -9002,7 +8982,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_ParachainNode) {
9002
8982
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'BifrostPolkadot';
9003
8983
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'bifrost';
9004
8984
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
9005
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
8985
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
9006
8986
  _classCallCheck(this, BifrostPolkadot);
9007
8987
  return _callSuper(this, BifrostPolkadot, [chain, info, type, version]);
9008
8988
  }
@@ -9096,7 +9076,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_ParachainNode) {
9096
9076
  Id: address
9097
9077
  },
9098
9078
  currency_id: this.getCurrencySelection(asset),
9099
- amount: BigInt(asset.amount)
9079
+ amount: asset.amount
9100
9080
  }
9101
9081
  });
9102
9082
  }
@@ -9106,7 +9086,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_ParachainNode) {
9106
9086
  var BifrostPaseo = /*#__PURE__*/function (_BifrostPolkadot) {
9107
9087
  function BifrostPaseo() {
9108
9088
  _classCallCheck(this, BifrostPaseo);
9109
- return _callSuper(this, BifrostPaseo, ['BifrostPaseo', 'Bifrost(Paseo)', 'paseo', sdkCommon.Version.V4]);
9089
+ return _callSuper(this, BifrostPaseo, ['BifrostPaseo', 'Bifrost(Paseo)', 'paseo', sdkCommon.Version.V5]);
9110
9090
  }
9111
9091
  _inherits(BifrostPaseo, _BifrostPolkadot);
9112
9092
  return _createClass(BifrostPaseo);
@@ -9115,7 +9095,7 @@ var BifrostPaseo = /*#__PURE__*/function (_BifrostPolkadot) {
9115
9095
  var BridgeHubKusama = /*#__PURE__*/function (_ParachainNode) {
9116
9096
  function BridgeHubKusama() {
9117
9097
  _classCallCheck(this, BridgeHubKusama);
9118
- return _callSuper(this, BridgeHubKusama, ['BridgeHubKusama', 'kusamaBridgeHub', 'kusama', sdkCommon.Version.V4]);
9098
+ return _callSuper(this, BridgeHubKusama, ['BridgeHubKusama', 'kusamaBridgeHub', 'kusama', sdkCommon.Version.V5]);
9119
9099
  }
9120
9100
  _inherits(BridgeHubKusama, _ParachainNode);
9121
9101
  return _createClass(BridgeHubKusama, [{
@@ -9144,7 +9124,7 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
9144
9124
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'BridgeHubPolkadot';
9145
9125
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'polkadotBridgeHub';
9146
9126
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
9147
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
9127
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
9148
9128
  _classCallCheck(this, BridgeHubPolkadot);
9149
9129
  return _callSuper(this, BridgeHubPolkadot, [chain, info, type, version]);
9150
9130
  }
@@ -9173,7 +9153,7 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
9173
9153
  var BridgeHubPaseo = /*#__PURE__*/function (_BridgeHubPolkadot) {
9174
9154
  function BridgeHubPaseo() {
9175
9155
  _classCallCheck(this, BridgeHubPaseo);
9176
- return _callSuper(this, BridgeHubPaseo, ['BridgeHubPaseo', 'PaseoBridgeHub', 'paseo', sdkCommon.Version.V4]);
9156
+ return _callSuper(this, BridgeHubPaseo, ['BridgeHubPaseo', 'PaseoBridgeHub', 'paseo', sdkCommon.Version.V5]);
9177
9157
  }
9178
9158
  _inherits(BridgeHubPaseo, _BridgeHubPolkadot);
9179
9159
  return _createClass(BridgeHubPaseo);
@@ -9182,7 +9162,7 @@ var BridgeHubPaseo = /*#__PURE__*/function (_BridgeHubPolkadot) {
9182
9162
  var BridgeHubWestend = /*#__PURE__*/function (_BridgeHubPolkadot) {
9183
9163
  function BridgeHubWestend() {
9184
9164
  _classCallCheck(this, BridgeHubWestend);
9185
- return _callSuper(this, BridgeHubWestend, ['BridgeHubWestend', 'westendBridgeHub', 'westend', sdkCommon.Version.V4]);
9165
+ return _callSuper(this, BridgeHubWestend, ['BridgeHubWestend', 'westendBridgeHub', 'westend', sdkCommon.Version.V5]);
9186
9166
  }
9187
9167
  _inherits(BridgeHubWestend, _BridgeHubPolkadot);
9188
9168
  return _createClass(BridgeHubWestend);
@@ -9198,9 +9178,7 @@ var Centrifuge = /*#__PURE__*/function (_ParachainNode) {
9198
9178
  key: "getCurrencySelection",
9199
9179
  value: function getCurrencySelection(asset) {
9200
9180
  if (asset.symbol === this.getNativeAssetSymbol()) return 'Native';
9201
- if (!assets.isForeignAsset(asset)) {
9202
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9203
- }
9181
+ assertHasId(asset);
9204
9182
  return {
9205
9183
  ForeignAsset: Number(asset.assetId)
9206
9184
  };
@@ -9218,12 +9196,7 @@ var Centrifuge = /*#__PURE__*/function (_ParachainNode) {
9218
9196
  var api = options.api,
9219
9197
  asset = options.asset,
9220
9198
  address = options.address;
9221
- if (!assets.isForeignAsset(asset)) {
9222
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
9223
- }
9224
- if (asset.assetId === undefined) {
9225
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9226
- }
9199
+ assertHasId(asset);
9227
9200
  return api.callTxMethod({
9228
9201
  module: 'Tokens',
9229
9202
  method: 'transfer',
@@ -9232,7 +9205,7 @@ var Centrifuge = /*#__PURE__*/function (_ParachainNode) {
9232
9205
  Id: address
9233
9206
  },
9234
9207
  currency_id: this.getCurrencySelection(asset),
9235
- amount: BigInt(asset.amount)
9208
+ amount: asset.amount
9236
9209
  }
9237
9210
  });
9238
9211
  }
@@ -9244,7 +9217,7 @@ var Collectives = /*#__PURE__*/function (_ParachainNode) {
9244
9217
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Collectives';
9245
9218
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'polkadotCollectives';
9246
9219
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
9247
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
9220
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
9248
9221
  _classCallCheck(this, Collectives);
9249
9222
  return _callSuper(this, Collectives, [chain, info, type, version]);
9250
9223
  }
@@ -9272,7 +9245,7 @@ var Collectives = /*#__PURE__*/function (_ParachainNode) {
9272
9245
  var CollectivesWestend = /*#__PURE__*/function (_Collectives) {
9273
9246
  function CollectivesWestend() {
9274
9247
  _classCallCheck(this, CollectivesWestend);
9275
- return _callSuper(this, CollectivesWestend, ['CollectivesWestend', 'westendCollectives', 'westend', sdkCommon.Version.V4]);
9248
+ return _callSuper(this, CollectivesWestend, ['CollectivesWestend', 'westendCollectives', 'westend', sdkCommon.Version.V5]);
9276
9249
  }
9277
9250
  _inherits(CollectivesWestend, _Collectives);
9278
9251
  return _createClass(CollectivesWestend);
@@ -9288,9 +9261,7 @@ var ComposableFinance = /*#__PURE__*/function (_ParachainNode) {
9288
9261
  key: "transferXTokens",
9289
9262
  value: function transferXTokens$1(input) {
9290
9263
  var asset = input.asset;
9291
- if (!assets.isForeignAsset(asset) || !asset.assetId) {
9292
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9293
- }
9264
+ assertHasId(asset);
9294
9265
  return transferXTokens(input, BigInt(asset.assetId));
9295
9266
  }
9296
9267
  }]);
@@ -9299,7 +9270,7 @@ var ComposableFinance = /*#__PURE__*/function (_ParachainNode) {
9299
9270
  var CoretimeKusama = /*#__PURE__*/function (_ParachainNode) {
9300
9271
  function CoretimeKusama() {
9301
9272
  _classCallCheck(this, CoretimeKusama);
9302
- return _callSuper(this, CoretimeKusama, ['CoretimeKusama', 'kusamaCoretime', 'kusama', sdkCommon.Version.V4]);
9273
+ return _callSuper(this, CoretimeKusama, ['CoretimeKusama', 'kusamaCoretime', 'kusama', sdkCommon.Version.V5]);
9303
9274
  }
9304
9275
  _inherits(CoretimeKusama, _ParachainNode);
9305
9276
  return _createClass(CoretimeKusama, [{
@@ -9326,7 +9297,7 @@ var CoretimePolkadot = /*#__PURE__*/function (_ParachainNode) {
9326
9297
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'CoretimePolkadot';
9327
9298
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'polkadotCoretime';
9328
9299
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
9329
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
9300
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
9330
9301
  _classCallCheck(this, CoretimePolkadot);
9331
9302
  return _callSuper(this, CoretimePolkadot, [chain, info, type, version]);
9332
9303
  }
@@ -9352,7 +9323,7 @@ var CoretimePolkadot = /*#__PURE__*/function (_ParachainNode) {
9352
9323
  var CoretimePaseo = /*#__PURE__*/function (_CoretimePolkadot) {
9353
9324
  function CoretimePaseo() {
9354
9325
  _classCallCheck(this, CoretimePaseo);
9355
- return _callSuper(this, CoretimePaseo, ['CoretimePaseo', 'PaseoCoretime', 'paseo', sdkCommon.Version.V4]);
9326
+ return _callSuper(this, CoretimePaseo, ['CoretimePaseo', 'PaseoCoretime', 'paseo', sdkCommon.Version.V5]);
9356
9327
  }
9357
9328
  _inherits(CoretimePaseo, _CoretimePolkadot);
9358
9329
  return _createClass(CoretimePaseo);
@@ -9361,7 +9332,7 @@ var CoretimePaseo = /*#__PURE__*/function (_CoretimePolkadot) {
9361
9332
  var CoretimeWestend = /*#__PURE__*/function (_CoretimePolkadot) {
9362
9333
  function CoretimeWestend() {
9363
9334
  _classCallCheck(this, CoretimeWestend);
9364
- return _callSuper(this, CoretimeWestend, ['CoretimeWestend', 'westendCoretime', 'westend', sdkCommon.Version.V4]);
9335
+ return _callSuper(this, CoretimeWestend, ['CoretimeWestend', 'westendCoretime', 'westend', sdkCommon.Version.V5]);
9365
9336
  }
9366
9337
  _inherits(CoretimeWestend, _CoretimePolkadot);
9367
9338
  return _createClass(CoretimeWestend);
@@ -9376,9 +9347,8 @@ var Crab = /*#__PURE__*/function (_ParachainNode) {
9376
9347
  return _createClass(Crab, [{
9377
9348
  key: "transferPolkadotXCM",
9378
9349
  value: function transferPolkadotXCM(input) {
9379
- // TESTED https://kusama.subscan.io/xcm_message/kusama-ce7396ec470ba0c6516a50075046ee65464572dc
9380
9350
  if (input.scenario === 'ParaToPara') {
9381
- return transferPolkadotXcm(input, 'reserve_transfer_assets');
9351
+ return transferPolkadotXcm(input, 'limited_reserve_transfer_assets', 'Unlimited');
9382
9352
  }
9383
9353
  throw new ScenarioNotSupportedError(this.node, input.scenario);
9384
9354
  }
@@ -9393,11 +9363,9 @@ var Crab = /*#__PURE__*/function (_ParachainNode) {
9393
9363
  if (scenario === 'ParaToPara') {
9394
9364
  return createMultiAsset(version, amount, {
9395
9365
  parents: sdkCommon.Parents.ZERO,
9396
- interior: {
9397
- X1: {
9398
- PalletInstance: 5
9399
- }
9400
- }
9366
+ interior: createX1Payload(version, {
9367
+ PalletInstance: 5
9368
+ })
9401
9369
  });
9402
9370
  } else {
9403
9371
  return _superPropGet(Crab, "createCurrencySpec", this, 3)([amount, scenario, version]);
@@ -9424,7 +9392,7 @@ var Crust = /*#__PURE__*/function (_ParachainNode) {
9424
9392
  return 'SelfReserve';
9425
9393
  }
9426
9394
  if (!assets.isForeignAsset(asset) || !asset.assetId) {
9427
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9395
+ throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " has no assetId"));
9428
9396
  }
9429
9397
  return {
9430
9398
  OtherReserve: BigInt(asset.assetId)
@@ -9443,12 +9411,7 @@ var Crust = /*#__PURE__*/function (_ParachainNode) {
9443
9411
  var api = options.api,
9444
9412
  asset = options.asset,
9445
9413
  address = options.address;
9446
- if (!assets.isForeignAsset(asset)) {
9447
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
9448
- }
9449
- if (asset.assetId === undefined) {
9450
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9451
- }
9414
+ assertHasId(asset);
9452
9415
  return api.callTxMethod({
9453
9416
  module: 'Assets',
9454
9417
  method: 'transfer',
@@ -9457,7 +9420,7 @@ var Crust = /*#__PURE__*/function (_ParachainNode) {
9457
9420
  target: {
9458
9421
  Id: address
9459
9422
  },
9460
- amount: BigInt(asset.amount)
9423
+ amount: asset.amount
9461
9424
  }
9462
9425
  });
9463
9426
  }
@@ -9476,9 +9439,7 @@ var CrustShadow = /*#__PURE__*/function (_ParachainNode) {
9476
9439
  if (asset.symbol === this.getNativeAssetSymbol()) {
9477
9440
  return 'SelfReserve';
9478
9441
  }
9479
- if (!assets.isForeignAsset(asset) || !asset.assetId) {
9480
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9481
- }
9442
+ assertHasId(asset);
9482
9443
  return {
9483
9444
  OtherReserve: BigInt(asset.assetId)
9484
9445
  };
@@ -9556,19 +9517,14 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
9556
9517
  var api = options.api,
9557
9518
  asset = options.asset,
9558
9519
  address = options.address;
9559
- if (!assets.isForeignAsset(asset)) {
9560
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
9561
- }
9562
- if (asset.assetId === undefined) {
9563
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9564
- }
9520
+ assertHasId(asset);
9565
9521
  return api.callTxMethod({
9566
9522
  module: 'Assets',
9567
9523
  method: 'transfer',
9568
9524
  parameters: {
9569
9525
  id: BigInt(asset.assetId),
9570
9526
  target: address,
9571
- amount: BigInt(asset.amount)
9527
+ amount: asset.amount
9572
9528
  }
9573
9529
  });
9574
9530
  }
@@ -9578,7 +9534,7 @@ var Darwinia = /*#__PURE__*/function (_ParachainNode) {
9578
9534
  var Encointer = /*#__PURE__*/function (_ParachainNode) {
9579
9535
  function Encointer() {
9580
9536
  _classCallCheck(this, Encointer);
9581
- return _callSuper(this, Encointer, ['Encointer', 'encointer', 'kusama', sdkCommon.Version.V4]);
9537
+ return _callSuper(this, Encointer, ['Encointer', 'encointer', 'kusama', sdkCommon.Version.V5]);
9582
9538
  }
9583
9539
  _inherits(Encointer, _ParachainNode);
9584
9540
  return _createClass(Encointer, [{
@@ -9602,12 +9558,48 @@ var Encointer = /*#__PURE__*/function (_ParachainNode) {
9602
9558
  }]);
9603
9559
  }(ParachainNode);
9604
9560
 
9561
+ var EnergyWebX = /*#__PURE__*/function (_ParachainNode) {
9562
+ function EnergyWebX() {
9563
+ var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'EnergyWebX';
9564
+ var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ewx';
9565
+ var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
9566
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V3;
9567
+ _classCallCheck(this, EnergyWebX);
9568
+ return _callSuper(this, EnergyWebX, [chain, info, type, version]);
9569
+ }
9570
+ _inherits(EnergyWebX, _ParachainNode);
9571
+ return _createClass(EnergyWebX, [{
9572
+ key: "transferPolkadotXCM",
9573
+ value: function transferPolkadotXCM(input) {
9574
+ var scenario = input.scenario;
9575
+ if (scenario !== 'ParaToPara') {
9576
+ throw new ScenarioNotSupportedError(this.node, scenario);
9577
+ }
9578
+ return transferPolkadotXcm(input, 'limited_reserve_transfer_assets', 'Unlimited');
9579
+ }
9580
+ }, {
9581
+ key: "transferRelayToPara",
9582
+ value: function transferRelayToPara() {
9583
+ throw new NodeNotSupportedError();
9584
+ }
9585
+ }]);
9586
+ }(ParachainNode);
9587
+
9588
+ var EnergyWebXPaseo = /*#__PURE__*/function (_EnergyWebX) {
9589
+ function EnergyWebXPaseo() {
9590
+ _classCallCheck(this, EnergyWebXPaseo);
9591
+ return _callSuper(this, EnergyWebXPaseo, ['EnergyWebXPaseo', 'paseoEwx', 'paseo', sdkCommon.Version.V3]);
9592
+ }
9593
+ _inherits(EnergyWebXPaseo, _EnergyWebX);
9594
+ return _createClass(EnergyWebXPaseo);
9595
+ }(EnergyWebX);
9596
+
9605
9597
  var Heima = /*#__PURE__*/function (_ParachainNode) {
9606
9598
  function Heima() {
9607
9599
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Heima';
9608
9600
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'litentry';
9609
9601
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
9610
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
9602
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
9611
9603
  _classCallCheck(this, Heima);
9612
9604
  return _callSuper(this, Heima, [chain, info, type, version]);
9613
9605
  }
@@ -9631,7 +9623,7 @@ var Heima = /*#__PURE__*/function (_ParachainNode) {
9631
9623
  var HeimaPaseo = /*#__PURE__*/function (_Heima) {
9632
9624
  function HeimaPaseo() {
9633
9625
  _classCallCheck(this, HeimaPaseo);
9634
- return _callSuper(this, HeimaPaseo, ['HeimaPaseo', 'heima-paseo', 'paseo', sdkCommon.Version.V4]);
9626
+ return _callSuper(this, HeimaPaseo, ['HeimaPaseo', 'heima-paseo', 'paseo', sdkCommon.Version.V5]);
9635
9627
  }
9636
9628
  _inherits(HeimaPaseo, _Heima);
9637
9629
  return _createClass(HeimaPaseo);
@@ -9648,7 +9640,7 @@ var getAssetMultiLocation = function getAssetMultiLocation(asset) {
9648
9640
  if (assets.isForeignAsset(asset) && asset.multiLocation !== undefined) {
9649
9641
  return asset.multiLocation;
9650
9642
  }
9651
- throw new assets.InvalidCurrencyError("Transfer of asset ".concat(JSON.stringify(asset), " is not supported yet"));
9643
+ throw new assets.InvalidCurrencyError("Transfer of asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " is not supported yet"));
9652
9644
  };
9653
9645
  var createTransferAssetsTransfer = function createTransferAssetsTransfer(options, version) {
9654
9646
  var asset = options.asset;
@@ -9736,7 +9728,7 @@ var createCustomXcmPolimec = function createCustomXcmPolimec(api, address, desti
9736
9728
  var Polimec = /*#__PURE__*/function (_ParachainNode) {
9737
9729
  function Polimec() {
9738
9730
  _classCallCheck(this, Polimec);
9739
- return _callSuper(this, Polimec, ['Polimec', 'polimec', 'polkadot', sdkCommon.Version.V4]);
9731
+ return _callSuper(this, Polimec, ['Polimec', 'polimec', 'polkadot', sdkCommon.Version.V5]);
9740
9732
  }
9741
9733
  _inherits(Polimec, _ParachainNode);
9742
9734
  return _createClass(Polimec, [{
@@ -9793,12 +9785,8 @@ var Polimec = /*#__PURE__*/function (_ParachainNode) {
9793
9785
  var api = options.api,
9794
9786
  asset = options.asset,
9795
9787
  address = options.address;
9796
- if (!assets.isForeignAsset(asset)) {
9797
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
9798
- }
9799
- if (asset.multiLocation === undefined) {
9800
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no multi-location"));
9801
- }
9788
+ assertIsForeign(asset);
9789
+ assertHasLocation(asset);
9802
9790
  return api.callTxMethod({
9803
9791
  module: 'ForeignAssets',
9804
9792
  method: 'transfer',
@@ -9807,7 +9795,7 @@ var Polimec = /*#__PURE__*/function (_ParachainNode) {
9807
9795
  target: {
9808
9796
  Id: address
9809
9797
  },
9810
- amount: BigInt(asset.amount)
9798
+ amount: asset.amount
9811
9799
  }
9812
9800
  });
9813
9801
  }
@@ -9944,9 +9932,7 @@ var Hydration = /*#__PURE__*/function (_ParachainNode) {
9944
9932
  if (asset.symbol === this.getNativeAssetSymbol()) {
9945
9933
  return transferXTokens(input, Hydration.NATIVE_ASSET_ID);
9946
9934
  }
9947
- if (!assets.isForeignAsset(asset)) {
9948
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9949
- }
9935
+ assertHasId(asset);
9950
9936
  return transferXTokens(input, Number(asset.assetId));
9951
9937
  }
9952
9938
  }, {
@@ -9969,7 +9955,7 @@ var Hydration = /*#__PURE__*/function (_ParachainNode) {
9969
9955
  method: 'transfer_keep_alive',
9970
9956
  parameters: {
9971
9957
  dest: address,
9972
- value: BigInt(asset.amount)
9958
+ value: asset.amount
9973
9959
  }
9974
9960
  });
9975
9961
  }
@@ -9979,19 +9965,14 @@ var Hydration = /*#__PURE__*/function (_ParachainNode) {
9979
9965
  var api = options.api,
9980
9966
  asset = options.asset,
9981
9967
  address = options.address;
9982
- if (!assets.isForeignAsset(asset)) {
9983
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
9984
- }
9985
- if (asset.assetId === undefined) {
9986
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
9987
- }
9968
+ assertHasId(asset);
9988
9969
  return api.callTxMethod({
9989
9970
  module: 'Tokens',
9990
9971
  method: 'transfer',
9991
9972
  parameters: {
9992
9973
  dest: address,
9993
9974
  currency_id: Number(asset.assetId),
9994
- amount: BigInt(asset.amount)
9975
+ amount: asset.amount
9995
9976
  }
9996
9977
  });
9997
9978
  }
@@ -10008,6 +9989,65 @@ var HydrationPaseo = /*#__PURE__*/function (_Hydration) {
10008
9989
  return _createClass(HydrationPaseo);
10009
9990
  }(Hydration);
10010
9991
 
9992
+ var IntegriteeKusama = /*#__PURE__*/function (_ParachainNode) {
9993
+ function IntegriteeKusama() {
9994
+ var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'IntegriteeKusama';
9995
+ var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'integritee';
9996
+ var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'kusama';
9997
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
9998
+ _classCallCheck(this, IntegriteeKusama);
9999
+ return _callSuper(this, IntegriteeKusama, [chain, info, type, version]);
10000
+ }
10001
+ _inherits(IntegriteeKusama, _ParachainNode);
10002
+ return _createClass(IntegriteeKusama, [{
10003
+ key: "transferXTokens",
10004
+ value: function transferXTokens$1(input) {
10005
+ var asset = input.asset,
10006
+ scenario = input.scenario;
10007
+ if (scenario !== 'ParaToPara') {
10008
+ throw new ScenarioNotSupportedError(this.node, scenario);
10009
+ }
10010
+ if (asset.symbol !== this.getNativeAssetSymbol()) {
10011
+ throw new assets.InvalidCurrencyError("Asset ".concat(asset.symbol, " is not supported by chain ").concat(this.node, "."));
10012
+ }
10013
+ return transferXTokens(input, asset.symbol);
10014
+ }
10015
+ }, {
10016
+ key: "transferRelayToPara",
10017
+ value: function transferRelayToPara() {
10018
+ throw new NodeNotSupportedError();
10019
+ }
10020
+ }, {
10021
+ key: "transferLocalNonNativeAsset",
10022
+ value: function transferLocalNonNativeAsset(options) {
10023
+ var api = options.api,
10024
+ asset = options.asset,
10025
+ address = options.address;
10026
+ assertHasId(asset);
10027
+ return api.callTxMethod({
10028
+ module: 'Assets',
10029
+ method: 'transfer',
10030
+ parameters: {
10031
+ id: Number(asset.assetId),
10032
+ target: {
10033
+ Id: address
10034
+ },
10035
+ amount: asset.amount
10036
+ }
10037
+ });
10038
+ }
10039
+ }]);
10040
+ }(ParachainNode);
10041
+
10042
+ var IntegriteePaseo = /*#__PURE__*/function (_IntegriteeKusama) {
10043
+ function IntegriteePaseo() {
10044
+ _classCallCheck(this, IntegriteePaseo);
10045
+ return _callSuper(this, IntegriteePaseo, ['IntegriteePaseo', 'integritee', 'paseo', sdkCommon.Version.V4]);
10046
+ }
10047
+ _inherits(IntegriteePaseo, _IntegriteeKusama);
10048
+ return _createClass(IntegriteePaseo);
10049
+ }(IntegriteeKusama);
10050
+
10011
10051
  var Interlay = /*#__PURE__*/function (_ParachainNode) {
10012
10052
  function Interlay() {
10013
10053
  _classCallCheck(this, Interlay);
@@ -10047,7 +10087,7 @@ var Interlay = /*#__PURE__*/function (_ParachainNode) {
10047
10087
  parameters: {
10048
10088
  dest: address,
10049
10089
  currency_id: this.getCurrencySelection(asset),
10050
- value: BigInt(asset.amount)
10090
+ value: asset.amount
10051
10091
  }
10052
10092
  });
10053
10093
  }
@@ -10072,9 +10112,7 @@ var Jamton = /*#__PURE__*/function (_ParachainNode) {
10072
10112
  Native: Jamton.NATIVE_ASSET_IDS[asset.symbol]
10073
10113
  });
10074
10114
  }
10075
- if (!assets.isForeignAsset(asset) || asset.assetId === undefined) {
10076
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10077
- }
10115
+ assertHasId(asset);
10078
10116
  if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot') {
10079
10117
  throw new ScenarioNotSupportedError(this.node, scenario, "Transfer from ".concat(this.node, " to ").concat(JSON.stringify(destination), " is not yet supported"));
10080
10118
  }
@@ -10084,7 +10122,7 @@ var Jamton = /*#__PURE__*/function (_ParachainNode) {
10084
10122
  }, null);
10085
10123
  assertHasLocation(asset);
10086
10124
  assertHasLocation(usdt);
10087
- var MIN_USDT_AMOUNT = 180000; // 0.18 USDt
10125
+ var MIN_USDT_AMOUNT = 180000n; // 0.18 USDt
10088
10126
  return transferXTokens(_objectSpread2(_objectSpread2({}, input), {}, {
10089
10127
  overriddenAsset: [_objectSpread2(_objectSpread2({}, createMultiAsset(version, MIN_USDT_AMOUNT, usdt.multiLocation)), {}, {
10090
10128
  isFeeAsset: true
@@ -10203,7 +10241,7 @@ var Kintsugi = /*#__PURE__*/function (_ParachainNode) {
10203
10241
  parameters: {
10204
10242
  dest: address,
10205
10243
  currency_id: this.getCurrencySelection(asset),
10206
- value: BigInt(asset.amount)
10244
+ value: asset.amount
10207
10245
  }
10208
10246
  });
10209
10247
  }
@@ -10264,9 +10302,7 @@ var Manta = /*#__PURE__*/function (_ParachainNode) {
10264
10302
  key: "getAssetId",
10265
10303
  value: function getAssetId(asset) {
10266
10304
  if (asset.symbol === this.getNativeAssetSymbol()) return Manta.NATIVE_ASSET_ID;
10267
- if (!assets.isForeignAsset(asset) || !asset.assetId) {
10268
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10269
- }
10305
+ assertHasId(asset);
10270
10306
  return BigInt(asset.assetId);
10271
10307
  }
10272
10308
  }, {
@@ -10284,12 +10320,7 @@ var Manta = /*#__PURE__*/function (_ParachainNode) {
10284
10320
  var api = options.api,
10285
10321
  asset = options.asset,
10286
10322
  address = options.address;
10287
- if (!assets.isForeignAsset(asset)) {
10288
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
10289
- }
10290
- if (asset.assetId === undefined) {
10291
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10292
- }
10323
+ assertHasId(asset);
10293
10324
  return api.callTxMethod({
10294
10325
  module: 'Assets',
10295
10326
  method: 'transfer',
@@ -10298,7 +10329,7 @@ var Manta = /*#__PURE__*/function (_ParachainNode) {
10298
10329
  target: {
10299
10330
  Id: address
10300
10331
  },
10301
- amount: BigInt(asset.amount)
10332
+ amount: asset.amount
10302
10333
  }
10303
10334
  });
10304
10335
  }
@@ -10311,7 +10342,7 @@ var Moonbeam = /*#__PURE__*/function (_ParachainNode) {
10311
10342
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Moonbeam';
10312
10343
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'moonbeam';
10313
10344
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
10314
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
10345
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
10315
10346
  _classCallCheck(this, Moonbeam);
10316
10347
  return _callSuper(this, Moonbeam, [chain, info, type, version]);
10317
10348
  }
@@ -10361,19 +10392,14 @@ var Moonbeam = /*#__PURE__*/function (_ParachainNode) {
10361
10392
  var api = options.api,
10362
10393
  asset = options.asset,
10363
10394
  address = options.address;
10364
- if (!assets.isForeignAsset(asset)) {
10365
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
10366
- }
10367
- if (asset.assetId === undefined) {
10368
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10369
- }
10395
+ assertHasId(asset);
10370
10396
  return api.callTxMethod({
10371
10397
  module: 'Assets',
10372
10398
  method: 'transfer',
10373
10399
  parameters: {
10374
10400
  id: BigInt(asset.assetId),
10375
10401
  target: address,
10376
- amount: BigInt(asset.amount)
10402
+ amount: asset.amount
10377
10403
  }
10378
10404
  });
10379
10405
  }
@@ -10383,7 +10409,7 @@ var Moonbeam = /*#__PURE__*/function (_ParachainNode) {
10383
10409
  var Moonriver = /*#__PURE__*/function (_ParachainNode) {
10384
10410
  function Moonriver() {
10385
10411
  _classCallCheck(this, Moonriver);
10386
- return _callSuper(this, Moonriver, ['Moonriver', 'moonriver', 'kusama', sdkCommon.Version.V4]);
10412
+ return _callSuper(this, Moonriver, ['Moonriver', 'moonriver', 'kusama', sdkCommon.Version.V5]);
10387
10413
  }
10388
10414
  _inherits(Moonriver, _ParachainNode);
10389
10415
  return _createClass(Moonriver, [{
@@ -10505,7 +10531,7 @@ var createTypeAndThenTransfer = /*#__PURE__*/function () {
10505
10531
  var Mythos = /*#__PURE__*/function (_ParachainNode) {
10506
10532
  function Mythos() {
10507
10533
  _classCallCheck(this, Mythos);
10508
- return _callSuper(this, Mythos, ['Mythos', 'mythos', 'polkadot', sdkCommon.Version.V4]);
10534
+ return _callSuper(this, Mythos, ['Mythos', 'mythos', 'polkadot', sdkCommon.Version.V5]);
10509
10535
  }
10510
10536
  _inherits(Mythos, _ParachainNode);
10511
10537
  return _createClass(Mythos, [{
@@ -10642,7 +10668,7 @@ var PeoplePolkadot = /*#__PURE__*/function (_ParachainNode) {
10642
10668
  var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'PeoplePolkadot';
10643
10669
  var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'polkadotPeople';
10644
10670
  var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polkadot';
10645
- var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V4;
10671
+ var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
10646
10672
  _classCallCheck(this, PeoplePolkadot);
10647
10673
  return _callSuper(this, PeoplePolkadot, [chain, info, type, version]);
10648
10674
  }
@@ -10670,7 +10696,7 @@ var PeoplePolkadot = /*#__PURE__*/function (_ParachainNode) {
10670
10696
  var PAssetHub = /*#__PURE__*/function (_PeoplePolkadot) {
10671
10697
  function PAssetHub() {
10672
10698
  _classCallCheck(this, PAssetHub);
10673
- return _callSuper(this, PAssetHub, ['PAssetHub', 'PAssetHub - Contracts', 'paseo', sdkCommon.Version.V4]);
10699
+ return _callSuper(this, PAssetHub, ['PAssetHub', 'PAssetHub - Contracts', 'paseo', sdkCommon.Version.V5]);
10674
10700
  }
10675
10701
  _inherits(PAssetHub, _PeoplePolkadot);
10676
10702
  return _createClass(PAssetHub);
@@ -10690,9 +10716,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
10690
10716
  if (scenario !== 'ParaToPara') {
10691
10717
  throw new ScenarioNotSupportedError(this.node, scenario);
10692
10718
  }
10693
- if (!assets.isForeignAsset(asset) || !asset.assetId) {
10694
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10695
- }
10719
+ assertHasId(asset);
10696
10720
  return transferXTokens(input, BigInt(asset.assetId));
10697
10721
  }
10698
10722
  }, {
@@ -10706,12 +10730,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
10706
10730
  var api = options.api,
10707
10731
  asset = options.asset,
10708
10732
  address = options.address;
10709
- if (!assets.isForeignAsset(asset)) {
10710
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
10711
- }
10712
- if (asset.assetId === undefined) {
10713
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10714
- }
10733
+ assertHasId(asset);
10715
10734
  return api.callTxMethod({
10716
10735
  module: 'Assets',
10717
10736
  method: 'transfer',
@@ -10720,7 +10739,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
10720
10739
  target: {
10721
10740
  Id: address
10722
10741
  },
10723
- amount: BigInt(asset.amount)
10742
+ amount: asset.amount
10724
10743
  }
10725
10744
  });
10726
10745
  }
@@ -10746,7 +10765,7 @@ var Pendulum = /*#__PURE__*/function (_ParachainNode) {
10746
10765
  XCM: Number(asset.assetId)
10747
10766
  };
10748
10767
  }
10749
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10768
+ throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " has no assetId"));
10750
10769
  }
10751
10770
  }, {
10752
10771
  key: "transferXTokens",
@@ -10772,7 +10791,7 @@ var Penpal = /*#__PURE__*/function (_Moonbeam) {
10772
10791
  var PeopleKusama = /*#__PURE__*/function (_ParachainNode) {
10773
10792
  function PeopleKusama() {
10774
10793
  _classCallCheck(this, PeopleKusama);
10775
- return _callSuper(this, PeopleKusama, ['PeopleKusama', 'kusamaPeople', 'kusama', sdkCommon.Version.V4]);
10794
+ return _callSuper(this, PeopleKusama, ['PeopleKusama', 'kusamaPeople', 'kusama', sdkCommon.Version.V5]);
10776
10795
  }
10777
10796
  _inherits(PeopleKusama, _ParachainNode);
10778
10797
  return _createClass(PeopleKusama, [{
@@ -10799,7 +10818,7 @@ var PeopleKusama = /*#__PURE__*/function (_ParachainNode) {
10799
10818
  var PeoplePaseo = /*#__PURE__*/function (_PeoplePolkadot) {
10800
10819
  function PeoplePaseo() {
10801
10820
  _classCallCheck(this, PeoplePaseo);
10802
- return _callSuper(this, PeoplePaseo, ['PeoplePaseo', 'PaseoPeopleChain', 'paseo', sdkCommon.Version.V4]);
10821
+ return _callSuper(this, PeoplePaseo, ['PeoplePaseo', 'PaseoPeopleChain', 'paseo', sdkCommon.Version.V5]);
10803
10822
  }
10804
10823
  _inherits(PeoplePaseo, _PeoplePolkadot);
10805
10824
  return _createClass(PeoplePaseo);
@@ -10808,7 +10827,7 @@ var PeoplePaseo = /*#__PURE__*/function (_PeoplePolkadot) {
10808
10827
  var PeopleWestend = /*#__PURE__*/function (_PeoplePolkadot) {
10809
10828
  function PeopleWestend() {
10810
10829
  _classCallCheck(this, PeopleWestend);
10811
- return _callSuper(this, PeopleWestend, ['PeopleWestend', 'westendPeople', 'westend', sdkCommon.Version.V4]);
10830
+ return _callSuper(this, PeopleWestend, ['PeopleWestend', 'westendPeople', 'westend', sdkCommon.Version.V5]);
10812
10831
  }
10813
10832
  _inherits(PeopleWestend, _PeoplePolkadot);
10814
10833
  return _createClass(PeopleWestend);
@@ -10892,12 +10911,7 @@ var Phala = /*#__PURE__*/function (_ParachainNode) {
10892
10911
  var api = options.api,
10893
10912
  asset = options.asset,
10894
10913
  address = options.address;
10895
- if (!assets.isForeignAsset(asset)) {
10896
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
10897
- }
10898
- if (asset.assetId === undefined) {
10899
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10900
- }
10914
+ assertHasId(asset);
10901
10915
  return api.callTxMethod({
10902
10916
  module: 'Assets',
10903
10917
  method: 'transfer',
@@ -10906,7 +10920,7 @@ var Phala = /*#__PURE__*/function (_ParachainNode) {
10906
10920
  target: {
10907
10921
  Id: address
10908
10922
  },
10909
- amount: BigInt(asset.amount)
10923
+ amount: asset.amount
10910
10924
  }
10911
10925
  });
10912
10926
  }
@@ -10916,7 +10930,7 @@ var Phala = /*#__PURE__*/function (_ParachainNode) {
10916
10930
  var Quartz = /*#__PURE__*/function (_ParachainNode) {
10917
10931
  function Quartz() {
10918
10932
  _classCallCheck(this, Quartz);
10919
- return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', sdkCommon.Version.V4]);
10933
+ return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', sdkCommon.Version.V5]);
10920
10934
  }
10921
10935
  _inherits(Quartz, _ParachainNode);
10922
10936
  return _createClass(Quartz, [{
@@ -10926,9 +10940,7 @@ var Quartz = /*#__PURE__*/function (_ParachainNode) {
10926
10940
  if (asset.symbol === this.getNativeAssetSymbol()) {
10927
10941
  return transferXTokens(input, Quartz.NATIVE_ASSET_ID);
10928
10942
  }
10929
- if (!assets.isForeignAsset(asset) || !asset.assetId) {
10930
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10931
- }
10943
+ assertHasId(asset);
10932
10944
  return transferXTokens(input, Number(asset.assetId));
10933
10945
  }
10934
10946
  }]);
@@ -10971,12 +10983,7 @@ var RobonomicsPolkadot = /*#__PURE__*/function (_ParachainNode) {
10971
10983
  var api = options.api,
10972
10984
  asset = options.asset,
10973
10985
  address = options.address;
10974
- if (!assets.isForeignAsset(asset)) {
10975
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
10976
- }
10977
- if (asset.assetId === undefined) {
10978
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
10979
- }
10986
+ assertHasId(asset);
10980
10987
  return api.callTxMethod({
10981
10988
  module: 'Assets',
10982
10989
  method: 'transfer',
@@ -10985,7 +10992,7 @@ var RobonomicsPolkadot = /*#__PURE__*/function (_ParachainNode) {
10985
10992
  target: {
10986
10993
  Id: address
10987
10994
  },
10988
- amount: BigInt(asset.amount)
10995
+ amount: asset.amount
10989
10996
  }
10990
10997
  });
10991
10998
  }
@@ -10995,7 +11002,7 @@ var RobonomicsPolkadot = /*#__PURE__*/function (_ParachainNode) {
10995
11002
  var Shiden = /*#__PURE__*/function (_ParachainNode) {
10996
11003
  function Shiden() {
10997
11004
  _classCallCheck(this, Shiden);
10998
- return _callSuper(this, Shiden, ['Shiden', 'shiden', 'kusama', sdkCommon.Version.V4]);
11005
+ return _callSuper(this, Shiden, ['Shiden', 'shiden', 'kusama', sdkCommon.Version.V5]);
10999
11006
  }
11000
11007
  _inherits(Shiden, _ParachainNode);
11001
11008
  return _createClass(Shiden, [{
@@ -11049,7 +11056,7 @@ var Subsocial = /*#__PURE__*/function (_ParachainNode) {
11049
11056
  var Unique = /*#__PURE__*/function (_ParachainNode) {
11050
11057
  function Unique() {
11051
11058
  _classCallCheck(this, Unique);
11052
- return _callSuper(this, Unique, ['Unique', 'unique', 'polkadot', sdkCommon.Version.V4]);
11059
+ return _callSuper(this, Unique, ['Unique', 'unique', 'polkadot', sdkCommon.Version.V5]);
11053
11060
  }
11054
11061
  _inherits(Unique, _ParachainNode);
11055
11062
  return _createClass(Unique, [{
@@ -11059,9 +11066,7 @@ var Unique = /*#__PURE__*/function (_ParachainNode) {
11059
11066
  if (asset.symbol === this.getNativeAssetSymbol()) {
11060
11067
  return transferXTokens(input, Unique.NATIVE_ASSET_ID);
11061
11068
  }
11062
- if (!assets.isForeignAsset(asset) || !asset.assetId) {
11063
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
11064
- }
11069
+ assertHasId(asset);
11065
11070
  return transferXTokens(input, Number(asset.assetId));
11066
11071
  }
11067
11072
  }, {
@@ -11087,9 +11092,7 @@ var Zeitgeist = /*#__PURE__*/function (_ParachainNode) {
11087
11092
  key: "getCurrencySelection",
11088
11093
  value: function getCurrencySelection(asset) {
11089
11094
  if (asset.symbol === this.getNativeAssetSymbol()) return 'Ztg';
11090
- if (!assets.isForeignAsset(asset)) {
11091
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
11092
- }
11095
+ assertHasId(asset);
11093
11096
  return {
11094
11097
  ForeignAsset: Number(asset.assetId)
11095
11098
  };
@@ -11107,12 +11110,7 @@ var Zeitgeist = /*#__PURE__*/function (_ParachainNode) {
11107
11110
  var api = options.api,
11108
11111
  asset = options.asset,
11109
11112
  address = options.address;
11110
- if (!assets.isForeignAsset(asset)) {
11111
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
11112
- }
11113
- if (asset.assetId === undefined) {
11114
- throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
11115
- }
11113
+ assertHasId(asset);
11116
11114
  return api.callTxMethod({
11117
11115
  module: 'AssetManager',
11118
11116
  method: 'transfer',
@@ -11121,7 +11119,7 @@ var Zeitgeist = /*#__PURE__*/function (_ParachainNode) {
11121
11119
  Id: address
11122
11120
  },
11123
11121
  currency_id: this.getCurrencySelection(asset),
11124
- amount: BigInt(asset.amount)
11122
+ amount: asset.amount
11125
11123
  }
11126
11124
  });
11127
11125
  }
@@ -11131,7 +11129,7 @@ var Zeitgeist = /*#__PURE__*/function (_ParachainNode) {
11131
11129
  var ZeitgeistPaseo = /*#__PURE__*/function (_Zeitgeist) {
11132
11130
  function ZeitgeistPaseo() {
11133
11131
  _classCallCheck(this, ZeitgeistPaseo);
11134
- return _callSuper(this, ZeitgeistPaseo, ['ZeitgeistPaseo', 'ZeitgeistBatteryStation', 'paseo', sdkCommon.Version.V3]);
11132
+ return _callSuper(this, ZeitgeistPaseo, ['ZeitgeistPaseo', 'ZeitgeistBatteryStation', 'paseo', sdkCommon.Version.V4]);
11135
11133
  }
11136
11134
  _inherits(ZeitgeistPaseo, _Zeitgeist);
11137
11135
  return _createClass(ZeitgeistPaseo);
@@ -11151,7 +11149,9 @@ var nodes = function nodes() {
11151
11149
  Centrifuge: new Centrifuge(),
11152
11150
  ComposableFinance: new ComposableFinance(),
11153
11151
  Darwinia: new Darwinia(),
11152
+ EnergyWebX: new EnergyWebX(),
11154
11153
  Hydration: new Hydration(),
11154
+ IntegriteeKusama: new IntegriteeKusama(),
11155
11155
  Interlay: new Interlay(),
11156
11156
  Heima: new Heima(),
11157
11157
  Jamton: new Jamton(),
@@ -11200,13 +11200,15 @@ var nodes = function nodes() {
11200
11200
  AssetHubPaseo: new AssetHubPaseo(),
11201
11201
  BridgeHubPaseo: new BridgeHubPaseo(),
11202
11202
  CoretimePaseo: new CoretimePaseo(),
11203
+ EnergyWebXPaseo: new EnergyWebXPaseo(),
11204
+ IntegriteePaseo: new IntegriteePaseo(),
11205
+ KiltPaseo: new KiltPaseo(),
11203
11206
  PAssetHub: new PAssetHub(),
11204
11207
  PeoplePaseo: new PeoplePaseo(),
11205
11208
  AjunaPaseo: new AjunaPaseo(),
11206
11209
  BifrostPaseo: new BifrostPaseo(),
11207
11210
  HeimaPaseo: new HeimaPaseo(),
11208
11211
  HydrationPaseo: new HydrationPaseo(),
11209
- KiltPaseo: new KiltPaseo(),
11210
11212
  LaosPaseo: new LaosPaseo(),
11211
11213
  NeuroWebPaseo: new NeuroWebPaseo(),
11212
11214
  NodlePaseo: new NodlePaseo(),
@@ -11702,7 +11704,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
11702
11704
  var _options$disableFallb;
11703
11705
  var _this$_options3, from, to, address, senderAddress, feeAsset, currency, tx, disableFallback;
11704
11706
  return _regenerator().w(function (_context4) {
11705
- while (1) switch (_context4.n) {
11707
+ while (1) switch (_context4.p = _context4.n) {
11706
11708
  case 0:
11707
11709
  _this$_options3 = this._options, from = _this$_options3.from, to = _this$_options3.to, address = _this$_options3.address, senderAddress = _this$_options3.senderAddress, feeAsset = _this$_options3.feeAsset, currency = _this$_options3.currency;
11708
11710
  assertToIsString(to);
@@ -11764,7 +11766,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
11764
11766
  tx,
11765
11767
  _args5 = arguments;
11766
11768
  return _regenerator().w(function (_context5) {
11767
- while (1) switch (_context5.n) {
11769
+ while (1) switch (_context5.p = _context5.n) {
11768
11770
  case 0:
11769
11771
  _ref = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {
11770
11772
  disableFallback: false
@@ -11817,7 +11819,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
11817
11819
  var _getXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
11818
11820
  var _this$_options5, from, to, address, senderAddress, currency, tx;
11819
11821
  return _regenerator().w(function (_context6) {
11820
- while (1) switch (_context6.n) {
11822
+ while (1) switch (_context6.p = _context6.n) {
11821
11823
  case 0:
11822
11824
  _this$_options5 = this._options, from = _this$_options5.from, to = _this$_options5.to, address = _this$_options5.address, senderAddress = _this$_options5.senderAddress, currency = _this$_options5.currency;
11823
11825
  assertToIsString(to);
@@ -11867,7 +11869,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
11867
11869
  var _getOriginXcmFeeEstimate2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
11868
11870
  var _this$_options6, from, to, senderAddress, currency, tx;
11869
11871
  return _regenerator().w(function (_context7) {
11870
- while (1) switch (_context7.n) {
11872
+ while (1) switch (_context7.p = _context7.n) {
11871
11873
  case 0:
11872
11874
  _this$_options6 = this._options, from = _this$_options6.from, to = _this$_options6.to, senderAddress = _this$_options6.senderAddress, currency = _this$_options6.currency;
11873
11875
  assertToIsString(to);
@@ -12062,6 +12064,7 @@ exports.GeneralBuilder = GeneralBuilder;
12062
12064
  exports.IncompatibleNodesError = IncompatibleNodesError;
12063
12065
  exports.InvalidAddressError = InvalidAddressError;
12064
12066
  exports.InvalidParameterError = InvalidParameterError;
12067
+ exports.MissingChainApiError = MissingChainApiError;
12065
12068
  exports.NoXCMSupportImplementedError = NoXCMSupportImplementedError;
12066
12069
  exports.NodeNotSupportedError = NodeNotSupportedError;
12067
12070
  exports.ScenarioNotSupportedError = ScenarioNotSupportedError;
@@ -12071,7 +12074,9 @@ exports.UnableToComputeError = UnableToComputeError;
12071
12074
  exports.addEthereumBridgeFees = addEthereumBridgeFees;
12072
12075
  exports.addXcmVersionHeader = addXcmVersionHeader;
12073
12076
  exports.assertAddressIsString = assertAddressIsString;
12077
+ exports.assertHasId = assertHasId;
12074
12078
  exports.assertHasLocation = assertHasLocation;
12079
+ exports.assertIsForeign = assertIsForeign;
12075
12080
  exports.assertToIsString = assertToIsString;
12076
12081
  exports.blake2b256 = blake2b256;
12077
12082
  exports.blake2b512 = blake2b512;
@@ -12122,6 +12127,7 @@ exports.getXcmFeeEstimate = getXcmFeeEstimate;
12122
12127
  exports.handleExecuteTransfer = handleExecuteTransfer;
12123
12128
  exports.handleSwapExecuteTransfer = handleSwapExecuteTransfer;
12124
12129
  exports.handleToAhTeleport = handleToAhTeleport;
12130
+ exports.isConfig = isConfig;
12125
12131
  exports.localizeLocation = localizeLocation;
12126
12132
  exports.maybeOverrideMultiAsset = maybeOverrideMultiAsset;
12127
12133
  exports.maybeOverrideMultiAssets = maybeOverrideMultiAssets;