@injectivelabs/exceptions 1.0.13 → 1.0.15

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.
Files changed (93) hide show
  1. package/dist/exception.d.ts +53 -0
  2. package/dist/exception.d.ts.map +1 -0
  3. package/dist/exception.js +101 -0
  4. package/dist/exception.js.map +1 -0
  5. package/dist/exceptions/CosmosWalletException.d.ts +6 -0
  6. package/dist/exceptions/CosmosWalletException.d.ts.map +1 -0
  7. package/dist/exceptions/CosmosWalletException.js +13 -0
  8. package/dist/exceptions/CosmosWalletException.js.map +1 -0
  9. package/dist/exceptions/GeneralException.d.ts +4 -0
  10. package/dist/exceptions/GeneralException.d.ts.map +1 -0
  11. package/dist/exceptions/GeneralException.js +8 -0
  12. package/dist/exceptions/GeneralException.js.map +1 -0
  13. package/dist/exceptions/GrpcUnaryRequestException.d.ts +6 -0
  14. package/dist/exceptions/GrpcUnaryRequestException.d.ts.map +1 -0
  15. package/dist/exceptions/GrpcUnaryRequestException.js +13 -0
  16. package/dist/exceptions/GrpcUnaryRequestException.js.map +1 -0
  17. package/dist/exceptions/HttpRequestException.d.ts +9 -0
  18. package/dist/exceptions/HttpRequestException.d.ts.map +1 -0
  19. package/dist/exceptions/HttpRequestException.js +17 -0
  20. package/dist/exceptions/HttpRequestException.js.map +1 -0
  21. package/dist/exceptions/LedgerException.d.ts +7 -0
  22. package/dist/exceptions/LedgerException.d.ts.map +1 -0
  23. package/dist/exceptions/LedgerException.js +26 -0
  24. package/dist/exceptions/LedgerException.js.map +1 -0
  25. package/dist/exceptions/MetamaskException.d.ts +7 -0
  26. package/dist/exceptions/MetamaskException.d.ts.map +1 -0
  27. package/dist/exceptions/MetamaskException.js +21 -0
  28. package/dist/exceptions/MetamaskException.js.map +1 -0
  29. package/dist/exceptions/TransactionException.d.ts +11 -0
  30. package/dist/exceptions/TransactionException.d.ts.map +1 -0
  31. package/dist/exceptions/TransactionException.js +38 -0
  32. package/dist/exceptions/TransactionException.js.map +1 -0
  33. package/dist/exceptions/TrezorException.d.ts +6 -0
  34. package/dist/exceptions/TrezorException.d.ts.map +1 -0
  35. package/dist/exceptions/TrezorException.js +13 -0
  36. package/dist/exceptions/TrezorException.js.map +1 -0
  37. package/dist/exceptions/WalletException.d.ts +4 -0
  38. package/dist/exceptions/WalletException.d.ts.map +1 -0
  39. package/dist/exceptions/WalletException.js +8 -0
  40. package/dist/exceptions/WalletException.js.map +1 -0
  41. package/dist/exceptions/Web3Exception.d.ts +6 -0
  42. package/dist/exceptions/Web3Exception.d.ts.map +1 -0
  43. package/dist/exceptions/Web3Exception.js +13 -0
  44. package/dist/exceptions/Web3Exception.js.map +1 -0
  45. package/dist/exceptions/index.d.ts +15 -0
  46. package/dist/exceptions/index.d.ts.map +1 -0
  47. package/dist/exceptions/index.js +46 -0
  48. package/dist/exceptions/index.js.map +1 -0
  49. package/dist/index.d.ts +3 -7
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +3 -7
  52. package/dist/index.js.map +1 -1
  53. package/dist/types/codes.d.ts +135 -0
  54. package/dist/types/codes.d.ts.map +1 -0
  55. package/dist/types/codes.js +259 -0
  56. package/dist/types/codes.js.map +1 -0
  57. package/dist/types/index.d.ts +80 -0
  58. package/dist/types/index.d.ts.map +1 -0
  59. package/dist/types/index.js +39 -0
  60. package/dist/types/index.js.map +1 -0
  61. package/dist/types/modules.d.ts +47 -0
  62. package/dist/types/modules.d.ts.map +1 -0
  63. package/dist/types/modules.js +54 -0
  64. package/dist/types/modules.js.map +1 -0
  65. package/package.json +5 -3
  66. package/dist/block-not-found.d.ts +0 -3
  67. package/dist/block-not-found.d.ts.map +0 -1
  68. package/dist/block-not-found.js +0 -7
  69. package/dist/block-not-found.js.map +0 -1
  70. package/dist/contract.d.ts +0 -3
  71. package/dist/contract.d.ts.map +0 -1
  72. package/dist/contract.js +0 -7
  73. package/dist/contract.js.map +0 -1
  74. package/dist/exchange.d.ts +0 -3
  75. package/dist/exchange.d.ts.map +0 -1
  76. package/dist/exchange.js +0 -7
  77. package/dist/exchange.js.map +0 -1
  78. package/dist/grpc.d.ts +0 -3
  79. package/dist/grpc.d.ts.map +0 -1
  80. package/dist/grpc.js +0 -7
  81. package/dist/grpc.js.map +0 -1
  82. package/dist/http.d.ts +0 -3
  83. package/dist/http.d.ts.map +0 -1
  84. package/dist/http.js +0 -7
  85. package/dist/http.js.map +0 -1
  86. package/dist/tx-not-found.d.ts +0 -3
  87. package/dist/tx-not-found.d.ts.map +0 -1
  88. package/dist/tx-not-found.js +0 -7
  89. package/dist/tx-not-found.js.map +0 -1
  90. package/dist/web3.d.ts +0 -3
  91. package/dist/web3.d.ts.map +0 -1
  92. package/dist/web3.js +0 -7
  93. package/dist/web3.js.map +0 -1
@@ -0,0 +1,53 @@
1
+ import { Exception, ErrorType, ErrorContext, ErrorCode, ErrorContextCode } from './types';
2
+ export declare abstract class ConcreteException extends Error implements Exception {
3
+ /**
4
+ * The type of the Error
5
+ */
6
+ type: ErrorType;
7
+ /**
8
+ * Error specific code (HttpStatus, GrpcStatus, etc)
9
+ */
10
+ code: ErrorCode;
11
+ /**
12
+ * The name of the error (the name of the instance of the Exception)
13
+ */
14
+ name: string;
15
+ /**
16
+ * Providing more context as to where the exception was thrown
17
+ * (ex: on-chain module, etc)
18
+ */
19
+ contextModule?: string;
20
+ /**
21
+ * Providing more context as to why the exception was thrown
22
+ * (ex: on-chain error code, etc)
23
+ */
24
+ contextCode?: ErrorContextCode;
25
+ /**
26
+ * Parsed message of the exception
27
+ */
28
+ message: string;
29
+ /**
30
+ * The original stack of the error
31
+ */
32
+ stack?: string;
33
+ /**
34
+ * The original message of the error
35
+ */
36
+ errorMessage: string;
37
+ constructor(error: Error, context?: ErrorContext);
38
+ parse(): void;
39
+ parseError(error: Error): void;
40
+ parseContext(context?: ErrorContext): void;
41
+ setType(type: ErrorType): void;
42
+ setCode(code: ErrorCode): void;
43
+ setStack(stack: string): void;
44
+ setName(name: string): void;
45
+ setMessage(message: string): void;
46
+ setContextModule(contextModule: string): void;
47
+ setContextCode(code: ErrorContextCode): void;
48
+ toOriginalError(): Error;
49
+ toError(): Error;
50
+ toJson(): string;
51
+ toString(): string;
52
+ }
53
+ //# sourceMappingURL=exception.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exception.d.ts","sourceRoot":"","sources":["../src/exception.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,SAAS,EAET,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB,8BAAsB,iBAAkB,SAAQ,KAAM,YAAW,SAAS;IACxE;;OAEG;IACI,IAAI,EAAE,SAAS,CAAwB;IAE9C;;OAEG;IACI,IAAI,EAAE,SAAS,CAAuB;IAE7C;;OAEG;IACI,IAAI,EAAG,MAAM,CAAA;IAEpB;;;OAGG;IACI,aAAa,CAAC,EAAE,MAAM,CAAA;IAE7B;;;OAGG;IACI,WAAW,CAAC,EAAE,gBAAgB,CAAuB;IAE5D;;OAEG;IACI,OAAO,EAAE,MAAM,CAAK;IAE3B;;OAEG;IACI,KAAK,CAAC,EAAE,MAAM,CAAK;IAE1B;;OAEG;IACI,YAAY,EAAE,MAAM,CAAK;gBAEpB,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;IAOzC,KAAK,IAAI,IAAI;IAIb,UAAU,CAAC,KAAK,EAAE,KAAK;IAOvB,YAAY,CAAC,OAAO,CAAC,EAAE,YAAY;IAYnC,OAAO,CAAC,IAAI,EAAE,SAAS;IAIvB,OAAO,CAAC,IAAI,EAAE,SAAS;IAIvB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAKtB,OAAO,CAAC,IAAI,EAAE,MAAM;IAKpB,UAAU,CAAC,OAAO,EAAE,MAAM;IAK1B,gBAAgB,CAAC,aAAa,EAAE,MAAM;IAItC,cAAc,CAAC,IAAI,EAAE,gBAAgB;IAIrC,eAAe,IAAI,KAAK;IAQxB,OAAO,IAAI,KAAK;IAQhB,MAAM,IAAI,MAAM;IAIhB,QAAQ;CAGhB"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConcreteException = void 0;
4
+ /* eslint-disable class-methods-use-this */
5
+ const types_1 = require("./types");
6
+ class ConcreteException extends Error {
7
+ constructor(error, context) {
8
+ super(error.message);
9
+ /**
10
+ * The type of the Error
11
+ */
12
+ this.type = types_1.ErrorType.Unspecified;
13
+ /**
14
+ * Error specific code (HttpStatus, GrpcStatus, etc)
15
+ */
16
+ this.code = types_1.UnspecifiedErrorCode;
17
+ /**
18
+ * Providing more context as to why the exception was thrown
19
+ * (ex: on-chain error code, etc)
20
+ */
21
+ this.contextCode = types_1.UnspecifiedErrorCode;
22
+ /**
23
+ * Parsed message of the exception
24
+ */
25
+ this.message = '';
26
+ /**
27
+ * The original stack of the error
28
+ */
29
+ this.stack = '';
30
+ /**
31
+ * The original message of the error
32
+ */
33
+ this.errorMessage = '';
34
+ this.parseError(error);
35
+ this.parseContext(context);
36
+ this.parse();
37
+ }
38
+ parse() {
39
+ //
40
+ }
41
+ parseError(error) {
42
+ this.setName(this.constructor.name);
43
+ this.setStack(error.stack || '');
44
+ this.setMessage(error.message);
45
+ this.errorMessage = error.message;
46
+ }
47
+ parseContext(context) {
48
+ const { contextModule, type, code } = context || {
49
+ contextModule: '',
50
+ code: types_1.UnspecifiedErrorCode,
51
+ type: types_1.ErrorType.Unspecified,
52
+ };
53
+ this.contextModule = contextModule;
54
+ this.type = type || types_1.ErrorType.Unspecified;
55
+ this.code = code || types_1.UnspecifiedErrorCode;
56
+ }
57
+ setType(type) {
58
+ this.type = type;
59
+ }
60
+ setCode(code) {
61
+ this.code = code;
62
+ }
63
+ setStack(stack) {
64
+ super.stack = stack;
65
+ this.stack = stack;
66
+ }
67
+ setName(name) {
68
+ super.name = name;
69
+ this.name = name;
70
+ }
71
+ setMessage(message) {
72
+ super.message = message;
73
+ this.message = message;
74
+ }
75
+ setContextModule(contextModule) {
76
+ this.contextModule = contextModule;
77
+ }
78
+ setContextCode(code) {
79
+ this.contextCode = code;
80
+ }
81
+ toOriginalError() {
82
+ const error = new Error(this.errorMessage);
83
+ error.stack = this.stack;
84
+ error.name = this.name || '';
85
+ return error;
86
+ }
87
+ toError() {
88
+ const error = new Error(this.message);
89
+ error.stack = this.stack;
90
+ error.name = this.name || '';
91
+ return error;
92
+ }
93
+ toJson() {
94
+ return JSON.stringify({ error: this.message, stack: this.stack });
95
+ }
96
+ toString() {
97
+ return this.message;
98
+ }
99
+ }
100
+ exports.ConcreteException = ConcreteException;
101
+ //# sourceMappingURL=exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exception.js","sourceRoot":"","sources":["../src/exception.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC3C,mCAOgB;AAEhB,MAAsB,iBAAkB,SAAQ,KAAK;IA2CnD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QA3CtB;;WAEG;QACI,SAAI,GAAc,iBAAS,CAAC,WAAW,CAAA;QAE9C;;WAEG;QACI,SAAI,GAAc,4BAAoB,CAAA;QAa7C;;;WAGG;QACI,gBAAW,GAAsB,4BAAoB,CAAA;QAE5D;;WAEG;QACI,YAAO,GAAW,EAAE,CAAA;QAE3B;;WAEG;QACI,UAAK,GAAY,EAAE,CAAA;QAE1B;;WAEG;QACI,iBAAY,GAAW,EAAE,CAAA;QAI9B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QACtB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;QAC1B,IAAI,CAAC,KAAK,EAAE,CAAA;IACd,CAAC;IAEM,KAAK;QACV,EAAE;IACJ,CAAC;IAEM,UAAU,CAAC,KAAY;QAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;QAChC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC9B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,OAAO,CAAA;IACnC,CAAC;IAEM,YAAY,CAAC,OAAsB;QACxC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI;YAC/C,aAAa,EAAE,EAAE;YACjB,IAAI,EAAE,4BAAoB;YAC1B,IAAI,EAAE,iBAAS,CAAC,WAAW;SAC5B,CAAA;QAED,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,iBAAS,CAAC,WAAW,CAAA;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,4BAAoB,CAAA;IAC1C,CAAC;IAEM,OAAO,CAAC,IAAe;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAEM,OAAO,CAAC,IAAe;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAEM,QAAQ,CAAC,KAAa;QAC3B,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAEM,OAAO,CAAC,IAAY;QACzB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAEM,UAAU,CAAC,OAAe;QAC/B,KAAK,CAAC,OAAO,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAEM,gBAAgB,CAAC,aAAqB;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,CAAC;IAEM,cAAc,CAAC,IAAsB;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;IACzB,CAAC;IAEM,eAAe;QACpB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC1C,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;QAE5B,OAAO,KAAK,CAAA;IACd,CAAC;IAEM,OAAO;QACZ,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACrC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;QAE5B,OAAO,KAAK,CAAA;IACd,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IACnE,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF;AA/HD,8CA+HC"}
@@ -0,0 +1,6 @@
1
+ import { ConcreteException } from '../exception';
2
+ import { ErrorContext } from '../types';
3
+ export declare class CosmosWalletException extends ConcreteException {
4
+ constructor(error: Error, context?: ErrorContext);
5
+ }
6
+ //# sourceMappingURL=CosmosWalletException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CosmosWalletException.d.ts","sourceRoot":"","sources":["../../src/exceptions/CosmosWalletException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAa,MAAM,UAAU,CAAA;AAElD,qBAAa,qBAAsB,SAAQ,iBAAiB;gBAC9C,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;CAKjD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CosmosWalletException = void 0;
4
+ const exception_1 = require("../exception");
5
+ const types_1 = require("../types");
6
+ class CosmosWalletException extends exception_1.ConcreteException {
7
+ constructor(error, context) {
8
+ super(error, context);
9
+ this.type = types_1.ErrorType.WalletError;
10
+ }
11
+ }
12
+ exports.CosmosWalletException = CosmosWalletException;
13
+ //# sourceMappingURL=CosmosWalletException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CosmosWalletException.js","sourceRoot":"","sources":["../../src/exceptions/CosmosWalletException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAAkD;AAElD,MAAa,qBAAsB,SAAQ,6BAAiB;IAC1D,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,WAAW,CAAA;IACnC,CAAC;CACF;AAND,sDAMC"}
@@ -0,0 +1,4 @@
1
+ import { ConcreteException } from '../exception';
2
+ export declare class GeneralException extends ConcreteException {
3
+ }
4
+ //# sourceMappingURL=GeneralException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneralException.d.ts","sourceRoot":"","sources":["../../src/exceptions/GeneralException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,qBAAa,gBAAiB,SAAQ,iBAAiB;CAEtD"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeneralException = void 0;
4
+ const exception_1 = require("../exception");
5
+ class GeneralException extends exception_1.ConcreteException {
6
+ }
7
+ exports.GeneralException = GeneralException;
8
+ //# sourceMappingURL=GeneralException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneralException.js","sourceRoot":"","sources":["../../src/exceptions/GeneralException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD,MAAa,gBAAiB,SAAQ,6BAAiB;CAEtD;AAFD,4CAEC"}
@@ -0,0 +1,6 @@
1
+ import { ConcreteException } from '../exception';
2
+ import { ErrorContext } from '../types';
3
+ export declare class GrpcUnaryRequestException extends ConcreteException {
4
+ constructor(error: Error, context?: ErrorContext);
5
+ }
6
+ //# sourceMappingURL=GrpcUnaryRequestException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GrpcUnaryRequestException.d.ts","sourceRoot":"","sources":["../../src/exceptions/GrpcUnaryRequestException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAa,MAAM,UAAU,CAAA;AAElD,qBAAa,yBAA0B,SAAQ,iBAAiB;gBAClD,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;CAKjD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GrpcUnaryRequestException = void 0;
4
+ const exception_1 = require("../exception");
5
+ const types_1 = require("../types");
6
+ class GrpcUnaryRequestException extends exception_1.ConcreteException {
7
+ constructor(error, context) {
8
+ super(error, context);
9
+ this.type = types_1.ErrorType.GrpcUnaryRequest;
10
+ }
11
+ }
12
+ exports.GrpcUnaryRequestException = GrpcUnaryRequestException;
13
+ //# sourceMappingURL=GrpcUnaryRequestException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GrpcUnaryRequestException.js","sourceRoot":"","sources":["../../src/exceptions/GrpcUnaryRequestException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAAkD;AAElD,MAAa,yBAA0B,SAAQ,6BAAiB;IAC9D,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,gBAAgB,CAAA;IACxC,CAAC;CACF;AAND,8DAMC"}
@@ -0,0 +1,9 @@
1
+ import { ConcreteException } from '../exception';
2
+ import { ErrorContext, HttpRequestMethod } from '../types';
3
+ export declare class HttpRequestException extends ConcreteException {
4
+ method: HttpRequestMethod;
5
+ constructor(error: Error, context?: ErrorContext & {
6
+ method?: HttpRequestMethod;
7
+ });
8
+ }
9
+ //# sourceMappingURL=HttpRequestException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpRequestException.d.ts","sourceRoot":"","sources":["../../src/exceptions/HttpRequestException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAa,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAErE,qBAAa,oBAAqB,SAAQ,iBAAiB;IAClD,MAAM,EAAE,iBAAiB,CAAwB;gBAGtD,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,YAAY,GAAG;QAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;KAAE;CAS1D"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpRequestException = void 0;
4
+ const exception_1 = require("../exception");
5
+ const types_1 = require("../types");
6
+ class HttpRequestException extends exception_1.ConcreteException {
7
+ constructor(error, context) {
8
+ super(error, context);
9
+ this.method = types_1.HttpRequestMethod.Get;
10
+ this.type = types_1.ErrorType.HttpRequest;
11
+ this.method = context
12
+ ? context.method || types_1.HttpRequestMethod.Get
13
+ : types_1.HttpRequestMethod.Get;
14
+ }
15
+ }
16
+ exports.HttpRequestException = HttpRequestException;
17
+ //# sourceMappingURL=HttpRequestException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpRequestException.js","sourceRoot":"","sources":["../../src/exceptions/HttpRequestException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAAqE;AAErE,MAAa,oBAAqB,SAAQ,6BAAiB;IAGzD,YACE,KAAY,EACZ,OAAuD;QAEvD,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QANhB,WAAM,GAAsB,yBAAiB,CAAC,GAAG,CAAA;QAQtD,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,WAAW,CAAA;QACjC,IAAI,CAAC,MAAM,GAAG,OAAO;YACnB,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,yBAAiB,CAAC,GAAG;YACzC,CAAC,CAAC,yBAAiB,CAAC,GAAG,CAAA;IAC3B,CAAC;CACF;AAdD,oDAcC"}
@@ -0,0 +1,7 @@
1
+ import { ConcreteException } from '../exception';
2
+ import { ErrorContext } from '../types';
3
+ export declare class LedgerException extends ConcreteException {
4
+ constructor(error: Error, context?: ErrorContext);
5
+ parseMessage(): void;
6
+ }
7
+ //# sourceMappingURL=LedgerException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LedgerException.d.ts","sourceRoot":"","sources":["../../src/exceptions/LedgerException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAa,MAAM,UAAU,CAAA;AAalD,qBAAa,eAAgB,SAAQ,iBAAiB;gBACxC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;IAMzC,YAAY,IAAI,IAAI;CAS5B"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LedgerException = void 0;
4
+ const exception_1 = require("../exception");
5
+ const types_1 = require("../types");
6
+ const isCommonLockedError = (error) => !!(error.includes('Ledger device: Incorrect length') ||
7
+ error.includes('Ledger device: INS_NOT_SUPPORTED') ||
8
+ error.includes('Ledger device: CLA_NOT_SUPPORTED') ||
9
+ error.includes('Failed to open the device') ||
10
+ error.includes('Failed to open the device') ||
11
+ error.includes('Ledger Device is busy') ||
12
+ error.includes('UNKNOWN_ERROR'));
13
+ class LedgerException extends exception_1.ConcreteException {
14
+ constructor(error, context) {
15
+ super(error, context);
16
+ this.type = types_1.ErrorType.WalletError;
17
+ }
18
+ parseMessage() {
19
+ const { message } = this;
20
+ if (isCommonLockedError(message)) {
21
+ this.setMessage('Please ensure your Ledger is connected, unlocked and your Ethereum app is open.');
22
+ }
23
+ }
24
+ }
25
+ exports.LedgerException = LedgerException;
26
+ //# sourceMappingURL=LedgerException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LedgerException.js","sourceRoot":"","sources":["../../src/exceptions/LedgerException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAAkD;AAElD,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,CAAC,CAAC,CACA,KAAK,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACjD,KAAK,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAClD,KAAK,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAClD,KAAK,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC3C,KAAK,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC3C,KAAK,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACvC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAChC,CAAA;AAEH,MAAa,eAAgB,SAAQ,6BAAiB;IACpD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,WAAW,CAAA;IACnC,CAAC;IAEM,YAAY;QACjB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QAExB,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE;YAChC,IAAI,CAAC,UAAU,CACb,iFAAiF,CAClF,CAAA;SACF;IACH,CAAC;CACF;AAhBD,0CAgBC"}
@@ -0,0 +1,7 @@
1
+ import { ConcreteException } from '../exception';
2
+ import { ErrorContext } from '../types';
3
+ export declare class MetamaskException extends ConcreteException {
4
+ constructor(error: Error, context?: ErrorContext);
5
+ parseMessage(): void;
6
+ }
7
+ //# sourceMappingURL=MetamaskException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetamaskException.d.ts","sourceRoot":"","sources":["../../src/exceptions/MetamaskException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAa,MAAM,UAAU,CAAA;AAQlD,qBAAa,iBAAkB,SAAQ,iBAAiB;gBAC1C,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;IAMzC,YAAY,IAAI,IAAI;CAK5B"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MetamaskException = void 0;
4
+ const exception_1 = require("../exception");
5
+ const types_1 = require("../types");
6
+ const removeMetamaskFromErrorString = (message) => message
7
+ .replaceAll('Metamask', '')
8
+ .replaceAll('MetaMask', '')
9
+ .replaceAll('Metamask:', '');
10
+ class MetamaskException extends exception_1.ConcreteException {
11
+ constructor(error, context) {
12
+ super(error, context);
13
+ this.type = types_1.ErrorType.WalletError;
14
+ }
15
+ parseMessage() {
16
+ const { message } = this;
17
+ this.setMessage(removeMetamaskFromErrorString(message));
18
+ }
19
+ }
20
+ exports.MetamaskException = MetamaskException;
21
+ //# sourceMappingURL=MetamaskException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetamaskException.js","sourceRoot":"","sources":["../../src/exceptions/MetamaskException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAAkD;AAElD,MAAM,6BAA6B,GAAG,CAAC,OAAe,EAAU,EAAE,CAChE,OAAO;KACJ,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC;KAC1B,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC;KAC1B,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAEhC,MAAa,iBAAkB,SAAQ,6BAAiB;IACtD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,WAAW,CAAA;IACnC,CAAC;IAEM,YAAY;QACjB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QAExB,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC,CAAA;IACzD,CAAC;CACF;AAZD,8CAYC"}
@@ -0,0 +1,11 @@
1
+ import { ConcreteException } from '../exception';
2
+ import { ErrorContext, ErrorContextCode } from '../types';
3
+ export declare const mapMessage: (message: string) => {
4
+ message: string;
5
+ code: ErrorContextCode;
6
+ };
7
+ export declare class TransactionException extends ConcreteException {
8
+ constructor(error: Error, context?: ErrorContext);
9
+ parse(): void;
10
+ }
11
+ //# sourceMappingURL=TransactionException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransactionException.d.ts","sourceRoot":"","sources":["../../src/exceptions/TransactionException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAEL,YAAY,EACZ,gBAAgB,EAGjB,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,UAAU,YACZ,MAAM;aACH,MAAM;UAAQ,gBAAgB;CAoB3C,CAAA;AAED,qBAAa,oBAAqB,SAAQ,iBAAiB;gBAC7C,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;IAMzC,KAAK,IAAI,IAAI;CAOrB"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionException = exports.mapMessage = void 0;
4
+ const exception_1 = require("../exception");
5
+ const types_1 = require("../types");
6
+ const mapMessage = (message) => {
7
+ const [, parsedMessage] = message.split('message index: 0:');
8
+ const [actualMessage] = parsedMessage.split(': invalid request');
9
+ const trimmedMessage = actualMessage.trim().trimEnd();
10
+ if (trimmedMessage.toLowerCase().includes('insufficient fee')) {
11
+ return {
12
+ message: 'You do not have enough funds to cover transaction fees.',
13
+ code: types_1.ChainCosmosErrorCode.ErrInsufficientFee,
14
+ };
15
+ }
16
+ if (trimmedMessage.toLowerCase().includes('insufficient funds')) {
17
+ return {
18
+ message: 'You do not have enough funds to cover transaction fees.',
19
+ code: types_1.ChainCosmosErrorCode.ErrInsufficientFunds,
20
+ };
21
+ }
22
+ return { message: trimmedMessage, code: types_1.UnspecifiedErrorCode };
23
+ };
24
+ exports.mapMessage = mapMessage;
25
+ class TransactionException extends exception_1.ConcreteException {
26
+ constructor(error, context) {
27
+ super(error, context);
28
+ this.type = types_1.ErrorType.ChainError;
29
+ }
30
+ parse() {
31
+ const { message } = this;
32
+ const { message: parsedMessage, code } = (0, exports.mapMessage)(message);
33
+ this.setMessage(parsedMessage);
34
+ this.setContextCode(code);
35
+ }
36
+ }
37
+ exports.TransactionException = TransactionException;
38
+ //# sourceMappingURL=TransactionException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransactionException.js","sourceRoot":"","sources":["../../src/exceptions/TransactionException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAMiB;AAEV,MAAM,UAAU,GAAG,CACxB,OAAe,EAC8B,EAAE;IAC/C,MAAM,CAAC,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAC5D,MAAM,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAChE,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;IAErD,IAAI,cAAc,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;QAC7D,OAAO;YACL,OAAO,EAAE,yDAAyD;YAClE,IAAI,EAAE,4BAAoB,CAAC,kBAAkB;SAC9C,CAAA;KACF;IAED,IAAI,cAAc,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE;QAC/D,OAAO;YACL,OAAO,EAAE,yDAAyD;YAClE,IAAI,EAAE,4BAAoB,CAAC,oBAAoB;SAChD,CAAA;KACF;IAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,4BAAoB,EAAE,CAAA;AAChE,CAAC,CAAA;AAtBY,QAAA,UAAU,cAsBtB;AAED,MAAa,oBAAqB,SAAQ,6BAAiB;IACzD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,UAAU,CAAA;IAClC,CAAC;IAEM,KAAK;QACV,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QACxB,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAA;QAE5D,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QAC9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;CACF;AAdD,oDAcC"}
@@ -0,0 +1,6 @@
1
+ import { ConcreteException } from '../exception';
2
+ import { ErrorContext } from '../types';
3
+ export declare class TrezorException extends ConcreteException {
4
+ constructor(error: Error, context?: ErrorContext);
5
+ }
6
+ //# sourceMappingURL=TrezorException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrezorException.d.ts","sourceRoot":"","sources":["../../src/exceptions/TrezorException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAa,MAAM,UAAU,CAAA;AAElD,qBAAa,eAAgB,SAAQ,iBAAiB;gBACxC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;CAKjD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrezorException = void 0;
4
+ const exception_1 = require("../exception");
5
+ const types_1 = require("../types");
6
+ class TrezorException extends exception_1.ConcreteException {
7
+ constructor(error, context) {
8
+ super(error, context);
9
+ this.type = types_1.ErrorType.WalletError;
10
+ }
11
+ }
12
+ exports.TrezorException = TrezorException;
13
+ //# sourceMappingURL=TrezorException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrezorException.js","sourceRoot":"","sources":["../../src/exceptions/TrezorException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAAkD;AAElD,MAAa,eAAgB,SAAQ,6BAAiB;IACpD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,WAAW,CAAA;IACnC,CAAC;CACF;AAND,0CAMC"}
@@ -0,0 +1,4 @@
1
+ import { ConcreteException } from '../exception';
2
+ export declare class WalletException extends ConcreteException {
3
+ }
4
+ //# sourceMappingURL=WalletException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletException.d.ts","sourceRoot":"","sources":["../../src/exceptions/WalletException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,qBAAa,eAAgB,SAAQ,iBAAiB;CAErD"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletException = void 0;
4
+ const exception_1 = require("../exception");
5
+ class WalletException extends exception_1.ConcreteException {
6
+ }
7
+ exports.WalletException = WalletException;
8
+ //# sourceMappingURL=WalletException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletException.js","sourceRoot":"","sources":["../../src/exceptions/WalletException.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD,MAAa,eAAgB,SAAQ,6BAAiB;CAErD;AAFD,0CAEC"}
@@ -0,0 +1,6 @@
1
+ import { ConcreteException } from '../exception';
2
+ import { ErrorContext } from '../types';
3
+ export declare class Web3Exception extends ConcreteException {
4
+ constructor(error: Error, context?: ErrorContext);
5
+ }
6
+ //# sourceMappingURL=Web3Exception.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Web3Exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/Web3Exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAa,MAAM,UAAU,CAAA;AAElD,qBAAa,aAAc,SAAQ,iBAAiB;gBACtC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY;CAKjD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Web3Exception = void 0;
4
+ const exception_1 = require("../exception");
5
+ const types_1 = require("../types");
6
+ class Web3Exception extends exception_1.ConcreteException {
7
+ constructor(error, context) {
8
+ super(error, context);
9
+ this.type = types_1.ErrorType.Web3;
10
+ }
11
+ }
12
+ exports.Web3Exception = Web3Exception;
13
+ //# sourceMappingURL=Web3Exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Web3Exception.js","sourceRoot":"","sources":["../../src/exceptions/Web3Exception.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oCAAkD;AAElD,MAAa,aAAc,SAAQ,6BAAiB;IAClD,YAAY,KAAY,EAAE,OAAsB;QAC9C,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAErB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,IAAI,CAAA;IAC5B,CAAC;CACF;AAND,sCAMC"}
@@ -0,0 +1,15 @@
1
+ import { GrpcUnaryRequestException } from './GrpcUnaryRequestException';
2
+ import { HttpRequestException } from './HttpRequestException';
3
+ import { Web3Exception } from './Web3Exception';
4
+ import { GeneralException } from './GeneralException';
5
+ import { LedgerException } from './LedgerException';
6
+ import { MetamaskException } from './MetamaskException';
7
+ import { TrezorException } from './TrezorException';
8
+ import { CosmosWalletException } from './CosmosWalletException';
9
+ import { TransactionException } from './TransactionException';
10
+ import { WalletException } from './WalletException';
11
+ import { Exception } from '../types';
12
+ export declare type ThrownException = GrpcUnaryRequestException | HttpRequestException | Web3Exception | GeneralException | LedgerException | MetamaskException | TrezorException | CosmosWalletException | TransactionException | WalletException;
13
+ export declare const isThrownException: (exception: Error | Exception) => boolean;
14
+ export { GrpcUnaryRequestException, HttpRequestException, Web3Exception, GeneralException, LedgerException, MetamaskException, TrezorException, CosmosWalletException, TransactionException, WalletException, };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGpC,oBAAY,eAAe,GACvB,yBAAyB,GACzB,oBAAoB,GACpB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,qBAAqB,GACrB,oBAAoB,GACpB,eAAe,CAAA;AAEnB,eAAO,MAAM,iBAAiB,cAAe,KAAK,GAAG,SAAS,KAAG,OAuBhE,CAAA;AAED,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,GAChB,CAAA"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletException = exports.TransactionException = exports.CosmosWalletException = exports.TrezorException = exports.MetamaskException = exports.LedgerException = exports.GeneralException = exports.Web3Exception = exports.HttpRequestException = exports.GrpcUnaryRequestException = exports.isThrownException = void 0;
4
+ const GrpcUnaryRequestException_1 = require("./GrpcUnaryRequestException");
5
+ Object.defineProperty(exports, "GrpcUnaryRequestException", { enumerable: true, get: function () { return GrpcUnaryRequestException_1.GrpcUnaryRequestException; } });
6
+ const HttpRequestException_1 = require("./HttpRequestException");
7
+ Object.defineProperty(exports, "HttpRequestException", { enumerable: true, get: function () { return HttpRequestException_1.HttpRequestException; } });
8
+ const Web3Exception_1 = require("./Web3Exception");
9
+ Object.defineProperty(exports, "Web3Exception", { enumerable: true, get: function () { return Web3Exception_1.Web3Exception; } });
10
+ const GeneralException_1 = require("./GeneralException");
11
+ Object.defineProperty(exports, "GeneralException", { enumerable: true, get: function () { return GeneralException_1.GeneralException; } });
12
+ const LedgerException_1 = require("./LedgerException");
13
+ Object.defineProperty(exports, "LedgerException", { enumerable: true, get: function () { return LedgerException_1.LedgerException; } });
14
+ const MetamaskException_1 = require("./MetamaskException");
15
+ Object.defineProperty(exports, "MetamaskException", { enumerable: true, get: function () { return MetamaskException_1.MetamaskException; } });
16
+ const TrezorException_1 = require("./TrezorException");
17
+ Object.defineProperty(exports, "TrezorException", { enumerable: true, get: function () { return TrezorException_1.TrezorException; } });
18
+ const CosmosWalletException_1 = require("./CosmosWalletException");
19
+ Object.defineProperty(exports, "CosmosWalletException", { enumerable: true, get: function () { return CosmosWalletException_1.CosmosWalletException; } });
20
+ const TransactionException_1 = require("./TransactionException");
21
+ Object.defineProperty(exports, "TransactionException", { enumerable: true, get: function () { return TransactionException_1.TransactionException; } });
22
+ const WalletException_1 = require("./WalletException");
23
+ Object.defineProperty(exports, "WalletException", { enumerable: true, get: function () { return WalletException_1.WalletException; } });
24
+ const exception_1 = require("../exception");
25
+ const isThrownException = (exception) => {
26
+ if (exception instanceof exception_1.ConcreteException) {
27
+ return true;
28
+ }
29
+ if ([
30
+ 'WalletException',
31
+ 'GrpcUnaryRequestException',
32
+ 'HttpRequestException',
33
+ 'Web3Exception',
34
+ 'GeneralException',
35
+ 'LedgerException',
36
+ 'MetamaskException',
37
+ 'TrezorException',
38
+ 'CosmosWalletException',
39
+ 'TransactionException',
40
+ ].includes(exception.constructor.name)) {
41
+ return true;
42
+ }
43
+ return false;
44
+ };
45
+ exports.isThrownException = isThrownException;
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,2EAAuE;AAmDrE,0GAnDO,qDAAyB,OAmDP;AAlD3B,iEAA6D;AAmD3D,qGAnDO,2CAAoB,OAmDP;AAlDtB,mDAA+C;AAmD7C,8FAnDO,6BAAa,OAmDP;AAlDf,yDAAqD;AAmDnD,iGAnDO,mCAAgB,OAmDP;AAlDlB,uDAAmD;AAmDjD,gGAnDO,iCAAe,OAmDP;AAlDjB,2DAAuD;AAmDrD,kGAnDO,qCAAiB,OAmDP;AAlDnB,uDAAmD;AAmDjD,gGAnDO,iCAAe,OAmDP;AAlDjB,mEAA+D;AAmD7D,sGAnDO,6CAAqB,OAmDP;AAlDvB,iEAA6D;AAmD3D,qGAnDO,2CAAoB,OAmDP;AAlDtB,uDAAmD;AAmDjD,gGAnDO,iCAAe,OAmDP;AAjDjB,4CAAgD;AAczC,MAAM,iBAAiB,GAAG,CAAC,SAA4B,EAAW,EAAE;IACzE,IAAI,SAAS,YAAY,6BAAiB,EAAE;QAC1C,OAAO,IAAI,CAAA;KACZ;IAED,IACE;QACE,iBAAiB;QACjB,2BAA2B;QAC3B,sBAAsB;QACtB,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QACjB,mBAAmB;QACnB,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;KACvB,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,EACtC;QACA,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAvBY,QAAA,iBAAiB,qBAuB7B"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- export * from './web3';
2
- export * from './http';
3
- export * from './contract';
4
- export * from './grpc';
5
- export * from './exchange';
6
- export * from './block-not-found';
7
- export * from './tx-not-found';
1
+ export * from './exceptions';
2
+ export * from './exception';
3
+ export * from './types';
8
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -14,11 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./web3"), exports);
18
- __exportStar(require("./http"), exports);
19
- __exportStar(require("./contract"), exports);
20
- __exportStar(require("./grpc"), exports);
21
- __exportStar(require("./exchange"), exports);
22
- __exportStar(require("./block-not-found"), exports);
23
- __exportStar(require("./tx-not-found"), exports);
17
+ __exportStar(require("./exceptions"), exports);
18
+ __exportStar(require("./exception"), exports);
19
+ __exportStar(require("./types"), exports);
24
20
  //# sourceMappingURL=index.js.map