@injectivelabs/exceptions 1.16.19 → 1.16.21
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/exceptions/WalletConnectException.d.ts +7 -0
- package/dist/cjs/exceptions/exceptions/WalletConnectException.js +31 -0
- package/dist/cjs/exceptions/exceptions/index.d.ts +2 -1
- package/dist/cjs/exceptions/exceptions/index.js +3 -1
- package/dist/cjs/types.d.ts +2 -2
- package/dist/cjs/utils.js +1 -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/index.d.ts +2 -1
- package/dist/esm/exceptions/exceptions/index.js +2 -1
- package/dist/esm/types.d.ts +2 -2
- package/dist/esm/utils.js +1 -0
- package/package.json +2 -2
|
@@ -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,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalletConnectException = void 0;
|
|
4
|
+
const index_js_1 = require("../types/index.js");
|
|
5
|
+
const base_js_1 = require("../base.js");
|
|
6
|
+
const maps_js_1 = require("../utils/maps.js");
|
|
7
|
+
const removeWalletConnectFromErrorString = (message) => message
|
|
8
|
+
.replaceAll('WalletConnect', '')
|
|
9
|
+
.replaceAll('WalletConnect', '')
|
|
10
|
+
.replaceAll('WalletConnect:', '');
|
|
11
|
+
class WalletConnectException extends base_js_1.ConcreteException {
|
|
12
|
+
static errorClass = 'WalletConnectException';
|
|
13
|
+
constructor(error, context) {
|
|
14
|
+
super(error, context);
|
|
15
|
+
this.type = index_js_1.ErrorType.WalletError;
|
|
16
|
+
}
|
|
17
|
+
parse() {
|
|
18
|
+
const { message } = this;
|
|
19
|
+
if (message
|
|
20
|
+
.trim()
|
|
21
|
+
.toLowerCase()
|
|
22
|
+
.includes('missing or invalid parameters'.toLowerCase())) {
|
|
23
|
+
this.setMessage('Please make sure you are using WalletConnect');
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.setMessage((0, maps_js_1.mapErrorMessage)(removeWalletConnectFromErrorString(message)));
|
|
27
|
+
}
|
|
28
|
+
this.setName(WalletConnectException.errorClass);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.WalletConnectException = WalletConnectException;
|
|
@@ -12,6 +12,7 @@ import { TrustWalletException } from './TrustWalletException.js';
|
|
|
12
12
|
import { CosmosWalletException } from './CosmosWalletException.js';
|
|
13
13
|
import { LedgerCosmosException } from './LedgerCosmosException.js';
|
|
14
14
|
import { RainbowWalletException } from './RainbowWalletException.js';
|
|
15
|
+
import { WalletConnectException } from './WalletConnectException.js';
|
|
15
16
|
import { GrpcUnaryRequestException } from './GrpcUnaryRequestException.js';
|
|
16
17
|
import { TurnkeyWalletSessionException } from './TurnkeyWalletSessionException.js';
|
|
17
|
-
export { Web3Exception, LedgerException, TrezorException, WalletException, BitGetException, GeneralException, MetamaskException, OkxWalletException, TransactionException, TrustWalletException, HttpRequestException, LedgerCosmosException, CosmosWalletException, RainbowWalletException, GrpcUnaryRequestException, TurnkeyWalletSessionException, };
|
|
18
|
+
export { Web3Exception, LedgerException, TrezorException, WalletException, BitGetException, GeneralException, MetamaskException, OkxWalletException, TransactionException, TrustWalletException, HttpRequestException, LedgerCosmosException, CosmosWalletException, RainbowWalletException, WalletConnectException, GrpcUnaryRequestException, TurnkeyWalletSessionException, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TurnkeyWalletSessionException = exports.GrpcUnaryRequestException = exports.RainbowWalletException = exports.CosmosWalletException = exports.LedgerCosmosException = exports.HttpRequestException = exports.TrustWalletException = exports.TransactionException = exports.OkxWalletException = exports.MetamaskException = exports.GeneralException = exports.BitGetException = exports.WalletException = exports.TrezorException = exports.LedgerException = exports.Web3Exception = void 0;
|
|
3
|
+
exports.TurnkeyWalletSessionException = exports.GrpcUnaryRequestException = exports.WalletConnectException = exports.RainbowWalletException = exports.CosmosWalletException = exports.LedgerCosmosException = exports.HttpRequestException = exports.TrustWalletException = exports.TransactionException = exports.OkxWalletException = exports.MetamaskException = exports.GeneralException = exports.BitGetException = exports.WalletException = exports.TrezorException = exports.LedgerException = exports.Web3Exception = void 0;
|
|
4
4
|
const Web3Exception_js_1 = require("./Web3Exception.js");
|
|
5
5
|
Object.defineProperty(exports, "Web3Exception", { enumerable: true, get: function () { return Web3Exception_js_1.Web3Exception; } });
|
|
6
6
|
const BitGetException_js_1 = require("./BitGetException.js");
|
|
@@ -29,6 +29,8 @@ const LedgerCosmosException_js_1 = require("./LedgerCosmosException.js");
|
|
|
29
29
|
Object.defineProperty(exports, "LedgerCosmosException", { enumerable: true, get: function () { return LedgerCosmosException_js_1.LedgerCosmosException; } });
|
|
30
30
|
const RainbowWalletException_js_1 = require("./RainbowWalletException.js");
|
|
31
31
|
Object.defineProperty(exports, "RainbowWalletException", { enumerable: true, get: function () { return RainbowWalletException_js_1.RainbowWalletException; } });
|
|
32
|
+
const WalletConnectException_js_1 = require("./WalletConnectException.js");
|
|
33
|
+
Object.defineProperty(exports, "WalletConnectException", { enumerable: true, get: function () { return WalletConnectException_js_1.WalletConnectException; } });
|
|
32
34
|
const GrpcUnaryRequestException_js_1 = require("./GrpcUnaryRequestException.js");
|
|
33
35
|
Object.defineProperty(exports, "GrpcUnaryRequestException", { enumerable: true, get: function () { return GrpcUnaryRequestException_js_1.GrpcUnaryRequestException; } });
|
|
34
36
|
const TurnkeyWalletSessionException_js_1 = require("./TurnkeyWalletSessionException.js");
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Web3Exception, WalletException, TrezorException, BitGetException, LedgerException, GeneralException, MetamaskException, OkxWalletException, HttpRequestException,
|
|
2
|
-
export type ThrownException =
|
|
1
|
+
import type { Web3Exception, WalletException, TrezorException, BitGetException, LedgerException, GeneralException, MetamaskException, OkxWalletException, HttpRequestException, TrustWalletException, TransactionException, LedgerCosmosException, CosmosWalletException, GrpcUnaryRequestException } from './exceptions/exceptions/index.js';
|
|
2
|
+
export type ThrownException = Web3Exception | LedgerException | TrezorException | WalletException | BitGetException | GeneralException | MetamaskException | OkxWalletException | HttpRequestException | TrustWalletException | TransactionException | CosmosWalletException | LedgerCosmosException | GrpcUnaryRequestException;
|
package/dist/cjs/utils.js
CHANGED
|
@@ -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
|
+
}
|
|
@@ -12,6 +12,7 @@ import { TrustWalletException } from './TrustWalletException.js';
|
|
|
12
12
|
import { CosmosWalletException } from './CosmosWalletException.js';
|
|
13
13
|
import { LedgerCosmosException } from './LedgerCosmosException.js';
|
|
14
14
|
import { RainbowWalletException } from './RainbowWalletException.js';
|
|
15
|
+
import { WalletConnectException } from './WalletConnectException.js';
|
|
15
16
|
import { GrpcUnaryRequestException } from './GrpcUnaryRequestException.js';
|
|
16
17
|
import { TurnkeyWalletSessionException } from './TurnkeyWalletSessionException.js';
|
|
17
|
-
export { Web3Exception, LedgerException, TrezorException, WalletException, BitGetException, GeneralException, MetamaskException, OkxWalletException, TransactionException, TrustWalletException, HttpRequestException, LedgerCosmosException, CosmosWalletException, RainbowWalletException, GrpcUnaryRequestException, TurnkeyWalletSessionException, };
|
|
18
|
+
export { Web3Exception, LedgerException, TrezorException, WalletException, BitGetException, GeneralException, MetamaskException, OkxWalletException, TransactionException, TrustWalletException, HttpRequestException, LedgerCosmosException, CosmosWalletException, RainbowWalletException, WalletConnectException, GrpcUnaryRequestException, TurnkeyWalletSessionException, };
|
|
@@ -12,6 +12,7 @@ import { TrustWalletException } from './TrustWalletException.js';
|
|
|
12
12
|
import { CosmosWalletException } from './CosmosWalletException.js';
|
|
13
13
|
import { LedgerCosmosException } from './LedgerCosmosException.js';
|
|
14
14
|
import { RainbowWalletException } from './RainbowWalletException.js';
|
|
15
|
+
import { WalletConnectException } from './WalletConnectException.js';
|
|
15
16
|
import { GrpcUnaryRequestException } from './GrpcUnaryRequestException.js';
|
|
16
17
|
import { TurnkeyWalletSessionException } from './TurnkeyWalletSessionException.js';
|
|
17
|
-
export { Web3Exception, LedgerException, TrezorException, WalletException, BitGetException, GeneralException, MetamaskException, OkxWalletException, TransactionException, TrustWalletException, HttpRequestException, LedgerCosmosException, CosmosWalletException, RainbowWalletException, GrpcUnaryRequestException, TurnkeyWalletSessionException, };
|
|
18
|
+
export { Web3Exception, LedgerException, TrezorException, WalletException, BitGetException, GeneralException, MetamaskException, OkxWalletException, TransactionException, TrustWalletException, HttpRequestException, LedgerCosmosException, CosmosWalletException, RainbowWalletException, WalletConnectException, GrpcUnaryRequestException, TurnkeyWalletSessionException, };
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Web3Exception, WalletException, TrezorException, BitGetException, LedgerException, GeneralException, MetamaskException, OkxWalletException, HttpRequestException,
|
|
2
|
-
export type ThrownException =
|
|
1
|
+
import type { Web3Exception, WalletException, TrezorException, BitGetException, LedgerException, GeneralException, MetamaskException, OkxWalletException, HttpRequestException, TrustWalletException, TransactionException, LedgerCosmosException, CosmosWalletException, GrpcUnaryRequestException } from './exceptions/exceptions/index.js';
|
|
2
|
+
export type ThrownException = Web3Exception | LedgerException | TrezorException | WalletException | BitGetException | GeneralException | MetamaskException | OkxWalletException | HttpRequestException | TrustWalletException | TransactionException | CosmosWalletException | LedgerCosmosException | GrpcUnaryRequestException;
|
package/dist/esm/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/exceptions",
|
|
3
3
|
"description": "List of exceptions that can be reused throughout Injective's projects.",
|
|
4
|
-
"version": "1.16.
|
|
4
|
+
"version": "1.16.21",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"shx": "^0.3.4"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "2fdbd5466bdc50900f6dd7eca82ac8d2e1145992"
|
|
65
65
|
}
|