@dhedge/backend-flatcoin-core 0.1.20 → 0.1.22

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