@injectivelabs/exceptions 1.16.38 → 1.17.2-alpha.0

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 (133) hide show
  1. package/dist/cjs/index.cjs +2759 -0
  2. package/dist/cjs/index.d.cts +826 -0
  3. package/dist/cjs/package.json +2 -2
  4. package/dist/esm/index.d.ts +826 -3
  5. package/dist/esm/index.js +2712 -2
  6. package/dist/esm/package.json +2 -2
  7. package/package.json +37 -38
  8. package/dist/cjs/exceptions/base.d.ts +0 -81
  9. package/dist/cjs/exceptions/base.js +0 -179
  10. package/dist/cjs/exceptions/exceptions/BitGetException.d.ts +0 -7
  11. package/dist/cjs/exceptions/exceptions/BitGetException.js +0 -31
  12. package/dist/cjs/exceptions/exceptions/CosmosWalletException.d.ts +0 -7
  13. package/dist/cjs/exceptions/exceptions/CosmosWalletException.js +0 -16
  14. package/dist/cjs/exceptions/exceptions/GeneralException.d.ts +0 -5
  15. package/dist/cjs/exceptions/exceptions/GeneralException.js +0 -11
  16. package/dist/cjs/exceptions/exceptions/GrpcUnaryRequestException.d.ts +0 -7
  17. package/dist/cjs/exceptions/exceptions/GrpcUnaryRequestException.js +0 -21
  18. package/dist/cjs/exceptions/exceptions/HttpRequestException.d.ts +0 -11
  19. package/dist/cjs/exceptions/exceptions/HttpRequestException.js +0 -21
  20. package/dist/cjs/exceptions/exceptions/LedgerCosmosException.d.ts +0 -7
  21. package/dist/cjs/exceptions/exceptions/LedgerCosmosException.js +0 -40
  22. package/dist/cjs/exceptions/exceptions/LedgerException.d.ts +0 -7
  23. package/dist/cjs/exceptions/exceptions/LedgerException.js +0 -40
  24. package/dist/cjs/exceptions/exceptions/MetamaskException.d.ts +0 -7
  25. package/dist/cjs/exceptions/exceptions/MetamaskException.js +0 -31
  26. package/dist/cjs/exceptions/exceptions/OkxWalletException.d.ts +0 -7
  27. package/dist/cjs/exceptions/exceptions/OkxWalletException.js +0 -31
  28. package/dist/cjs/exceptions/exceptions/RabbyWalletException.d.ts +0 -7
  29. package/dist/cjs/exceptions/exceptions/RabbyWalletException.js +0 -33
  30. package/dist/cjs/exceptions/exceptions/RainbowWalletException.d.ts +0 -7
  31. package/dist/cjs/exceptions/exceptions/RainbowWalletException.js +0 -31
  32. package/dist/cjs/exceptions/exceptions/TransactionException.d.ts +0 -7
  33. package/dist/cjs/exceptions/exceptions/TransactionException.js +0 -34
  34. package/dist/cjs/exceptions/exceptions/TrezorException.d.ts +0 -7
  35. package/dist/cjs/exceptions/exceptions/TrezorException.js +0 -16
  36. package/dist/cjs/exceptions/exceptions/TrustWalletException.d.ts +0 -7
  37. package/dist/cjs/exceptions/exceptions/TrustWalletException.js +0 -33
  38. package/dist/cjs/exceptions/exceptions/TurnkeyWalletSessionException.d.ts +0 -5
  39. package/dist/cjs/exceptions/exceptions/TurnkeyWalletSessionException.js +0 -11
  40. package/dist/cjs/exceptions/exceptions/WalletConnectException.d.ts +0 -7
  41. package/dist/cjs/exceptions/exceptions/WalletConnectException.js +0 -31
  42. package/dist/cjs/exceptions/exceptions/WalletException.d.ts +0 -5
  43. package/dist/cjs/exceptions/exceptions/WalletException.js +0 -11
  44. package/dist/cjs/exceptions/exceptions/Web3Exception.d.ts +0 -7
  45. package/dist/cjs/exceptions/exceptions/Web3Exception.js +0 -16
  46. package/dist/cjs/exceptions/exceptions/index.d.ts +0 -18
  47. package/dist/cjs/exceptions/exceptions/index.js +0 -37
  48. package/dist/cjs/exceptions/index.d.ts +0 -2
  49. package/dist/cjs/exceptions/index.js +0 -18
  50. package/dist/cjs/exceptions/messages.d.ts +0 -13
  51. package/dist/cjs/exceptions/messages.js +0 -1600
  52. package/dist/cjs/exceptions/types/codes.d.ts +0 -441
  53. package/dist/cjs/exceptions/types/codes.js +0 -774
  54. package/dist/cjs/exceptions/types/context.d.ts +0 -93
  55. package/dist/cjs/exceptions/types/context.js +0 -21
  56. package/dist/cjs/exceptions/types/index.d.ts +0 -3
  57. package/dist/cjs/exceptions/types/index.js +0 -19
  58. package/dist/cjs/exceptions/types/modules.d.ts +0 -67
  59. package/dist/cjs/exceptions/types/modules.js +0 -66
  60. package/dist/cjs/exceptions/utils/grpc.d.ts +0 -3
  61. package/dist/cjs/exceptions/utils/grpc.js +0 -43
  62. package/dist/cjs/exceptions/utils/helpers.d.ts +0 -1
  63. package/dist/cjs/exceptions/utils/helpers.js +0 -24
  64. package/dist/cjs/exceptions/utils/maps.d.ts +0 -13
  65. package/dist/cjs/exceptions/utils/maps.js +0 -127
  66. package/dist/cjs/index.d.ts +0 -3
  67. package/dist/cjs/index.js +0 -18
  68. package/dist/cjs/types.d.ts +0 -2
  69. package/dist/cjs/types.js +0 -2
  70. package/dist/cjs/utils.d.ts +0 -8
  71. package/dist/cjs/utils.js +0 -49
  72. package/dist/esm/exceptions/base.d.ts +0 -81
  73. package/dist/esm/exceptions/base.js +0 -175
  74. package/dist/esm/exceptions/exceptions/BitGetException.d.ts +0 -7
  75. package/dist/esm/exceptions/exceptions/BitGetException.js +0 -27
  76. package/dist/esm/exceptions/exceptions/CosmosWalletException.d.ts +0 -7
  77. package/dist/esm/exceptions/exceptions/CosmosWalletException.js +0 -12
  78. package/dist/esm/exceptions/exceptions/GeneralException.d.ts +0 -5
  79. package/dist/esm/exceptions/exceptions/GeneralException.js +0 -7
  80. package/dist/esm/exceptions/exceptions/GrpcUnaryRequestException.d.ts +0 -7
  81. package/dist/esm/exceptions/exceptions/GrpcUnaryRequestException.js +0 -17
  82. package/dist/esm/exceptions/exceptions/HttpRequestException.d.ts +0 -11
  83. package/dist/esm/exceptions/exceptions/HttpRequestException.js +0 -17
  84. package/dist/esm/exceptions/exceptions/LedgerCosmosException.d.ts +0 -7
  85. package/dist/esm/exceptions/exceptions/LedgerCosmosException.js +0 -36
  86. package/dist/esm/exceptions/exceptions/LedgerException.d.ts +0 -7
  87. package/dist/esm/exceptions/exceptions/LedgerException.js +0 -36
  88. package/dist/esm/exceptions/exceptions/MetamaskException.d.ts +0 -7
  89. package/dist/esm/exceptions/exceptions/MetamaskException.js +0 -27
  90. package/dist/esm/exceptions/exceptions/OkxWalletException.d.ts +0 -7
  91. package/dist/esm/exceptions/exceptions/OkxWalletException.js +0 -27
  92. package/dist/esm/exceptions/exceptions/RabbyWalletException.d.ts +0 -7
  93. package/dist/esm/exceptions/exceptions/RabbyWalletException.js +0 -29
  94. package/dist/esm/exceptions/exceptions/RainbowWalletException.d.ts +0 -7
  95. package/dist/esm/exceptions/exceptions/RainbowWalletException.js +0 -27
  96. package/dist/esm/exceptions/exceptions/TransactionException.d.ts +0 -7
  97. package/dist/esm/exceptions/exceptions/TransactionException.js +0 -30
  98. package/dist/esm/exceptions/exceptions/TrezorException.d.ts +0 -7
  99. package/dist/esm/exceptions/exceptions/TrezorException.js +0 -12
  100. package/dist/esm/exceptions/exceptions/TrustWalletException.d.ts +0 -7
  101. package/dist/esm/exceptions/exceptions/TrustWalletException.js +0 -29
  102. package/dist/esm/exceptions/exceptions/TurnkeyWalletSessionException.d.ts +0 -5
  103. package/dist/esm/exceptions/exceptions/TurnkeyWalletSessionException.js +0 -7
  104. package/dist/esm/exceptions/exceptions/WalletConnectException.d.ts +0 -7
  105. package/dist/esm/exceptions/exceptions/WalletConnectException.js +0 -27
  106. package/dist/esm/exceptions/exceptions/WalletException.d.ts +0 -5
  107. package/dist/esm/exceptions/exceptions/WalletException.js +0 -7
  108. package/dist/esm/exceptions/exceptions/Web3Exception.d.ts +0 -7
  109. package/dist/esm/exceptions/exceptions/Web3Exception.js +0 -12
  110. package/dist/esm/exceptions/exceptions/index.d.ts +0 -18
  111. package/dist/esm/exceptions/exceptions/index.js +0 -18
  112. package/dist/esm/exceptions/index.d.ts +0 -2
  113. package/dist/esm/exceptions/index.js +0 -2
  114. package/dist/esm/exceptions/messages.d.ts +0 -13
  115. package/dist/esm/exceptions/messages.js +0 -1597
  116. package/dist/esm/exceptions/types/codes.d.ts +0 -441
  117. package/dist/esm/exceptions/types/codes.js +0 -770
  118. package/dist/esm/exceptions/types/context.d.ts +0 -93
  119. package/dist/esm/exceptions/types/context.js +0 -18
  120. package/dist/esm/exceptions/types/index.d.ts +0 -3
  121. package/dist/esm/exceptions/types/index.js +0 -3
  122. package/dist/esm/exceptions/types/modules.d.ts +0 -67
  123. package/dist/esm/exceptions/types/modules.js +0 -63
  124. package/dist/esm/exceptions/utils/grpc.d.ts +0 -3
  125. package/dist/esm/exceptions/utils/grpc.js +0 -6
  126. package/dist/esm/exceptions/utils/helpers.d.ts +0 -1
  127. package/dist/esm/exceptions/utils/helpers.js +0 -20
  128. package/dist/esm/exceptions/utils/maps.d.ts +0 -13
  129. package/dist/esm/exceptions/utils/maps.js +0 -120
  130. package/dist/esm/types.d.ts +0 -2
  131. package/dist/esm/types.js +0 -1
  132. package/dist/esm/utils.d.ts +0 -8
  133. package/dist/esm/utils.js +0 -44
@@ -1,7 +0,0 @@
1
- import { ConcreteException } from '../base.js';
2
- export class TurnkeyWalletSessionException extends ConcreteException {
3
- static errorClass = 'TurnkeyWalletSessionException';
4
- parse() {
5
- this.setName(TurnkeyWalletSessionException.errorClass);
6
- }
7
- }
@@ -1,7 +0,0 @@
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
- }
@@ -1,27 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
1
- import { ConcreteException } from '../base.js';
2
- export declare class WalletException extends ConcreteException {
3
- static errorClass: string;
4
- parse(): void;
5
- }
@@ -1,7 +0,0 @@
1
- import { ConcreteException } from '../base.js';
2
- export class WalletException extends ConcreteException {
3
- static errorClass = 'WalletException';
4
- parse() {
5
- this.setName(WalletException.errorClass);
6
- }
7
- }
@@ -1,7 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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
- }
@@ -1,18 +0,0 @@
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, };
@@ -1,18 +0,0 @@
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, };
@@ -1,2 +0,0 @@
1
- export * from './exceptions/index.js';
2
- export * from './types/index.js';
@@ -1,2 +0,0 @@
1
- export * from './exceptions/index.js';
2
- export * from './types/index.js';
@@ -1,13 +0,0 @@
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
- }>;