@injectivelabs/exceptions 1.0.14 → 1.0.16

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 (109) hide show
  1. package/dist/exception.d.ts +53 -0
  2. package/dist/exception.d.ts.map +1 -0
  3. package/dist/exception.js +96 -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 +7 -0
  30. package/dist/exceptions/TransactionException.d.ts.map +1 -0
  31. package/dist/exceptions/TransactionException.js +20 -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/Web3GatewayTransactionException.d.ts +4 -0
  46. package/dist/exceptions/Web3GatewayTransactionException.d.ts.map +1 -0
  47. package/dist/exceptions/Web3GatewayTransactionException.js +8 -0
  48. package/dist/exceptions/Web3GatewayTransactionException.js.map +1 -0
  49. package/dist/exceptions/index.d.ts +16 -0
  50. package/dist/exceptions/index.d.ts.map +1 -0
  51. package/dist/exceptions/index.js +49 -0
  52. package/dist/exceptions/index.js.map +1 -0
  53. package/dist/index.d.ts +3 -7
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +3 -7
  56. package/dist/index.js.map +1 -1
  57. package/dist/messages.d.ts +352 -0
  58. package/dist/messages.d.ts.map +1 -0
  59. package/dist/messages.js +356 -0
  60. package/dist/messages.js.map +1 -0
  61. package/dist/types/codes.d.ts +135 -0
  62. package/dist/types/codes.d.ts.map +1 -0
  63. package/dist/types/codes.js +259 -0
  64. package/dist/types/codes.js.map +1 -0
  65. package/dist/types/index.d.ts +80 -0
  66. package/dist/types/index.d.ts.map +1 -0
  67. package/dist/types/index.js +39 -0
  68. package/dist/types/index.js.map +1 -0
  69. package/dist/types/modules.d.ts +47 -0
  70. package/dist/types/modules.d.ts.map +1 -0
  71. package/dist/types/modules.js +54 -0
  72. package/dist/types/modules.js.map +1 -0
  73. package/dist/utils/index.d.ts +1 -0
  74. package/dist/utils/index.d.ts.map +1 -0
  75. package/dist/utils/index.js +2 -0
  76. package/dist/utils/index.js.map +1 -0
  77. package/dist/utils/maps.d.ts +7 -0
  78. package/dist/utils/maps.d.ts.map +1 -0
  79. package/dist/utils/maps.js +28 -0
  80. package/dist/utils/maps.js.map +1 -0
  81. package/package.json +4 -2
  82. package/dist/block-not-found.d.ts +0 -3
  83. package/dist/block-not-found.d.ts.map +0 -1
  84. package/dist/block-not-found.js +0 -7
  85. package/dist/block-not-found.js.map +0 -1
  86. package/dist/contract.d.ts +0 -3
  87. package/dist/contract.d.ts.map +0 -1
  88. package/dist/contract.js +0 -7
  89. package/dist/contract.js.map +0 -1
  90. package/dist/exchange.d.ts +0 -3
  91. package/dist/exchange.d.ts.map +0 -1
  92. package/dist/exchange.js +0 -7
  93. package/dist/exchange.js.map +0 -1
  94. package/dist/grpc.d.ts +0 -3
  95. package/dist/grpc.d.ts.map +0 -1
  96. package/dist/grpc.js +0 -7
  97. package/dist/grpc.js.map +0 -1
  98. package/dist/http.d.ts +0 -3
  99. package/dist/http.d.ts.map +0 -1
  100. package/dist/http.js +0 -7
  101. package/dist/http.js.map +0 -1
  102. package/dist/tx-not-found.d.ts +0 -3
  103. package/dist/tx-not-found.d.ts.map +0 -1
  104. package/dist/tx-not-found.js +0 -7
  105. package/dist/tx-not-found.js.map +0 -1
  106. package/dist/web3.d.ts +0 -3
  107. package/dist/web3.d.ts.map +0 -1
  108. package/dist/web3.js +0 -7
  109. package/dist/web3.js.map +0 -1
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
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,yCAAsB;AACtB,6CAA0B;AAC1B,yCAAsB;AACtB,6CAA0B;AAC1B,oDAAiC;AACjC,iDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,8CAA2B;AAC3B,0CAAuB"}
@@ -0,0 +1,352 @@
1
+ import { ChainCosmosErrorCode, ChainExchangeModuleErrorCode } from './types';
2
+ export declare const messagesMap: {
3
+ 'insufficient fee': {
4
+ message: string;
5
+ code: ChainCosmosErrorCode;
6
+ };
7
+ 'insufficient funds': {
8
+ message: string;
9
+ code: ChainCosmosErrorCode;
10
+ };
11
+ 'tx timeout height': {
12
+ message: string;
13
+ code: ChainCosmosErrorCode;
14
+ };
15
+ 'failed to validate order': {
16
+ message: string;
17
+ code: ChainExchangeModuleErrorCode;
18
+ };
19
+ 'spot market not found': {
20
+ message: string;
21
+ code: ChainExchangeModuleErrorCode;
22
+ };
23
+ 'spot market exists': {
24
+ message: string;
25
+ code: ChainExchangeModuleErrorCode;
26
+ };
27
+ 'struct field error': {
28
+ message: string;
29
+ code: ChainExchangeModuleErrorCode;
30
+ };
31
+ 'failed to validate market': {
32
+ message: string;
33
+ code: ChainExchangeModuleErrorCode;
34
+ };
35
+ 'subaccount has insufficient deposits': {
36
+ message: string;
37
+ code: ChainExchangeModuleErrorCode;
38
+ };
39
+ 'unrecognized order type': {
40
+ message: string;
41
+ code: ChainExchangeModuleErrorCode;
42
+ };
43
+ 'position quantity insufficient for order': {
44
+ message: string;
45
+ code: ChainExchangeModuleErrorCode;
46
+ };
47
+ 'order hash is not valid': {
48
+ message: string;
49
+ code: ChainExchangeModuleErrorCode;
50
+ };
51
+ 'subaccount id is not valid': {
52
+ message: string;
53
+ code: ChainExchangeModuleErrorCode;
54
+ };
55
+ 'invalid ticker': {
56
+ message: string;
57
+ code: ChainExchangeModuleErrorCode;
58
+ };
59
+ 'invalid base denom': {
60
+ message: string;
61
+ code: ChainExchangeModuleErrorCode;
62
+ };
63
+ 'invalid quote denom': {
64
+ message: string;
65
+ code: ChainExchangeModuleErrorCode;
66
+ };
67
+ 'invalid oracle': {
68
+ message: string;
69
+ code: ChainExchangeModuleErrorCode;
70
+ };
71
+ 'invalid expiry': {
72
+ message: string;
73
+ code: ChainExchangeModuleErrorCode;
74
+ };
75
+ 'invalid price': {
76
+ message: string;
77
+ code: ChainExchangeModuleErrorCode;
78
+ };
79
+ 'invalid quantity': {
80
+ message: string;
81
+ code: ChainExchangeModuleErrorCode;
82
+ };
83
+ 'unsupported oracle type': {
84
+ message: string;
85
+ code: ChainExchangeModuleErrorCode;
86
+ };
87
+ 'order doesnt exist': {
88
+ message: string;
89
+ code: ChainExchangeModuleErrorCode;
90
+ };
91
+ 'spot limit orderbook fill invalid': {
92
+ message: string;
93
+ code: ChainExchangeModuleErrorCode;
94
+ };
95
+ 'perpetual market exists': {
96
+ message: string;
97
+ code: ChainExchangeModuleErrorCode;
98
+ };
99
+ 'expiry futures market exists': {
100
+ message: string;
101
+ code: ChainExchangeModuleErrorCode;
102
+ };
103
+ 'expiry futures market expired': {
104
+ message: string;
105
+ code: ChainExchangeModuleErrorCode;
106
+ };
107
+ 'no liquidity on the orderbook': {
108
+ message: string;
109
+ code: ChainExchangeModuleErrorCode;
110
+ };
111
+ 'orderbook liquidity cannot satisfy current worst price': {
112
+ message: string;
113
+ code: ChainExchangeModuleErrorCode;
114
+ };
115
+ 'order has insufficient margin': {
116
+ message: string;
117
+ code: ChainExchangeModuleErrorCode;
118
+ };
119
+ 'derivative market not found': {
120
+ message: string;
121
+ code: ChainExchangeModuleErrorCode;
122
+ };
123
+ 'position not found': {
124
+ message: string;
125
+ code: ChainExchangeModuleErrorCode;
126
+ };
127
+ 'position direction does not oppose the reduce-only order': {
128
+ message: string;
129
+ code: ChainExchangeModuleErrorCode;
130
+ };
131
+ 'price surpasses bankruptcy price': {
132
+ message: string;
133
+ code: ChainExchangeModuleErrorCode;
134
+ };
135
+ 'position not liquidable': {
136
+ message: string;
137
+ code: ChainExchangeModuleErrorCode;
138
+ };
139
+ 'invalid trigger price': {
140
+ message: string;
141
+ code: ChainExchangeModuleErrorCode;
142
+ };
143
+ 'invalid oracle type': {
144
+ message: string;
145
+ code: ChainExchangeModuleErrorCode;
146
+ };
147
+ 'invalid minimum price tick size': {
148
+ message: string;
149
+ code: ChainExchangeModuleErrorCode;
150
+ };
151
+ 'invalid minimum quantity tick size': {
152
+ message: string;
153
+ code: ChainExchangeModuleErrorCode;
154
+ };
155
+ 'invalid minimum order margin': {
156
+ message: string;
157
+ code: ChainExchangeModuleErrorCode;
158
+ };
159
+ 'exceeds order side count': {
160
+ message: string;
161
+ code: ChainExchangeModuleErrorCode;
162
+ };
163
+ 'subaccount cannot place a market order when a market order in the same market was already placed in same block': {
164
+ message: string;
165
+ code: ChainExchangeModuleErrorCode;
166
+ };
167
+ 'cannot place a conditional market order when a conditional market order in same relative direction already exists': {
168
+ message: string;
169
+ code: ChainExchangeModuleErrorCode;
170
+ };
171
+ 'an equivalent market launch proposal already exists.': {
172
+ message: string;
173
+ code: ChainExchangeModuleErrorCode;
174
+ };
175
+ 'invalid market status': {
176
+ message: string;
177
+ code: ChainExchangeModuleErrorCode;
178
+ };
179
+ 'base denom cannot be same with quote denom': {
180
+ message: string;
181
+ code: ChainExchangeModuleErrorCode;
182
+ };
183
+ 'oracle base cannot be same with oracle quote': {
184
+ message: string;
185
+ code: ChainExchangeModuleErrorCode;
186
+ };
187
+ 'makerfeerate does not match takerfeeeate requirements': {
188
+ message: string;
189
+ code: ChainExchangeModuleErrorCode;
190
+ };
191
+ 'maintenancemarginratio cannot be greater than initialmarginratio': {
192
+ message: string;
193
+ code: ChainExchangeModuleErrorCode;
194
+ };
195
+ 'oraclescalefactor cannot be greater than maxoraclescalefactor': {
196
+ message: string;
197
+ code: ChainExchangeModuleErrorCode;
198
+ };
199
+ 'spot exchange is not enabled yet': {
200
+ message: string;
201
+ code: ChainExchangeModuleErrorCode;
202
+ };
203
+ 'derivatives exchange is not enabled yet': {
204
+ message: string;
205
+ code: ChainExchangeModuleErrorCode;
206
+ };
207
+ 'oracle price delta exceeds threshold': {
208
+ message: string;
209
+ code: ChainExchangeModuleErrorCode;
210
+ };
211
+ 'invalid hourly interest rate': {
212
+ message: string;
213
+ code: ChainExchangeModuleErrorCode;
214
+ };
215
+ 'invalid hourly funding rate cap': {
216
+ message: string;
217
+ code: ChainExchangeModuleErrorCode;
218
+ };
219
+ 'only perpetual markets can update funding parameters': {
220
+ message: string;
221
+ code: ChainExchangeModuleErrorCode;
222
+ };
223
+ 'invalid trading reward campaign': {
224
+ message: string;
225
+ code: ChainExchangeModuleErrorCode;
226
+ };
227
+ 'invalid fee discount schedule': {
228
+ message: string;
229
+ code: ChainExchangeModuleErrorCode;
230
+ };
231
+ 'invalid liquidation order': {
232
+ message: string;
233
+ code: ChainExchangeModuleErrorCode;
234
+ };
235
+ 'unknown error happened for campaign distributions': {
236
+ message: string;
237
+ code: ChainExchangeModuleErrorCode;
238
+ };
239
+ 'invalid trading reward points update': {
240
+ message: string;
241
+ code: ChainExchangeModuleErrorCode;
242
+ };
243
+ 'invalid batch msg update': {
244
+ message: string;
245
+ code: ChainExchangeModuleErrorCode;
246
+ };
247
+ 'post-only order exceeds top of book price': {
248
+ message: string;
249
+ code: ChainExchangeModuleErrorCode;
250
+ };
251
+ 'order type not supported for given message': {
252
+ message: string;
253
+ code: ChainExchangeModuleErrorCode;
254
+ };
255
+ 'sender must match dmm account': {
256
+ message: string;
257
+ code: ChainExchangeModuleErrorCode;
258
+ };
259
+ 'already opted out of rewards': {
260
+ message: string;
261
+ code: ChainExchangeModuleErrorCode;
262
+ };
263
+ 'invalid margin ratio': {
264
+ message: string;
265
+ code: ChainExchangeModuleErrorCode;
266
+ };
267
+ 'provided funds are below minimum': {
268
+ message: string;
269
+ code: ChainExchangeModuleErrorCode;
270
+ };
271
+ 'position is below initial margin requirement': {
272
+ message: string;
273
+ code: ChainExchangeModuleErrorCode;
274
+ };
275
+ 'pool has non-positive total lp token supply': {
276
+ message: string;
277
+ code: ChainExchangeModuleErrorCode;
278
+ };
279
+ 'passed lp token burn amount is greater than total lp token supply': {
280
+ message: string;
281
+ code: ChainExchangeModuleErrorCode;
282
+ };
283
+ 'unsupported action': {
284
+ message: string;
285
+ code: ChainExchangeModuleErrorCode;
286
+ };
287
+ 'position quantity cannot be negative': {
288
+ message: string;
289
+ code: ChainExchangeModuleErrorCode;
290
+ };
291
+ 'binary options market exists': {
292
+ message: string;
293
+ code: ChainExchangeModuleErrorCode;
294
+ };
295
+ 'binary options market not found': {
296
+ message: string;
297
+ code: ChainExchangeModuleErrorCode;
298
+ };
299
+ 'invalid settlement': {
300
+ message: string;
301
+ code: ChainExchangeModuleErrorCode;
302
+ };
303
+ 'account doesnt exist': {
304
+ message: string;
305
+ code: ChainExchangeModuleErrorCode;
306
+ };
307
+ 'sender should be a market admin': {
308
+ message: string;
309
+ code: ChainExchangeModuleErrorCode;
310
+ };
311
+ 'market is already scheduled to settle': {
312
+ message: string;
313
+ code: ChainExchangeModuleErrorCode;
314
+ };
315
+ 'market not found': {
316
+ message: string;
317
+ code: ChainExchangeModuleErrorCode;
318
+ };
319
+ 'denom decimal cannot be below 1 or above max scale factor': {
320
+ message: string;
321
+ code: ChainExchangeModuleErrorCode;
322
+ };
323
+ 'state is invalid': {
324
+ message: string;
325
+ code: ChainExchangeModuleErrorCode;
326
+ };
327
+ 'transient orders up to cancellation not supported': {
328
+ message: string;
329
+ code: ChainExchangeModuleErrorCode;
330
+ };
331
+ 'invalid trade': {
332
+ message: string;
333
+ code: ChainExchangeModuleErrorCode;
334
+ };
335
+ 'no margin locked in subaccount': {
336
+ message: string;
337
+ code: ChainExchangeModuleErrorCode;
338
+ };
339
+ 'Invalid access level to perform action': {
340
+ message: string;
341
+ code: ChainExchangeModuleErrorCode;
342
+ };
343
+ 'Invalid address': {
344
+ message: string;
345
+ code: ChainExchangeModuleErrorCode;
346
+ };
347
+ 'Invalid argument': {
348
+ message: string;
349
+ code: ChainExchangeModuleErrorCode;
350
+ };
351
+ };
352
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAE5E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqbvB,CAAA"}