@injectivelabs/exceptions 1.16.38-alpha.0 → 1.16.38-alpha.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.
@@ -2517,6 +2517,23 @@ var MetamaskException = class MetamaskException extends ConcreteException {
2517
2517
  };
2518
2518
  _defineProperty(MetamaskException, "errorClass", "MetamaskException");
2519
2519
 
2520
+ //#endregion
2521
+ //#region src/exceptions/exceptions/KeplrEvmException.ts
2522
+ const removeKeplrFromErrorString = (message) => message.replaceAll("Keplr", "").replaceAll("Keplr", "").replaceAll("Keplr:", "");
2523
+ var KeplrEvmException = class KeplrEvmException extends ConcreteException {
2524
+ constructor(error, context) {
2525
+ super(error, context);
2526
+ this.type = ErrorType.WalletError;
2527
+ }
2528
+ parse() {
2529
+ const { message } = this;
2530
+ if (message.trim().toLowerCase().includes("missing or invalid parameters".toLowerCase())) this.setMessage("Please make sure you are using Keplr Wallet");
2531
+ else this.setMessage(mapErrorMessage(removeKeplrFromErrorString(message)));
2532
+ this.setName(KeplrEvmException.errorClass);
2533
+ }
2534
+ };
2535
+ _defineProperty(KeplrEvmException, "errorClass", "KeplrException");
2536
+
2520
2537
  //#endregion
2521
2538
  //#region src/exceptions/exceptions/OkxWalletException.ts
2522
2539
  const removeOkxWalletFromErrorString = (message) => message.replaceAll("OkxWallet", "").replaceAll("OkxWallet:", "").replaceAll("Okx", "");
@@ -2720,6 +2737,7 @@ exports.GrpcUnaryRequestException = GrpcUnaryRequestException;
2720
2737
  exports.HttpRequestException = HttpRequestException;
2721
2738
  exports.HttpRequestMethod = HttpRequestMethod;
2722
2739
  exports.IndexerErrorModule = IndexerErrorModule;
2740
+ exports.KeplrEvmException = KeplrEvmException;
2723
2741
  exports.LedgerCosmosException = LedgerCosmosException;
2724
2742
  exports.LedgerException = LedgerException;
2725
2743
  exports.MetamaskException = MetamaskException;
@@ -733,6 +733,13 @@ declare class MetamaskException extends ConcreteException {
733
733
  parse(): void;
734
734
  }
735
735
  //#endregion
736
+ //#region src/exceptions/exceptions/KeplrEvmException.d.ts
737
+ declare class KeplrEvmException extends ConcreteException {
738
+ static errorClass: string;
739
+ constructor(error: Error, context?: ErrorContext);
740
+ parse(): void;
741
+ }
742
+ //#endregion
736
743
  //#region src/exceptions/exceptions/OkxWalletException.d.ts
737
744
  declare class OkxWalletException extends ConcreteException {
738
745
  static errorClass: string;
@@ -806,7 +813,7 @@ declare class TurnkeyWalletSessionException extends ConcreteException {
806
813
  }
807
814
  //#endregion
808
815
  //#region src/types.d.ts
809
- type ThrownException = Web3Exception | LedgerException | TrezorException | WalletException | BitGetException | GeneralException | MetamaskException | OkxWalletException | HttpRequestException | TrustWalletException | TransactionException | CosmosWalletException | LedgerCosmosException | GrpcUnaryRequestException;
816
+ type ThrownException = Web3Exception | LedgerException | TrezorException | WalletException | BitGetException | GeneralException | KeplrEvmException | MetamaskException | OkxWalletException | HttpRequestException | TrustWalletException | TransactionException | CosmosWalletException | LedgerCosmosException | GrpcUnaryRequestException;
810
817
  //#endregion
811
818
  //#region src/utils.d.ts
812
819
  declare const THROWN_EXCEPTIONS: string[];
@@ -816,4 +823,4 @@ declare const formatNotificationDescription: (description: string) => {
816
823
  tooltip: string;
817
824
  };
818
825
  //#endregion
819
- export { BitGetException, ChainAuctionErrorCodes, ChainAuthZErrorCodes, ChainBankErrorCodes, ChainCosmosErrorCode, ChainDistributionErrorCodes, ChainErrorModule, ChainExchangeModuleErrorCode, ChainGovErrorCodes, ChainInsuranceErrorCodes, ChainOcrErrorCodes, ChainOracleErrorCodes, ChainPeggyErrorCodes, ChainStakingErrorCodes, ChainTokenFactoryErrorCodes, ChainWasmErrorCodes, ChainWasmXErrorCodes, ContractErrorModule, CosmosWalletException, ErrorCode, ErrorContext, ErrorContextCode, ErrorType, Exception, GRPC_REQUEST_FAILED, GeneralException, GrpcErrorCode, GrpcUnaryRequestException, HttpRequestException, HttpRequestMethod, IndexerApiErrorCode, IndexerErrorModule, LedgerCosmosException, LedgerException, MetamaskException, OkxWalletException, RainbowWalletException, THROWN_EXCEPTIONS, ThrownException, TransactionChainErrorModule, TransactionException, TrezorException, TrustWalletException, TurnkeyWalletSessionException, UnspecifiedErrorCode, WalletConnectException, WalletErrorActionModule, WalletException, Web3Exception, formatNotificationDescription, grpcErrorCodeToErrorCode, isThrownException };
826
+ export { BitGetException, ChainAuctionErrorCodes, ChainAuthZErrorCodes, ChainBankErrorCodes, ChainCosmosErrorCode, ChainDistributionErrorCodes, ChainErrorModule, ChainExchangeModuleErrorCode, ChainGovErrorCodes, ChainInsuranceErrorCodes, ChainOcrErrorCodes, ChainOracleErrorCodes, ChainPeggyErrorCodes, ChainStakingErrorCodes, ChainTokenFactoryErrorCodes, ChainWasmErrorCodes, ChainWasmXErrorCodes, ContractErrorModule, CosmosWalletException, ErrorCode, ErrorContext, ErrorContextCode, ErrorType, Exception, GRPC_REQUEST_FAILED, GeneralException, GrpcErrorCode, GrpcUnaryRequestException, HttpRequestException, HttpRequestMethod, IndexerApiErrorCode, IndexerErrorModule, KeplrEvmException, LedgerCosmosException, LedgerException, MetamaskException, OkxWalletException, RainbowWalletException, THROWN_EXCEPTIONS, ThrownException, TransactionChainErrorModule, TransactionException, TrezorException, TrustWalletException, TurnkeyWalletSessionException, UnspecifiedErrorCode, WalletConnectException, WalletErrorActionModule, WalletException, Web3Exception, formatNotificationDescription, grpcErrorCodeToErrorCode, isThrownException };
@@ -733,6 +733,13 @@ declare class MetamaskException extends ConcreteException {
733
733
  parse(): void;
734
734
  }
735
735
  //#endregion
736
+ //#region src/exceptions/exceptions/KeplrEvmException.d.ts
737
+ declare class KeplrEvmException extends ConcreteException {
738
+ static errorClass: string;
739
+ constructor(error: Error, context?: ErrorContext);
740
+ parse(): void;
741
+ }
742
+ //#endregion
736
743
  //#region src/exceptions/exceptions/OkxWalletException.d.ts
737
744
  declare class OkxWalletException extends ConcreteException {
738
745
  static errorClass: string;
@@ -806,7 +813,7 @@ declare class TurnkeyWalletSessionException extends ConcreteException {
806
813
  }
807
814
  //#endregion
808
815
  //#region src/types.d.ts
809
- type ThrownException = Web3Exception | LedgerException | TrezorException | WalletException | BitGetException | GeneralException | MetamaskException | OkxWalletException | HttpRequestException | TrustWalletException | TransactionException | CosmosWalletException | LedgerCosmosException | GrpcUnaryRequestException;
816
+ type ThrownException = Web3Exception | LedgerException | TrezorException | WalletException | BitGetException | GeneralException | KeplrEvmException | MetamaskException | OkxWalletException | HttpRequestException | TrustWalletException | TransactionException | CosmosWalletException | LedgerCosmosException | GrpcUnaryRequestException;
810
817
  //#endregion
811
818
  //#region src/utils.d.ts
812
819
  declare const THROWN_EXCEPTIONS: string[];
@@ -816,4 +823,4 @@ declare const formatNotificationDescription: (description: string) => {
816
823
  tooltip: string;
817
824
  };
818
825
  //#endregion
819
- export { BitGetException, ChainAuctionErrorCodes, ChainAuthZErrorCodes, ChainBankErrorCodes, ChainCosmosErrorCode, ChainDistributionErrorCodes, ChainErrorModule, ChainExchangeModuleErrorCode, ChainGovErrorCodes, ChainInsuranceErrorCodes, ChainOcrErrorCodes, ChainOracleErrorCodes, ChainPeggyErrorCodes, ChainStakingErrorCodes, ChainTokenFactoryErrorCodes, ChainWasmErrorCodes, ChainWasmXErrorCodes, ContractErrorModule, CosmosWalletException, ErrorCode, ErrorContext, ErrorContextCode, ErrorType, Exception, GRPC_REQUEST_FAILED, GeneralException, GrpcErrorCode, GrpcUnaryRequestException, HttpRequestException, HttpRequestMethod, IndexerApiErrorCode, IndexerErrorModule, LedgerCosmosException, LedgerException, MetamaskException, OkxWalletException, RainbowWalletException, THROWN_EXCEPTIONS, ThrownException, TransactionChainErrorModule, TransactionException, TrezorException, TrustWalletException, TurnkeyWalletSessionException, UnspecifiedErrorCode, WalletConnectException, WalletErrorActionModule, WalletException, Web3Exception, formatNotificationDescription, grpcErrorCodeToErrorCode, isThrownException };
826
+ export { BitGetException, ChainAuctionErrorCodes, ChainAuthZErrorCodes, ChainBankErrorCodes, ChainCosmosErrorCode, ChainDistributionErrorCodes, ChainErrorModule, ChainExchangeModuleErrorCode, ChainGovErrorCodes, ChainInsuranceErrorCodes, ChainOcrErrorCodes, ChainOracleErrorCodes, ChainPeggyErrorCodes, ChainStakingErrorCodes, ChainTokenFactoryErrorCodes, ChainWasmErrorCodes, ChainWasmXErrorCodes, ContractErrorModule, CosmosWalletException, ErrorCode, ErrorContext, ErrorContextCode, ErrorType, Exception, GRPC_REQUEST_FAILED, GeneralException, GrpcErrorCode, GrpcUnaryRequestException, HttpRequestException, HttpRequestMethod, IndexerApiErrorCode, IndexerErrorModule, KeplrEvmException, LedgerCosmosException, LedgerException, MetamaskException, OkxWalletException, RainbowWalletException, THROWN_EXCEPTIONS, ThrownException, TransactionChainErrorModule, TransactionException, TrezorException, TrustWalletException, TurnkeyWalletSessionException, UnspecifiedErrorCode, WalletConnectException, WalletErrorActionModule, WalletException, Web3Exception, formatNotificationDescription, grpcErrorCodeToErrorCode, isThrownException };
package/dist/esm/index.js CHANGED
@@ -2516,6 +2516,23 @@ var MetamaskException = class MetamaskException extends ConcreteException {
2516
2516
  };
2517
2517
  _defineProperty(MetamaskException, "errorClass", "MetamaskException");
2518
2518
 
2519
+ //#endregion
2520
+ //#region src/exceptions/exceptions/KeplrEvmException.ts
2521
+ const removeKeplrFromErrorString = (message) => message.replaceAll("Keplr", "").replaceAll("Keplr", "").replaceAll("Keplr:", "");
2522
+ var KeplrEvmException = class KeplrEvmException extends ConcreteException {
2523
+ constructor(error, context) {
2524
+ super(error, context);
2525
+ this.type = ErrorType.WalletError;
2526
+ }
2527
+ parse() {
2528
+ const { message } = this;
2529
+ if (message.trim().toLowerCase().includes("missing or invalid parameters".toLowerCase())) this.setMessage("Please make sure you are using Keplr Wallet");
2530
+ else this.setMessage(mapErrorMessage(removeKeplrFromErrorString(message)));
2531
+ this.setName(KeplrEvmException.errorClass);
2532
+ }
2533
+ };
2534
+ _defineProperty(KeplrEvmException, "errorClass", "KeplrException");
2535
+
2519
2536
  //#endregion
2520
2537
  //#region src/exceptions/exceptions/OkxWalletException.ts
2521
2538
  const removeOkxWalletFromErrorString = (message) => message.replaceAll("OkxWallet", "").replaceAll("OkxWallet:", "").replaceAll("Okx", "");
@@ -2692,4 +2709,4 @@ var TurnkeyWalletSessionException = class TurnkeyWalletSessionException extends
2692
2709
  _defineProperty(TurnkeyWalletSessionException, "errorClass", "TurnkeyWalletSessionException");
2693
2710
 
2694
2711
  //#endregion
2695
- export { BitGetException, ChainAuctionErrorCodes, ChainAuthZErrorCodes, ChainBankErrorCodes, ChainCosmosErrorCode, ChainDistributionErrorCodes, ChainErrorModule, ChainExchangeModuleErrorCode, ChainGovErrorCodes, ChainInsuranceErrorCodes, ChainOcrErrorCodes, ChainOracleErrorCodes, ChainPeggyErrorCodes, ChainStakingErrorCodes, ChainTokenFactoryErrorCodes, ChainWasmErrorCodes, ChainWasmXErrorCodes, ContractErrorModule, CosmosWalletException, ErrorType, GRPC_REQUEST_FAILED, GeneralException, GrpcErrorCode, GrpcUnaryRequestException, HttpRequestException, HttpRequestMethod, IndexerErrorModule, LedgerCosmosException, LedgerException, MetamaskException, OkxWalletException, RainbowWalletException, THROWN_EXCEPTIONS, TransactionChainErrorModule, TransactionException, TrezorException, TrustWalletException, TurnkeyWalletSessionException, UnspecifiedErrorCode, WalletConnectException, WalletErrorActionModule, WalletException, Web3Exception, formatNotificationDescription, grpcErrorCodeToErrorCode, isThrownException };
2712
+ export { BitGetException, ChainAuctionErrorCodes, ChainAuthZErrorCodes, ChainBankErrorCodes, ChainCosmosErrorCode, ChainDistributionErrorCodes, ChainErrorModule, ChainExchangeModuleErrorCode, ChainGovErrorCodes, ChainInsuranceErrorCodes, ChainOcrErrorCodes, ChainOracleErrorCodes, ChainPeggyErrorCodes, ChainStakingErrorCodes, ChainTokenFactoryErrorCodes, ChainWasmErrorCodes, ChainWasmXErrorCodes, ContractErrorModule, CosmosWalletException, ErrorType, GRPC_REQUEST_FAILED, GeneralException, GrpcErrorCode, GrpcUnaryRequestException, HttpRequestException, HttpRequestMethod, IndexerErrorModule, KeplrEvmException, LedgerCosmosException, LedgerException, MetamaskException, OkxWalletException, RainbowWalletException, THROWN_EXCEPTIONS, TransactionChainErrorModule, TransactionException, TrezorException, TrustWalletException, TurnkeyWalletSessionException, UnspecifiedErrorCode, WalletConnectException, WalletErrorActionModule, WalletException, Web3Exception, formatNotificationDescription, grpcErrorCodeToErrorCode, isThrownException };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@injectivelabs/exceptions",
3
- "version": "1.16.38-alpha.0",
3
+ "version": "1.16.38-alpha.2",
4
4
  "description": "List of exceptions that can be reused throughout Injective's projects.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,6 +37,15 @@
37
37
  "files": [
38
38
  "dist"
39
39
  ],
40
+ "dependencies": {
41
+ "http-status-codes": "^2.3.0"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "_moduleAliases": {
47
+ "~exceptions": "dist"
48
+ },
40
49
  "scripts": {
41
50
  "build": "pnpm type-check && tsdown",
42
51
  "build:fast": "tsdown",
@@ -51,15 +60,5 @@
51
60
  "dev": "ts-node -r tsconfig-paths/register src/index.ts",
52
61
  "start": "node dist/index.js",
53
62
  "lint": "eslint . --ext .ts,.js"
54
- },
55
- "dependencies": {
56
- "http-status-codes": "catalog:"
57
- },
58
- "publishConfig": {
59
- "access": "public"
60
- },
61
- "_moduleAliases": {
62
- "~exceptions": "dist"
63
- },
64
- "gitHead": "35da21add71ed443fad349d811cf9458043baee7"
65
- }
63
+ }
64
+ }