@dhedge/backend-flatcoin-core 0.1.19 → 0.1.20

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.
@@ -0,0 +1,436 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "uint256",
6
+ "name": "amount",
7
+ "type": "uint256"
8
+ },
9
+ {
10
+ "internalType": "uint256",
11
+ "name": "minAmount",
12
+ "type": "uint256"
13
+ }
14
+ ],
15
+ "name": "AmountTooSmall",
16
+ "type": "error"
17
+ },
18
+ {
19
+ "inputs": [
20
+ {
21
+ "internalType": "uint256",
22
+ "name": "executableTime",
23
+ "type": "uint256"
24
+ }
25
+ ],
26
+ "name": "ExecutableTimeNotReached",
27
+ "type": "error"
28
+ },
29
+ {
30
+ "inputs": [
31
+ {
32
+ "internalType": "uint256",
33
+ "name": "supplied",
34
+ "type": "uint256"
35
+ },
36
+ {
37
+ "internalType": "uint256",
38
+ "name": "accepted",
39
+ "type": "uint256"
40
+ }
41
+ ],
42
+ "name": "HighSlippage",
43
+ "type": "error"
44
+ },
45
+ {
46
+ "inputs": [
47
+ {
48
+ "internalType": "uint256",
49
+ "name": "fee",
50
+ "type": "uint256"
51
+ }
52
+ ],
53
+ "name": "InvalidFee",
54
+ "type": "error"
55
+ },
56
+ {
57
+ "inputs": [
58
+ {
59
+ "internalType": "string",
60
+ "name": "variableName",
61
+ "type": "string"
62
+ }
63
+ ],
64
+ "name": "InvariantViolation",
65
+ "type": "error"
66
+ },
67
+ {
68
+ "inputs": [
69
+ {
70
+ "internalType": "uint256",
71
+ "name": "maxFillPrice",
72
+ "type": "uint256"
73
+ },
74
+ {
75
+ "internalType": "uint256",
76
+ "name": "leverageModifyFillPrice",
77
+ "type": "uint256"
78
+ }
79
+ ],
80
+ "name": "MaxFillPriceTooLow",
81
+ "type": "error"
82
+ },
83
+ {
84
+ "inputs": [
85
+ {
86
+ "internalType": "uint256",
87
+ "name": "minFillPrice",
88
+ "type": "uint256"
89
+ },
90
+ {
91
+ "internalType": "uint256",
92
+ "name": "leverageModifyFillPrice",
93
+ "type": "uint256"
94
+ }
95
+ ],
96
+ "name": "MinFillPriceTooHigh",
97
+ "type": "error"
98
+ },
99
+ {
100
+ "inputs": [
101
+ {
102
+ "internalType": "enum IDelayedOrder.OrderType",
103
+ "name": "orderType",
104
+ "type": "uint8"
105
+ }
106
+ ],
107
+ "name": "NoPendingOrderAllowed",
108
+ "type": "error"
109
+ },
110
+ {
111
+ "inputs": [
112
+ {
113
+ "internalType": "address",
114
+ "name": "account",
115
+ "type": "address"
116
+ },
117
+ {
118
+ "internalType": "uint256",
119
+ "name": "totalBalance",
120
+ "type": "uint256"
121
+ },
122
+ {
123
+ "internalType": "uint256",
124
+ "name": "withdrawAmount",
125
+ "type": "uint256"
126
+ }
127
+ ],
128
+ "name": "NotEnoughBalanceForWithdraw",
129
+ "type": "error"
130
+ },
131
+ {
132
+ "inputs": [
133
+ {
134
+ "internalType": "int256",
135
+ "name": "marginAmount",
136
+ "type": "int256"
137
+ },
138
+ {
139
+ "internalType": "uint256",
140
+ "name": "feeAmount",
141
+ "type": "uint256"
142
+ }
143
+ ],
144
+ "name": "NotEnoughMarginForFees",
145
+ "type": "error"
146
+ },
147
+ {
148
+ "inputs": [
149
+ {
150
+ "internalType": "uint256",
151
+ "name": "tokenId",
152
+ "type": "uint256"
153
+ },
154
+ {
155
+ "internalType": "address",
156
+ "name": "msgSender",
157
+ "type": "address"
158
+ }
159
+ ],
160
+ "name": "NotTokenOwner",
161
+ "type": "error"
162
+ },
163
+ {
164
+ "inputs": [
165
+ {
166
+ "internalType": "address",
167
+ "name": "msgSender",
168
+ "type": "address"
169
+ }
170
+ ],
171
+ "name": "OnlyOwner",
172
+ "type": "error"
173
+ },
174
+ {
175
+ "inputs": [],
176
+ "name": "OrderHasExpired",
177
+ "type": "error"
178
+ },
179
+ {
180
+ "inputs": [],
181
+ "name": "OrderHasNotExpired",
182
+ "type": "error"
183
+ },
184
+ {
185
+ "inputs": [
186
+ {
187
+ "internalType": "bytes32",
188
+ "name": "moduleKey",
189
+ "type": "bytes32"
190
+ }
191
+ ],
192
+ "name": "Paused",
193
+ "type": "error"
194
+ },
195
+ {
196
+ "inputs": [
197
+ {
198
+ "internalType": "string",
199
+ "name": "variableName",
200
+ "type": "string"
201
+ }
202
+ ],
203
+ "name": "ZeroAddress",
204
+ "type": "error"
205
+ },
206
+ {
207
+ "inputs": [
208
+ {
209
+ "internalType": "string",
210
+ "name": "variableName",
211
+ "type": "string"
212
+ }
213
+ ],
214
+ "name": "ZeroValue",
215
+ "type": "error"
216
+ },
217
+ {
218
+ "inputs": [
219
+ {
220
+ "internalType": "uint256",
221
+ "name": "collateralCap",
222
+ "type": "uint256"
223
+ }
224
+ ],
225
+ "name": "DepositCapReached",
226
+ "type": "error"
227
+ },
228
+ {
229
+ "inputs": [
230
+ {
231
+ "internalType": "uint256",
232
+ "name": "skewFractionMax",
233
+ "type": "uint256"
234
+ }
235
+ ],
236
+ "name": "InvalidSkewFractionMax",
237
+ "type": "error"
238
+ },
239
+ {
240
+ "inputs": [],
241
+ "name": "MarginMismatchOnClose",
242
+ "type": "error"
243
+ },
244
+ {
245
+ "inputs": [
246
+ {
247
+ "internalType": "uint256",
248
+ "name": "skewFraction",
249
+ "type": "uint256"
250
+ }
251
+ ],
252
+ "name": "MaxSkewReached",
253
+ "type": "error"
254
+ },
255
+ {
256
+ "inputs": [
257
+ {
258
+ "internalType": "address",
259
+ "name": "msgSender",
260
+ "type": "address"
261
+ }
262
+ ],
263
+ "name": "OnlyAuthorizedModule",
264
+ "type": "error"
265
+ },
266
+ {
267
+ "inputs": [
268
+ {
269
+ "internalType": "uint256",
270
+ "name": "tokenId",
271
+ "type": "uint256"
272
+ }
273
+ ],
274
+ "name": "TaskNotFound",
275
+ "type": "error"
276
+ },
277
+ {
278
+ "inputs": [],
279
+ "name": "AdjustNotAllowed",
280
+ "type": "error"
281
+ },
282
+ {
283
+ "inputs": [],
284
+ "name": "InvalidLeverageCriteria",
285
+ "type": "error"
286
+ },
287
+ {
288
+ "inputs": [
289
+ {
290
+ "internalType": "uint256",
291
+ "name": "leverageMax",
292
+ "type": "uint256"
293
+ },
294
+ {
295
+ "internalType": "uint256",
296
+ "name": "leverage",
297
+ "type": "uint256"
298
+ }
299
+ ],
300
+ "name": "LeverageTooHigh",
301
+ "type": "error"
302
+ },
303
+ {
304
+ "inputs": [
305
+ {
306
+ "internalType": "uint256",
307
+ "name": "leverageMin",
308
+ "type": "uint256"
309
+ },
310
+ {
311
+ "internalType": "uint256",
312
+ "name": "leverage",
313
+ "type": "uint256"
314
+ }
315
+ ],
316
+ "name": "LeverageTooLow",
317
+ "type": "error"
318
+ },
319
+ {
320
+ "inputs": [
321
+ {
322
+ "internalType": "uint256",
323
+ "name": "marginMin",
324
+ "type": "uint256"
325
+ },
326
+ {
327
+ "internalType": "uint256",
328
+ "name": "margin",
329
+ "type": "uint256"
330
+ }
331
+ ],
332
+ "name": "MarginTooSmall",
333
+ "type": "error"
334
+ },
335
+ {
336
+ "inputs": [
337
+ {
338
+ "internalType": "int256",
339
+ "name": "settledMargin",
340
+ "type": "int256"
341
+ }
342
+ ],
343
+ "name": "SettledMarginNotPositive",
344
+ "type": "error"
345
+ },
346
+ {
347
+ "inputs": [
348
+ {
349
+ "internalType": "uint256",
350
+ "name": "tokenId",
351
+ "type": "uint256"
352
+ }
353
+ ],
354
+ "name": "CannotLiquidate",
355
+ "type": "error"
356
+ },
357
+ {
358
+ "inputs": [
359
+ {
360
+ "internalType": "uint256",
361
+ "name": "lower",
362
+ "type": "uint256"
363
+ },
364
+ {
365
+ "internalType": "uint256",
366
+ "name": "upper",
367
+ "type": "uint256"
368
+ }
369
+ ],
370
+ "name": "InvalidBounds",
371
+ "type": "error"
372
+ },
373
+ {
374
+ "inputs": [],
375
+ "name": "ETHPriceExpired",
376
+ "type": "error"
377
+ },
378
+ {
379
+ "inputs": [],
380
+ "name": "ETHPriceInvalid",
381
+ "type": "error"
382
+ },
383
+ {
384
+ "inputs": [
385
+ {
386
+ "internalType": "enum FlatcoinErrors.PriceSource",
387
+ "name": "priceSource",
388
+ "type": "uint8"
389
+ }
390
+ ],
391
+ "name": "PriceExpired",
392
+ "type": "error"
393
+ },
394
+ {
395
+ "inputs": [
396
+ {
397
+ "internalType": "enum FlatcoinErrors.PriceSource",
398
+ "name": "priceSource",
399
+ "type": "uint8"
400
+ }
401
+ ],
402
+ "name": "PriceInvalid",
403
+ "type": "error"
404
+ },
405
+ {
406
+ "inputs": [],
407
+ "name": "OracleConfigInvalid",
408
+ "type": "error"
409
+ },
410
+ {
411
+ "inputs": [
412
+ {
413
+ "internalType": "uint256",
414
+ "name": "diffPercent",
415
+ "type": "uint256"
416
+ }
417
+ ],
418
+ "name": "PriceMismatch",
419
+ "type": "error"
420
+ },
421
+ {
422
+ "inputs": [],
423
+ "name": "RefundFailed",
424
+ "type": "error"
425
+ },
426
+ {
427
+ "inputs": [],
428
+ "name": "PriceImpactDuringFullWithdraw",
429
+ "type": "error"
430
+ },
431
+ {
432
+ "inputs": [],
433
+ "name": "PriceImpactDuringWithdraw",
434
+ "type": "error"
435
+ }
436
+ ]
@@ -0,0 +1,2 @@
1
+ import { utils } from 'ethers';
2
+ export declare const createInterfaceInstance: (abi: unknown) => utils.Interface;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createInterfaceInstance = void 0;
4
+ const ethers_1 = require("ethers");
5
+ const createInterfaceInstance = (abi) => new ethers_1.utils.Interface(abi);
6
+ exports.createInterfaceInstance = createInterfaceInstance;
@@ -2,3 +2,6 @@ import * as FlatcoinV1 from '../contracts/abi/FlatcoinV1.json';
2
2
  export { FlatcoinV1 };
3
3
  import * as Viewer from '../contracts/abi/Viewer.json';
4
4
  export { Viewer };
5
+ import * as FlatcoinErrors from '../contracts/abi/FlatcoinErrors.json';
6
+ export { FlatcoinErrors };
7
+ export * from './helpers';
@@ -22,9 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Viewer = exports.FlatcoinV1 = void 0;
29
+ exports.FlatcoinErrors = exports.Viewer = exports.FlatcoinV1 = void 0;
27
30
  const FlatcoinV1 = __importStar(require("../contracts/abi/FlatcoinV1.json"));
28
31
  exports.FlatcoinV1 = FlatcoinV1;
29
32
  const Viewer = __importStar(require("../contracts/abi/Viewer.json"));
30
33
  exports.Viewer = Viewer;
34
+ const FlatcoinErrors = __importStar(require("../contracts/abi/FlatcoinErrors.json"));
35
+ exports.FlatcoinErrors = FlatcoinErrors;
36
+ __exportStar(require("./helpers"), exports);
@@ -9,3 +9,4 @@ export * from './apy-history';
9
9
  export * from './flatcoin-pnl';
10
10
  export * from './period-performance';
11
11
  export * from './flatcoin-pnl';
12
+ export * from './competitionBoardAccount';
@@ -25,3 +25,4 @@ __exportStar(require("./apy-history"), exports);
25
25
  __exportStar(require("./flatcoin-pnl"), exports);
26
26
  __exportStar(require("./period-performance"), exports);
27
27
  __exportStar(require("./flatcoin-pnl"), exports);
28
+ __exportStar(require("./competitionBoardAccount"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/backend-flatcoin-core",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Backend Flatcoin Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",