@injectivelabs/exceptions 1.16.38-alpha.3 → 1.16.38
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/cjs/exceptions/base.d.ts +81 -0
- package/dist/cjs/exceptions/base.js +179 -0
- package/dist/cjs/exceptions/exceptions/BitGetException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/BitGetException.js +31 -0
- package/dist/cjs/exceptions/exceptions/CosmosWalletException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/CosmosWalletException.js +16 -0
- package/dist/cjs/exceptions/exceptions/GeneralException.d.ts +5 -0
- package/dist/cjs/exceptions/exceptions/GeneralException.js +11 -0
- package/dist/cjs/exceptions/exceptions/GrpcUnaryRequestException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/GrpcUnaryRequestException.js +21 -0
- package/dist/cjs/exceptions/exceptions/HttpRequestException.d.ts +11 -0
- package/dist/cjs/exceptions/exceptions/HttpRequestException.js +21 -0
- package/dist/cjs/exceptions/exceptions/LedgerCosmosException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/LedgerCosmosException.js +40 -0
- package/dist/cjs/exceptions/exceptions/LedgerException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/LedgerException.js +40 -0
- package/dist/cjs/exceptions/exceptions/MetamaskException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/MetamaskException.js +31 -0
- package/dist/cjs/exceptions/exceptions/OkxWalletException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/OkxWalletException.js +31 -0
- package/dist/cjs/exceptions/exceptions/RabbyWalletException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/RabbyWalletException.js +33 -0
- package/dist/cjs/exceptions/exceptions/RainbowWalletException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/RainbowWalletException.js +31 -0
- package/dist/cjs/exceptions/exceptions/TransactionException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/TransactionException.js +34 -0
- package/dist/cjs/exceptions/exceptions/TrezorException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/TrezorException.js +16 -0
- package/dist/cjs/exceptions/exceptions/TrustWalletException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/TrustWalletException.js +33 -0
- package/dist/cjs/exceptions/exceptions/TurnkeyWalletSessionException.d.ts +5 -0
- package/dist/cjs/exceptions/exceptions/TurnkeyWalletSessionException.js +11 -0
- package/dist/cjs/exceptions/exceptions/WalletConnectException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/WalletConnectException.js +31 -0
- package/dist/cjs/exceptions/exceptions/WalletException.d.ts +5 -0
- package/dist/cjs/exceptions/exceptions/WalletException.js +11 -0
- package/dist/cjs/exceptions/exceptions/Web3Exception.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/Web3Exception.js +16 -0
- package/dist/cjs/exceptions/exceptions/index.d.ts +18 -0
- package/dist/cjs/exceptions/exceptions/index.js +37 -0
- package/dist/cjs/exceptions/index.d.ts +2 -0
- package/dist/cjs/exceptions/index.js +18 -0
- package/dist/cjs/exceptions/messages.d.ts +13 -0
- package/dist/cjs/exceptions/messages.js +1600 -0
- package/dist/cjs/exceptions/types/codes.d.ts +441 -0
- package/dist/cjs/exceptions/types/codes.js +774 -0
- package/dist/cjs/exceptions/types/context.d.ts +93 -0
- package/dist/cjs/exceptions/types/context.js +21 -0
- package/dist/cjs/exceptions/types/index.d.ts +3 -0
- package/dist/cjs/exceptions/types/index.js +19 -0
- package/dist/cjs/exceptions/types/modules.d.ts +67 -0
- package/dist/cjs/exceptions/types/modules.js +66 -0
- package/dist/cjs/exceptions/utils/grpc.d.ts +3 -0
- package/dist/cjs/exceptions/utils/grpc.js +43 -0
- package/dist/cjs/exceptions/utils/helpers.d.ts +1 -0
- package/dist/cjs/exceptions/utils/helpers.js +24 -0
- package/dist/cjs/exceptions/utils/maps.d.ts +13 -0
- package/dist/cjs/exceptions/utils/maps.js +127 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/package.json +2 -2
- package/dist/cjs/types.d.ts +2 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/utils.d.ts +8 -0
- package/dist/cjs/utils.js +49 -0
- package/dist/esm/exceptions/base.d.ts +81 -0
- package/dist/esm/exceptions/base.js +175 -0
- package/dist/esm/exceptions/exceptions/BitGetException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/BitGetException.js +27 -0
- package/dist/esm/exceptions/exceptions/CosmosWalletException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/CosmosWalletException.js +12 -0
- package/dist/esm/exceptions/exceptions/GeneralException.d.ts +5 -0
- package/dist/esm/exceptions/exceptions/GeneralException.js +7 -0
- package/dist/esm/exceptions/exceptions/GrpcUnaryRequestException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/GrpcUnaryRequestException.js +17 -0
- package/dist/esm/exceptions/exceptions/HttpRequestException.d.ts +11 -0
- package/dist/esm/exceptions/exceptions/HttpRequestException.js +17 -0
- package/dist/esm/exceptions/exceptions/LedgerCosmosException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/LedgerCosmosException.js +36 -0
- package/dist/esm/exceptions/exceptions/LedgerException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/LedgerException.js +36 -0
- package/dist/esm/exceptions/exceptions/MetamaskException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/MetamaskException.js +27 -0
- package/dist/esm/exceptions/exceptions/OkxWalletException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/OkxWalletException.js +27 -0
- package/dist/esm/exceptions/exceptions/RabbyWalletException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/RabbyWalletException.js +29 -0
- package/dist/esm/exceptions/exceptions/RainbowWalletException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/RainbowWalletException.js +27 -0
- package/dist/esm/exceptions/exceptions/TransactionException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/TransactionException.js +30 -0
- package/dist/esm/exceptions/exceptions/TrezorException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/TrezorException.js +12 -0
- package/dist/esm/exceptions/exceptions/TrustWalletException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/TrustWalletException.js +29 -0
- package/dist/esm/exceptions/exceptions/TurnkeyWalletSessionException.d.ts +5 -0
- package/dist/esm/exceptions/exceptions/TurnkeyWalletSessionException.js +7 -0
- package/dist/esm/exceptions/exceptions/WalletConnectException.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/WalletConnectException.js +27 -0
- package/dist/esm/exceptions/exceptions/WalletException.d.ts +5 -0
- package/dist/esm/exceptions/exceptions/WalletException.js +7 -0
- package/dist/esm/exceptions/exceptions/Web3Exception.d.ts +7 -0
- package/dist/esm/exceptions/exceptions/Web3Exception.js +12 -0
- package/dist/esm/exceptions/exceptions/index.d.ts +18 -0
- package/dist/esm/exceptions/exceptions/index.js +18 -0
- package/dist/esm/exceptions/index.d.ts +2 -0
- package/dist/esm/exceptions/index.js +2 -0
- package/dist/esm/exceptions/messages.d.ts +13 -0
- package/dist/esm/exceptions/messages.js +1597 -0
- package/dist/esm/exceptions/types/codes.d.ts +441 -0
- package/dist/esm/exceptions/types/codes.js +770 -0
- package/dist/esm/exceptions/types/context.d.ts +93 -0
- package/dist/esm/exceptions/types/context.js +18 -0
- package/dist/esm/exceptions/types/index.d.ts +3 -0
- package/dist/esm/exceptions/types/index.js +3 -0
- package/dist/esm/exceptions/types/modules.d.ts +67 -0
- package/dist/esm/exceptions/types/modules.js +63 -0
- package/dist/esm/exceptions/utils/grpc.d.ts +3 -0
- package/dist/esm/exceptions/utils/grpc.js +6 -0
- package/dist/esm/exceptions/utils/helpers.d.ts +1 -0
- package/dist/esm/exceptions/utils/helpers.js +20 -0
- package/dist/esm/exceptions/utils/maps.d.ts +13 -0
- package/dist/esm/exceptions/utils/maps.js +120 -0
- package/dist/esm/index.d.ts +3 -826
- package/dist/esm/index.js +2 -2712
- package/dist/esm/package.json +2 -2
- package/dist/esm/types.d.ts +2 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils.d.ts +8 -0
- package/dist/esm/utils.js +44 -0
- package/package.json +38 -37
- package/dist/cjs/index.cjs +0 -2759
- package/dist/cjs/index.d.cts +0 -826
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ConcreteException } from '../base.js';
|
|
2
|
+
import type { ErrorContext } from '../types/index.js';
|
|
3
|
+
export declare class WalletConnectException extends ConcreteException {
|
|
4
|
+
static errorClass: string;
|
|
5
|
+
constructor(error: Error, context?: ErrorContext);
|
|
6
|
+
parse(): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ErrorType } from '../types/index.js';
|
|
2
|
+
import { ConcreteException } from '../base.js';
|
|
3
|
+
import { mapErrorMessage } from '../utils/maps.js';
|
|
4
|
+
const removeWalletConnectFromErrorString = (message) => message
|
|
5
|
+
.replaceAll('WalletConnect', '')
|
|
6
|
+
.replaceAll('WalletConnect', '')
|
|
7
|
+
.replaceAll('WalletConnect:', '');
|
|
8
|
+
export class WalletConnectException extends ConcreteException {
|
|
9
|
+
static errorClass = 'WalletConnectException';
|
|
10
|
+
constructor(error, context) {
|
|
11
|
+
super(error, context);
|
|
12
|
+
this.type = ErrorType.WalletError;
|
|
13
|
+
}
|
|
14
|
+
parse() {
|
|
15
|
+
const { message } = this;
|
|
16
|
+
if (message
|
|
17
|
+
.trim()
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.includes('missing or invalid parameters'.toLowerCase())) {
|
|
20
|
+
this.setMessage('Please make sure you are using WalletConnect');
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.setMessage(mapErrorMessage(removeWalletConnectFromErrorString(message)));
|
|
24
|
+
}
|
|
25
|
+
this.setName(WalletConnectException.errorClass);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ConcreteException } from '../base.js';
|
|
2
|
+
import type { ErrorContext } from '../types/index.js';
|
|
3
|
+
export declare class Web3Exception extends ConcreteException {
|
|
4
|
+
static errorClass: string;
|
|
5
|
+
constructor(error: Error, context?: ErrorContext);
|
|
6
|
+
parse(): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ErrorType } from '../types/index.js';
|
|
2
|
+
import { ConcreteException } from '../base.js';
|
|
3
|
+
export class Web3Exception extends ConcreteException {
|
|
4
|
+
static errorClass = 'Web3Exception';
|
|
5
|
+
constructor(error, context) {
|
|
6
|
+
super(error, context);
|
|
7
|
+
this.type = ErrorType.Web3;
|
|
8
|
+
}
|
|
9
|
+
parse() {
|
|
10
|
+
this.setName(Web3Exception.errorClass);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Web3Exception } from './Web3Exception.js';
|
|
2
|
+
import { BitGetException } from './BitGetException.js';
|
|
3
|
+
import { LedgerException } from './LedgerException.js';
|
|
4
|
+
import { TrezorException } from './TrezorException.js';
|
|
5
|
+
import { WalletException } from './WalletException.js';
|
|
6
|
+
import { GeneralException } from './GeneralException.js';
|
|
7
|
+
import { MetamaskException } from './MetamaskException.js';
|
|
8
|
+
import { OkxWalletException } from './OkxWalletException.js';
|
|
9
|
+
import { HttpRequestException } from './HttpRequestException.js';
|
|
10
|
+
import { TransactionException } from './TransactionException.js';
|
|
11
|
+
import { TrustWalletException } from './TrustWalletException.js';
|
|
12
|
+
import { CosmosWalletException } from './CosmosWalletException.js';
|
|
13
|
+
import { LedgerCosmosException } from './LedgerCosmosException.js';
|
|
14
|
+
import { RainbowWalletException } from './RainbowWalletException.js';
|
|
15
|
+
import { WalletConnectException } from './WalletConnectException.js';
|
|
16
|
+
import { GrpcUnaryRequestException } from './GrpcUnaryRequestException.js';
|
|
17
|
+
import { TurnkeyWalletSessionException } from './TurnkeyWalletSessionException.js';
|
|
18
|
+
export { Web3Exception, LedgerException, TrezorException, WalletException, BitGetException, GeneralException, MetamaskException, OkxWalletException, TransactionException, TrustWalletException, HttpRequestException, LedgerCosmosException, CosmosWalletException, RainbowWalletException, WalletConnectException, GrpcUnaryRequestException, TurnkeyWalletSessionException, };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Web3Exception } from './Web3Exception.js';
|
|
2
|
+
import { BitGetException } from './BitGetException.js';
|
|
3
|
+
import { LedgerException } from './LedgerException.js';
|
|
4
|
+
import { TrezorException } from './TrezorException.js';
|
|
5
|
+
import { WalletException } from './WalletException.js';
|
|
6
|
+
import { GeneralException } from './GeneralException.js';
|
|
7
|
+
import { MetamaskException } from './MetamaskException.js';
|
|
8
|
+
import { OkxWalletException } from './OkxWalletException.js';
|
|
9
|
+
import { HttpRequestException } from './HttpRequestException.js';
|
|
10
|
+
import { TransactionException } from './TransactionException.js';
|
|
11
|
+
import { TrustWalletException } from './TrustWalletException.js';
|
|
12
|
+
import { CosmosWalletException } from './CosmosWalletException.js';
|
|
13
|
+
import { LedgerCosmosException } from './LedgerCosmosException.js';
|
|
14
|
+
import { RainbowWalletException } from './RainbowWalletException.js';
|
|
15
|
+
import { WalletConnectException } from './WalletConnectException.js';
|
|
16
|
+
import { GrpcUnaryRequestException } from './GrpcUnaryRequestException.js';
|
|
17
|
+
import { TurnkeyWalletSessionException } from './TurnkeyWalletSessionException.js';
|
|
18
|
+
export { Web3Exception, LedgerException, TrezorException, WalletException, BitGetException, GeneralException, MetamaskException, OkxWalletException, TransactionException, TrustWalletException, HttpRequestException, LedgerCosmosException, CosmosWalletException, RainbowWalletException, WalletConnectException, GrpcUnaryRequestException, TurnkeyWalletSessionException, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TransactionChainErrorModule } from './types/index.js';
|
|
2
|
+
import type { ErrorContextCode } from './types/index.js';
|
|
3
|
+
export declare const chainModuleCodeErrorMessagesMap: Record<string, Record<number, string>>;
|
|
4
|
+
/**
|
|
5
|
+
* **Legacy** but needed for error messages from broadcasting transactions
|
|
6
|
+
* where we don't control the response and only have the message
|
|
7
|
+
* i.e Keplr, Leap, etc
|
|
8
|
+
*/
|
|
9
|
+
export declare const chainErrorMessagesMap: Record<string, {
|
|
10
|
+
message: string;
|
|
11
|
+
code: ErrorContextCode;
|
|
12
|
+
module: TransactionChainErrorModule;
|
|
13
|
+
}>;
|