@paraspell/sdk-core 11.2.1 → 11.2.2

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
@@ -5343,7 +5343,7 @@ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled
5343
5343
  destination = _ref.to,
5344
5344
  currency = _ref.currency;
5345
5345
  var isDestAssetHub = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
5346
- var allowedChainsToAh = ['AssetHubPolkadot', 'BifrostPolkadot', 'BifrostKusama', 'Hydration', 'Moonbeam', 'Ajuna', 'Polimec', 'Jamton'];
5346
+ var allowedChainsToAh = ['AssetHubPolkadot', 'BridgeHubPolkadot', 'PeoplePolkadot', 'CoretimePolkadot', 'Collectives', 'BifrostPolkadot', 'BifrostKusama', 'Hydration', 'Moonbeam', 'Ajuna', 'Polimec', 'Jamton'];
5347
5347
  if (!sdkCommon.isRelayChain(origin) && !isBridge && isDestAssetHub && !allowedChainsToAh.includes(origin) && (asset === null || asset === void 0 ? void 0 : asset.symbol) === 'DOT') {
5348
5348
  throw new TransferToAhNotSupported("Chain ".concat(origin, " does not support DOT transfer to AssetHub"));
5349
5349
  }
@@ -8413,7 +8413,7 @@ var Parachain = /*#__PURE__*/function () {
8413
8413
  method: method
8414
8414
  };
8415
8415
  shouldUseTeleport = this.shouldUseNativeAssetTeleport(sendOptions);
8416
- if (!(shouldUseTeleport && this.chain !== 'Mythos' && destination !== 'Mythos')) {
8416
+ if (!((this.chain.includes('AssetHub') && destination !== 'Mythos' && typeof destination === 'string' && !sdkCommon.isSystemChain(destination) || !sdkCommon.isSystemChain(this.chain) && this.chain !== 'Mythos' && typeof destination === 'string' && destination.includes('AssetHub')) && shouldUseTeleport)) {
8417
8417
  _context.n = 6;
8418
8418
  break;
8419
8419
  }
@@ -9632,9 +9632,17 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_Parachain) {
9632
9632
  return _createClass(BridgeHubPolkadot, [{
9633
9633
  key: "transferPolkadotXCM",
9634
9634
  value: function transferPolkadotXCM(input) {
9635
- var scenario = input.scenario;
9636
- if (scenario === 'ParaToPara') {
9637
- throw new ScenarioNotSupportedError(this.chain, scenario, 'Unable to use bridge hub for transfers to other Parachains. Please move your currency to AssetHub to transfer to other Parachains.');
9635
+ var scenario = input.scenario,
9636
+ destination = input.destination;
9637
+ var newOverridenAsset = {
9638
+ parents: 1,
9639
+ interior: {
9640
+ Here: null
9641
+ }
9642
+ };
9643
+ input.overriddenAsset = newOverridenAsset;
9644
+ if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
9645
+ throw new ScenarioNotSupportedError(this.chain, scenario, 'Unable to use bridge hub for transfers to other Parachains.');
9638
9646
  }
9639
9647
  var method = 'limited_teleport_assets';
9640
9648
  return transferPolkadotXcm(input, method, 'Unlimited');
@@ -9725,8 +9733,16 @@ var Collectives = /*#__PURE__*/function (_Parachain) {
9725
9733
  return _createClass(Collectives, [{
9726
9734
  key: "transferPolkadotXCM",
9727
9735
  value: function transferPolkadotXCM(input) {
9728
- var scenario = input.scenario;
9729
- if (scenario === 'ParaToPara') {
9736
+ var scenario = input.scenario,
9737
+ destination = input.destination;
9738
+ var newOverridenAsset = {
9739
+ parents: 1,
9740
+ interior: {
9741
+ Here: null
9742
+ }
9743
+ };
9744
+ input.overriddenAsset = newOverridenAsset;
9745
+ if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
9730
9746
  throw new ScenarioNotSupportedError(this.chain, scenario);
9731
9747
  }
9732
9748
  return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
@@ -9806,8 +9822,17 @@ var CoretimePolkadot = /*#__PURE__*/function (_Parachain) {
9806
9822
  key: "transferPolkadotXCM",
9807
9823
  value: function transferPolkadotXCM(input) {
9808
9824
  var scenario = input.scenario;
9809
- var method = scenario === 'ParaToPara' ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
9810
- return transferPolkadotXcm(input, method, 'Unlimited');
9825
+ var newOverridenAsset = {
9826
+ parents: 1,
9827
+ interior: {
9828
+ Here: null
9829
+ }
9830
+ };
9831
+ input.overriddenAsset = newOverridenAsset;
9832
+ if (scenario === 'ParaToPara') {
9833
+ throw new ScenarioNotSupportedError(this.chain, scenario);
9834
+ }
9835
+ return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
9811
9836
  }
9812
9837
  }, {
9813
9838
  key: "getRelayToParaOverrides",
@@ -11218,10 +11243,18 @@ var PeoplePolkadot = /*#__PURE__*/function (_Parachain) {
11218
11243
  return _createClass(PeoplePolkadot, [{
11219
11244
  key: "transferPolkadotXCM",
11220
11245
  value: function transferPolkadotXCM(input) {
11221
- var scenario = input.scenario;
11222
- if (scenario === 'ParaToPara') {
11246
+ var scenario = input.scenario,
11247
+ destination = input.destination;
11248
+ if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
11223
11249
  throw new ScenarioNotSupportedError(this.chain, scenario);
11224
11250
  }
11251
+ var newOverridenAsset = {
11252
+ parents: 1,
11253
+ interior: {
11254
+ Here: null
11255
+ }
11256
+ };
11257
+ input.overriddenAsset = newOverridenAsset;
11225
11258
  return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
11226
11259
  }
11227
11260
  }, {
package/dist/index.mjs CHANGED
@@ -5344,7 +5344,7 @@ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled
5344
5344
  destination = _ref.to,
5345
5345
  currency = _ref.currency;
5346
5346
  var isDestAssetHub = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
5347
- var allowedChainsToAh = ['AssetHubPolkadot', 'BifrostPolkadot', 'BifrostKusama', 'Hydration', 'Moonbeam', 'Ajuna', 'Polimec', 'Jamton'];
5347
+ var allowedChainsToAh = ['AssetHubPolkadot', 'BridgeHubPolkadot', 'PeoplePolkadot', 'CoretimePolkadot', 'Collectives', 'BifrostPolkadot', 'BifrostKusama', 'Hydration', 'Moonbeam', 'Ajuna', 'Polimec', 'Jamton'];
5348
5348
  if (!isRelayChain(origin) && !isBridge && isDestAssetHub && !allowedChainsToAh.includes(origin) && (asset === null || asset === void 0 ? void 0 : asset.symbol) === 'DOT') {
5349
5349
  throw new TransferToAhNotSupported("Chain ".concat(origin, " does not support DOT transfer to AssetHub"));
5350
5350
  }
@@ -8414,7 +8414,7 @@ var Parachain = /*#__PURE__*/function () {
8414
8414
  method: method
8415
8415
  };
8416
8416
  shouldUseTeleport = this.shouldUseNativeAssetTeleport(sendOptions);
8417
- if (!(shouldUseTeleport && this.chain !== 'Mythos' && destination !== 'Mythos')) {
8417
+ if (!((this.chain.includes('AssetHub') && destination !== 'Mythos' && typeof destination === 'string' && !isSystemChain(destination) || !isSystemChain(this.chain) && this.chain !== 'Mythos' && typeof destination === 'string' && destination.includes('AssetHub')) && shouldUseTeleport)) {
8418
8418
  _context.n = 6;
8419
8419
  break;
8420
8420
  }
@@ -9633,9 +9633,17 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_Parachain) {
9633
9633
  return _createClass(BridgeHubPolkadot, [{
9634
9634
  key: "transferPolkadotXCM",
9635
9635
  value: function transferPolkadotXCM(input) {
9636
- var scenario = input.scenario;
9637
- if (scenario === 'ParaToPara') {
9638
- throw new ScenarioNotSupportedError(this.chain, scenario, 'Unable to use bridge hub for transfers to other Parachains. Please move your currency to AssetHub to transfer to other Parachains.');
9636
+ var scenario = input.scenario,
9637
+ destination = input.destination;
9638
+ var newOverridenAsset = {
9639
+ parents: 1,
9640
+ interior: {
9641
+ Here: null
9642
+ }
9643
+ };
9644
+ input.overriddenAsset = newOverridenAsset;
9645
+ if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
9646
+ throw new ScenarioNotSupportedError(this.chain, scenario, 'Unable to use bridge hub for transfers to other Parachains.');
9639
9647
  }
9640
9648
  var method = 'limited_teleport_assets';
9641
9649
  return transferPolkadotXcm(input, method, 'Unlimited');
@@ -9726,8 +9734,16 @@ var Collectives = /*#__PURE__*/function (_Parachain) {
9726
9734
  return _createClass(Collectives, [{
9727
9735
  key: "transferPolkadotXCM",
9728
9736
  value: function transferPolkadotXCM(input) {
9729
- var scenario = input.scenario;
9730
- if (scenario === 'ParaToPara') {
9737
+ var scenario = input.scenario,
9738
+ destination = input.destination;
9739
+ var newOverridenAsset = {
9740
+ parents: 1,
9741
+ interior: {
9742
+ Here: null
9743
+ }
9744
+ };
9745
+ input.overriddenAsset = newOverridenAsset;
9746
+ if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
9731
9747
  throw new ScenarioNotSupportedError(this.chain, scenario);
9732
9748
  }
9733
9749
  return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
@@ -9807,8 +9823,17 @@ var CoretimePolkadot = /*#__PURE__*/function (_Parachain) {
9807
9823
  key: "transferPolkadotXCM",
9808
9824
  value: function transferPolkadotXCM(input) {
9809
9825
  var scenario = input.scenario;
9810
- var method = scenario === 'ParaToPara' ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
9811
- return transferPolkadotXcm(input, method, 'Unlimited');
9826
+ var newOverridenAsset = {
9827
+ parents: 1,
9828
+ interior: {
9829
+ Here: null
9830
+ }
9831
+ };
9832
+ input.overriddenAsset = newOverridenAsset;
9833
+ if (scenario === 'ParaToPara') {
9834
+ throw new ScenarioNotSupportedError(this.chain, scenario);
9835
+ }
9836
+ return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
9812
9837
  }
9813
9838
  }, {
9814
9839
  key: "getRelayToParaOverrides",
@@ -11219,10 +11244,18 @@ var PeoplePolkadot = /*#__PURE__*/function (_Parachain) {
11219
11244
  return _createClass(PeoplePolkadot, [{
11220
11245
  key: "transferPolkadotXCM",
11221
11246
  value: function transferPolkadotXCM(input) {
11222
- var scenario = input.scenario;
11223
- if (scenario === 'ParaToPara') {
11247
+ var scenario = input.scenario,
11248
+ destination = input.destination;
11249
+ if (scenario === 'ParaToPara' && destination !== 'AssetHubPolkadot' && destination !== 'AssetHubKusama' && destination !== 'AssetHubPaseo' && destination !== 'AssetHubWestend') {
11224
11250
  throw new ScenarioNotSupportedError(this.chain, scenario);
11225
11251
  }
11252
+ var newOverridenAsset = {
11253
+ parents: 1,
11254
+ interior: {
11255
+ Here: null
11256
+ }
11257
+ };
11258
+ input.overriddenAsset = newOverridenAsset;
11226
11259
  return transferPolkadotXcm(input, 'limited_teleport_assets', 'Unlimited');
11227
11260
  }
11228
11261
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-core",
3
- "version": "11.2.1",
3
+ "version": "11.2.2",
4
4
  "description": "SDK core for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,9 +26,9 @@
26
26
  "@noble/hashes": "^1.8.0",
27
27
  "@scure/base": "^1.2.6",
28
28
  "viem": "^2.33.2",
29
- "@paraspell/pallets": "11.2.1",
30
- "@paraspell/sdk-common": "11.2.1",
31
- "@paraspell/assets": "11.2.1"
29
+ "@paraspell/assets": "11.2.2",
30
+ "@paraspell/sdk-common": "11.2.2",
31
+ "@paraspell/pallets": "11.2.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/plugin-syntax-import-attributes": "^7.27.1",