@paraspell/sdk-core 11.3.1 → 11.3.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
@@ -8367,6 +8367,7 @@ var Parachain = /*#__PURE__*/function () {
8367
8367
  }
8368
8368
  return _context.a(2, this.transferLocal(sendOptions));
8369
8369
  case 2:
8370
+ this.throwIfTempDisabled(sendOptions, destChain);
8370
8371
  isRelayAsset = sdkCommon.deepEqual(asset.location, RELAY_LOCATION);
8371
8372
  _context.n = 3;
8372
8373
  return api.hasMethod('PolkadotXcm', 'transfer_assets_using_type_and_then');
@@ -8501,6 +8502,28 @@ var Parachain = /*#__PURE__*/function () {
8501
8502
  }
8502
8503
  return transfer;
8503
8504
  }()
8505
+ }, {
8506
+ key: "throwIfTempDisabled",
8507
+ value: function throwIfTempDisabled(options, destChain) {
8508
+ var isSendingDisabled = this.isSendingTempDisabled(options);
8509
+ if (isSendingDisabled) {
8510
+ throw new InvalidParameterError("Sending from ".concat(this.chain, " is temporarily disabled"));
8511
+ }
8512
+ var isReceivingDisabled = destChain && !sdkCommon.isRelayChain(destChain) && !sdkCommon.isExternalChain(destChain) && getChain(destChain).isReceivingTempDisabled(options);
8513
+ if (isReceivingDisabled) {
8514
+ throw new InvalidParameterError("Receiving on ".concat(destChain, " is temporarily disabled"));
8515
+ }
8516
+ }
8517
+ }, {
8518
+ key: "isSendingTempDisabled",
8519
+ value: function isSendingTempDisabled(_options) {
8520
+ return false;
8521
+ }
8522
+ }, {
8523
+ key: "isReceivingTempDisabled",
8524
+ value: function isReceivingTempDisabled(_options) {
8525
+ return false;
8526
+ }
8504
8527
  }, {
8505
8528
  key: "shouldUseNativeAssetTeleport",
8506
8529
  value: function shouldUseNativeAssetTeleport(_ref) {
@@ -8890,6 +8913,16 @@ var Ajuna = /*#__PURE__*/function (_Parachain) {
8890
8913
  value: function transferRelayToPara() {
8891
8914
  throw new ChainNotSupportedError();
8892
8915
  }
8916
+ }, {
8917
+ key: "isSendingTempDisabled",
8918
+ value: function isSendingTempDisabled(_options) {
8919
+ return true;
8920
+ }
8921
+ }, {
8922
+ key: "isReceivingTempDisabled",
8923
+ value: function isReceivingTempDisabled(_options) {
8924
+ return true;
8925
+ }
8893
8926
  }, {
8894
8927
  key: "transferLocalNonNativeAsset",
8895
8928
  value: function transferLocalNonNativeAsset(options) {
package/dist/index.d.ts CHANGED
@@ -1443,6 +1443,9 @@ declare abstract class Parachain<TApi, TRes> {
1443
1443
  get version(): Version;
1444
1444
  canUseXTokens(options: TSendInternalOptions<TApi, TRes>): boolean;
1445
1445
  transfer(sendOptions: TSendInternalOptions<TApi, TRes>): Promise<TRes>;
1446
+ throwIfTempDisabled(options: TSendInternalOptions<TApi, TRes>, destChain?: TChain): void;
1447
+ isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
1448
+ isReceivingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
1446
1449
  shouldUseNativeAssetTeleport({ assetInfo: asset, to }: TSendInternalOptions<TApi, TRes>): boolean;
1447
1450
  getRelayToParaOverrides(): TRelayToParaOverrides;
1448
1451
  transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): Promise<TSerializedApiCall>;
@@ -1468,6 +1471,8 @@ declare class Ajuna<TApi, TRes> extends Parachain<TApi, TRes> implements IXToken
1468
1471
  transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
1469
1472
  canUseXTokens({ assetInfo, to: destination }: TSendInternalOptions<TApi, TRes>): boolean;
1470
1473
  transferRelayToPara(): Promise<TSerializedApiCall>;
1474
+ isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
1475
+ isReceivingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
1471
1476
  transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
1472
1477
  }
1473
1478
 
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { base58 } from '@scure/base';
5
5
  import { isAddress, parseUnits, createPublicClient, http, getContract, pad, toHex, getAddress, concat, keccak256 } from 'viem';
6
6
  import { getSupportedPalletsDetails, getDefaultPallet, getNativeAssetsPallet, getOtherAssetsPallets, getSupportedPallets } from '@paraspell/pallets';
7
7
  export * from '@paraspell/pallets';
8
- import { replaceBigInt, isTLocation, Version, hasJunction, getJunctionValue, isRelayChain, Parents, PARACHAINS, deepEqual, isTrustedChain, isDotKsmBridge } from '@paraspell/sdk-common';
8
+ import { replaceBigInt, isTLocation, Version, hasJunction, getJunctionValue, isRelayChain, Parents, PARACHAINS, deepEqual, isTrustedChain, isDotKsmBridge, isExternalChain } from '@paraspell/sdk-common';
9
9
  export * from '@paraspell/sdk-common';
10
10
  import { moonbeam, moonriver, mainnet } from 'viem/chains';
11
11
 
@@ -8368,6 +8368,7 @@ var Parachain = /*#__PURE__*/function () {
8368
8368
  }
8369
8369
  return _context.a(2, this.transferLocal(sendOptions));
8370
8370
  case 2:
8371
+ this.throwIfTempDisabled(sendOptions, destChain);
8371
8372
  isRelayAsset = deepEqual(asset.location, RELAY_LOCATION);
8372
8373
  _context.n = 3;
8373
8374
  return api.hasMethod('PolkadotXcm', 'transfer_assets_using_type_and_then');
@@ -8502,6 +8503,28 @@ var Parachain = /*#__PURE__*/function () {
8502
8503
  }
8503
8504
  return transfer;
8504
8505
  }()
8506
+ }, {
8507
+ key: "throwIfTempDisabled",
8508
+ value: function throwIfTempDisabled(options, destChain) {
8509
+ var isSendingDisabled = this.isSendingTempDisabled(options);
8510
+ if (isSendingDisabled) {
8511
+ throw new InvalidParameterError("Sending from ".concat(this.chain, " is temporarily disabled"));
8512
+ }
8513
+ var isReceivingDisabled = destChain && !isRelayChain(destChain) && !isExternalChain(destChain) && getChain(destChain).isReceivingTempDisabled(options);
8514
+ if (isReceivingDisabled) {
8515
+ throw new InvalidParameterError("Receiving on ".concat(destChain, " is temporarily disabled"));
8516
+ }
8517
+ }
8518
+ }, {
8519
+ key: "isSendingTempDisabled",
8520
+ value: function isSendingTempDisabled(_options) {
8521
+ return false;
8522
+ }
8523
+ }, {
8524
+ key: "isReceivingTempDisabled",
8525
+ value: function isReceivingTempDisabled(_options) {
8526
+ return false;
8527
+ }
8505
8528
  }, {
8506
8529
  key: "shouldUseNativeAssetTeleport",
8507
8530
  value: function shouldUseNativeAssetTeleport(_ref) {
@@ -8891,6 +8914,16 @@ var Ajuna = /*#__PURE__*/function (_Parachain) {
8891
8914
  value: function transferRelayToPara() {
8892
8915
  throw new ChainNotSupportedError();
8893
8916
  }
8917
+ }, {
8918
+ key: "isSendingTempDisabled",
8919
+ value: function isSendingTempDisabled(_options) {
8920
+ return true;
8921
+ }
8922
+ }, {
8923
+ key: "isReceivingTempDisabled",
8924
+ value: function isReceivingTempDisabled(_options) {
8925
+ return true;
8926
+ }
8894
8927
  }, {
8895
8928
  key: "transferLocalNonNativeAsset",
8896
8929
  value: function transferLocalNonNativeAsset(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk-core",
3
- "version": "11.3.1",
3
+ "version": "11.3.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": "^2.0.0",
28
28
  "viem": "^2.36.0",
29
- "@paraspell/pallets": "11.3.1",
30
- "@paraspell/assets": "11.3.1",
31
- "@paraspell/sdk-common": "11.3.1"
29
+ "@paraspell/assets": "11.3.2",
30
+ "@paraspell/pallets": "11.3.2",
31
+ "@paraspell/sdk-common": "11.3.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/plugin-syntax-import-attributes": "^7.27.1",