@hashpower/collateral-abi 0.1.0 → 0.3.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.
@@ -36,16 +36,46 @@ export const PortfolioMarginEngineAbi = [
36
36
  "name": "FailedCall",
37
37
  "type": "error"
38
38
  },
39
+ {
40
+ "inputs": [],
41
+ "name": "InvalidDependency",
42
+ "type": "error"
43
+ },
39
44
  {
40
45
  "inputs": [],
41
46
  "name": "InvalidInitialization",
42
47
  "type": "error"
43
48
  },
49
+ {
50
+ "inputs": [],
51
+ "name": "InvalidOracle",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "inputs": [],
56
+ "name": "LinearMarketAlreadyRegistered",
57
+ "type": "error"
58
+ },
59
+ {
60
+ "inputs": [],
61
+ "name": "LinearMarketNotRegistered",
62
+ "type": "error"
63
+ },
44
64
  {
45
65
  "inputs": [],
46
66
  "name": "NotInitializing",
47
67
  "type": "error"
48
68
  },
69
+ {
70
+ "inputs": [],
71
+ "name": "OracleNotSet",
72
+ "type": "error"
73
+ },
74
+ {
75
+ "inputs": [],
76
+ "name": "OracleStale",
77
+ "type": "error"
78
+ },
49
79
  {
50
80
  "inputs": [
51
81
  {
@@ -84,6 +114,11 @@ export const PortfolioMarginEngineAbi = [
84
114
  "name": "UUPSUnsupportedProxiableUUID",
85
115
  "type": "error"
86
116
  },
117
+ {
118
+ "inputs": [],
119
+ "name": "VaultMismatch",
120
+ "type": "error"
121
+ },
87
122
  {
88
123
  "inputs": [],
89
124
  "name": "ZeroAddress",
@@ -94,25 +129,38 @@ export const PortfolioMarginEngineAbi = [
94
129
  "inputs": [
95
130
  {
96
131
  "indexed": false,
132
+ "internalType": "uint64",
133
+ "name": "version",
134
+ "type": "uint64"
135
+ }
136
+ ],
137
+ "name": "Initialized",
138
+ "type": "event"
139
+ },
140
+ {
141
+ "anonymous": false,
142
+ "inputs": [
143
+ {
144
+ "indexed": true,
97
145
  "internalType": "address",
98
- "name": "futures",
146
+ "name": "market",
99
147
  "type": "address"
100
148
  }
101
149
  ],
102
- "name": "FuturesUpdated",
150
+ "name": "LinearMarketAdded",
103
151
  "type": "event"
104
152
  },
105
153
  {
106
154
  "anonymous": false,
107
155
  "inputs": [
108
156
  {
109
- "indexed": false,
110
- "internalType": "uint64",
111
- "name": "version",
112
- "type": "uint64"
157
+ "indexed": true,
158
+ "internalType": "address",
159
+ "name": "market",
160
+ "type": "address"
113
161
  }
114
162
  ],
115
- "name": "Initialized",
163
+ "name": "LinearMarketRemoved",
116
164
  "type": "event"
117
165
  },
118
166
  {
@@ -132,32 +180,32 @@ export const PortfolioMarginEngineAbi = [
132
180
  "anonymous": false,
133
181
  "inputs": [
134
182
  {
135
- "indexed": true,
136
- "internalType": "address",
137
- "name": "previousOwner",
138
- "type": "address"
139
- },
140
- {
141
- "indexed": true,
183
+ "indexed": false,
142
184
  "internalType": "address",
143
- "name": "newOwner",
185
+ "name": "oracle",
144
186
  "type": "address"
145
187
  }
146
188
  ],
147
- "name": "OwnershipTransferred",
189
+ "name": "OracleUpdated",
148
190
  "type": "event"
149
191
  },
150
192
  {
151
193
  "anonymous": false,
152
194
  "inputs": [
153
195
  {
154
- "indexed": false,
196
+ "indexed": true,
155
197
  "internalType": "address",
156
- "name": "perpsDex",
198
+ "name": "previousOwner",
199
+ "type": "address"
200
+ },
201
+ {
202
+ "indexed": true,
203
+ "internalType": "address",
204
+ "name": "newOwner",
157
205
  "type": "address"
158
206
  }
159
207
  ],
160
- "name": "PerpsDexUpdated",
208
+ "name": "OwnershipTransferred",
161
209
  "type": "event"
162
210
  },
163
211
  {
@@ -243,6 +291,19 @@ export const PortfolioMarginEngineAbi = [
243
291
  "stateMutability": "view",
244
292
  "type": "function"
245
293
  },
294
+ {
295
+ "inputs": [
296
+ {
297
+ "internalType": "address",
298
+ "name": "_market",
299
+ "type": "address"
300
+ }
301
+ ],
302
+ "name": "addLinearMarket",
303
+ "outputs": [],
304
+ "stateMutability": "nonpayable",
305
+ "type": "function"
306
+ },
246
307
  {
247
308
  "inputs": [
248
309
  {
@@ -305,16 +366,59 @@ export const PortfolioMarginEngineAbi = [
305
366
  "stateMutability": "view",
306
367
  "type": "function"
307
368
  },
369
+ {
370
+ "inputs": [
371
+ {
372
+ "internalType": "address",
373
+ "name": "user",
374
+ "type": "address"
375
+ }
376
+ ],
377
+ "name": "computePortfolioMargins",
378
+ "outputs": [
379
+ {
380
+ "internalType": "uint256",
381
+ "name": "im",
382
+ "type": "uint256"
383
+ },
384
+ {
385
+ "internalType": "uint256",
386
+ "name": "mm",
387
+ "type": "uint256"
388
+ }
389
+ ],
390
+ "stateMutability": "view",
391
+ "type": "function"
392
+ },
308
393
  {
309
394
  "inputs": [],
310
- "name": "futures",
395
+ "name": "getLinearMarkets",
311
396
  "outputs": [
312
397
  {
313
- "internalType": "contract IFutures",
398
+ "internalType": "address[]",
314
399
  "name": "",
400
+ "type": "address[]"
401
+ }
402
+ ],
403
+ "stateMutability": "view",
404
+ "type": "function"
405
+ },
406
+ {
407
+ "inputs": [
408
+ {
409
+ "internalType": "address",
410
+ "name": "user",
315
411
  "type": "address"
316
412
  }
317
413
  ],
414
+ "name": "hasRestingOrderDelta",
415
+ "outputs": [
416
+ {
417
+ "internalType": "bool",
418
+ "name": "",
419
+ "type": "bool"
420
+ }
421
+ ],
318
422
  "stateMutability": "view",
319
423
  "type": "function"
320
424
  },
@@ -344,17 +448,37 @@ export const PortfolioMarginEngineAbi = [
344
448
  "stateMutability": "view",
345
449
  "type": "function"
346
450
  },
451
+ {
452
+ "inputs": [],
453
+ "name": "initialize",
454
+ "outputs": [],
455
+ "stateMutability": "nonpayable",
456
+ "type": "function"
457
+ },
458
+ {
459
+ "inputs": [],
460
+ "name": "initializeV2",
461
+ "outputs": [],
462
+ "stateMutability": "nonpayable",
463
+ "type": "function"
464
+ },
347
465
  {
348
466
  "inputs": [
349
467
  {
350
468
  "internalType": "address",
351
- "name": "_vault",
469
+ "name": "user",
352
470
  "type": "address"
353
471
  }
354
472
  ],
355
- "name": "initialize",
356
- "outputs": [],
357
- "stateMutability": "nonpayable",
473
+ "name": "isHealthy",
474
+ "outputs": [
475
+ {
476
+ "internalType": "bool",
477
+ "name": "",
478
+ "type": "bool"
479
+ }
480
+ ],
481
+ "stateMutability": "view",
358
482
  "type": "function"
359
483
  },
360
484
  {
@@ -365,7 +489,7 @@ export const PortfolioMarginEngineAbi = [
365
489
  "type": "address"
366
490
  }
367
491
  ],
368
- "name": "isHealthy",
492
+ "name": "isLiquidatable",
369
493
  "outputs": [
370
494
  {
371
495
  "internalType": "bool",
@@ -376,6 +500,25 @@ export const PortfolioMarginEngineAbi = [
376
500
  "stateMutability": "view",
377
501
  "type": "function"
378
502
  },
503
+ {
504
+ "inputs": [
505
+ {
506
+ "internalType": "uint256",
507
+ "name": "notional",
508
+ "type": "uint256"
509
+ }
510
+ ],
511
+ "name": "linearOrderMargin",
512
+ "outputs": [
513
+ {
514
+ "internalType": "uint256",
515
+ "name": "",
516
+ "type": "uint256"
517
+ }
518
+ ],
519
+ "stateMutability": "view",
520
+ "type": "function"
521
+ },
379
522
  {
380
523
  "inputs": [],
381
524
  "name": "mmSpotShock",
@@ -415,6 +558,25 @@ export const PortfolioMarginEngineAbi = [
415
558
  "stateMutability": "view",
416
559
  "type": "function"
417
560
  },
561
+ {
562
+ "inputs": [
563
+ {
564
+ "internalType": "address",
565
+ "name": "user",
566
+ "type": "address"
567
+ }
568
+ ],
569
+ "name": "orderMarginOf",
570
+ "outputs": [
571
+ {
572
+ "internalType": "uint256",
573
+ "name": "",
574
+ "type": "uint256"
575
+ }
576
+ ],
577
+ "stateMutability": "view",
578
+ "type": "function"
579
+ },
418
580
  {
419
581
  "inputs": [],
420
582
  "name": "owner",
@@ -430,10 +592,10 @@ export const PortfolioMarginEngineAbi = [
430
592
  },
431
593
  {
432
594
  "inputs": [],
433
- "name": "perpsDex",
595
+ "name": "priceOracle",
434
596
  "outputs": [
435
597
  {
436
- "internalType": "contract IHashPowerPerpsDEX",
598
+ "internalType": "contract AggregatorV3Interface",
437
599
  "name": "",
438
600
  "type": "address"
439
601
  }
@@ -454,22 +616,22 @@ export const PortfolioMarginEngineAbi = [
454
616
  "stateMutability": "view",
455
617
  "type": "function"
456
618
  },
457
- {
458
- "inputs": [],
459
- "name": "renounceOwnership",
460
- "outputs": [],
461
- "stateMutability": "nonpayable",
462
- "type": "function"
463
- },
464
619
  {
465
620
  "inputs": [
466
621
  {
467
622
  "internalType": "address",
468
- "name": "_futuresEngine",
623
+ "name": "_market",
469
624
  "type": "address"
470
625
  }
471
626
  ],
472
- "name": "setFutures",
627
+ "name": "removeLinearMarket",
628
+ "outputs": [],
629
+ "stateMutability": "nonpayable",
630
+ "type": "function"
631
+ },
632
+ {
633
+ "inputs": [],
634
+ "name": "renounceOwnership",
473
635
  "outputs": [],
474
636
  "stateMutability": "nonpayable",
475
637
  "type": "function"
@@ -490,12 +652,12 @@ export const PortfolioMarginEngineAbi = [
490
652
  {
491
653
  "inputs": [
492
654
  {
493
- "internalType": "address",
494
- "name": "_perpsEngine",
655
+ "internalType": "contract AggregatorV3Interface",
656
+ "name": "_oracle",
495
657
  "type": "address"
496
658
  }
497
659
  ],
498
- "name": "setPerps",
660
+ "name": "setOracle",
499
661
  "outputs": [],
500
662
  "stateMutability": "nonpayable",
501
663
  "type": "function"
@@ -127,6 +127,11 @@
127
127
  "name": "FunctionDisabled",
128
128
  "type": "error"
129
129
  },
130
+ {
131
+ "inputs": [],
132
+ "name": "InvalidDependency",
133
+ "type": "error"
134
+ },
130
135
  {
131
136
  "inputs": [],
132
137
  "name": "InvalidInitialization",
@@ -196,6 +201,11 @@
196
201
  "name": "UUPSUnsupportedProxiableUUID",
197
202
  "type": "error"
198
203
  },
204
+ {
205
+ "inputs": [],
206
+ "name": "VaultMismatch",
207
+ "type": "error"
208
+ },
199
209
  {
200
210
  "inputs": [],
201
211
  "name": "ZeroAddress",
@@ -4,6 +4,11 @@
4
4
  "name": "NoPoints",
5
5
  "type": "error"
6
6
  },
7
+ {
8
+ "inputs": [],
9
+ "name": "OracleStale",
10
+ "type": "error"
11
+ },
7
12
  {
8
13
  "inputs": [
9
14
  {
@@ -100,11 +105,21 @@
100
105
  "name": "AccessControlBadConfirmation",
101
106
  "type": "error"
102
107
  },
108
+ {
109
+ "inputs": [],
110
+ "name": "LinearMarketAlreadyRegistered",
111
+ "type": "error"
112
+ },
103
113
  {
104
114
  "inputs": [],
105
115
  "name": "NotEnabled",
106
116
  "type": "error"
107
117
  },
118
+ {
119
+ "inputs": [],
120
+ "name": "LinearMarketNotRegistered",
121
+ "type": "error"
122
+ },
108
123
  {
109
124
  "inputs": [],
110
125
  "name": "TransfersDisabled",
@@ -126,6 +141,11 @@
126
141
  "name": "ERC20InvalidSpender",
127
142
  "type": "error"
128
143
  },
144
+ {
145
+ "inputs": [],
146
+ "name": "InvalidOracle",
147
+ "type": "error"
148
+ },
129
149
  {
130
150
  "inputs": [
131
151
  {
@@ -169,6 +189,16 @@
169
189
  "name": "FunctionDisabled",
170
190
  "type": "error"
171
191
  },
192
+ {
193
+ "inputs": [],
194
+ "name": "VaultMismatch",
195
+ "type": "error"
196
+ },
197
+ {
198
+ "inputs": [],
199
+ "name": "InvalidDependency",
200
+ "type": "error"
201
+ },
172
202
  {
173
203
  "inputs": [],
174
204
  "name": "FailedCall",
@@ -268,6 +298,11 @@
268
298
  "name": "MintingFinalized",
269
299
  "type": "error"
270
300
  },
301
+ {
302
+ "inputs": [],
303
+ "name": "OracleNotSet",
304
+ "type": "error"
305
+ },
271
306
  {
272
307
  "inputs": [],
273
308
  "name": "InvalidInitialization",
@@ -37,6 +37,49 @@
37
37
  "stateMutability": "view",
38
38
  "type": "function"
39
39
  },
40
+ {
41
+ "inputs": [
42
+ {
43
+ "internalType": "address",
44
+ "name": "user",
45
+ "type": "address"
46
+ }
47
+ ],
48
+ "name": "computePortfolioMargins",
49
+ "outputs": [
50
+ {
51
+ "internalType": "uint256",
52
+ "name": "im",
53
+ "type": "uint256"
54
+ },
55
+ {
56
+ "internalType": "uint256",
57
+ "name": "mm",
58
+ "type": "uint256"
59
+ }
60
+ ],
61
+ "stateMutability": "view",
62
+ "type": "function"
63
+ },
64
+ {
65
+ "inputs": [
66
+ {
67
+ "internalType": "address",
68
+ "name": "user",
69
+ "type": "address"
70
+ }
71
+ ],
72
+ "name": "hasRestingOrderDelta",
73
+ "outputs": [
74
+ {
75
+ "internalType": "bool",
76
+ "name": "",
77
+ "type": "bool"
78
+ }
79
+ ],
80
+ "stateMutability": "view",
81
+ "type": "function"
82
+ },
40
83
  {
41
84
  "inputs": [],
42
85
  "name": "imSpotShock",
@@ -50,6 +93,44 @@
50
93
  "stateMutability": "view",
51
94
  "type": "function"
52
95
  },
96
+ {
97
+ "inputs": [
98
+ {
99
+ "internalType": "address",
100
+ "name": "user",
101
+ "type": "address"
102
+ }
103
+ ],
104
+ "name": "isLiquidatable",
105
+ "outputs": [
106
+ {
107
+ "internalType": "bool",
108
+ "name": "",
109
+ "type": "bool"
110
+ }
111
+ ],
112
+ "stateMutability": "view",
113
+ "type": "function"
114
+ },
115
+ {
116
+ "inputs": [
117
+ {
118
+ "internalType": "uint256",
119
+ "name": "notional",
120
+ "type": "uint256"
121
+ }
122
+ ],
123
+ "name": "linearOrderMargin",
124
+ "outputs": [
125
+ {
126
+ "internalType": "uint256",
127
+ "name": "",
128
+ "type": "uint256"
129
+ }
130
+ ],
131
+ "stateMutability": "view",
132
+ "type": "function"
133
+ },
53
134
  {
54
135
  "inputs": [],
55
136
  "name": "mmSpotShock",
@@ -62,5 +143,37 @@
62
143
  ],
63
144
  "stateMutability": "view",
64
145
  "type": "function"
146
+ },
147
+ {
148
+ "inputs": [
149
+ {
150
+ "internalType": "address",
151
+ "name": "user",
152
+ "type": "address"
153
+ }
154
+ ],
155
+ "name": "orderMarginOf",
156
+ "outputs": [
157
+ {
158
+ "internalType": "uint256",
159
+ "name": "",
160
+ "type": "uint256"
161
+ }
162
+ ],
163
+ "stateMutability": "view",
164
+ "type": "function"
165
+ },
166
+ {
167
+ "inputs": [],
168
+ "name": "vault",
169
+ "outputs": [
170
+ {
171
+ "internalType": "contract ICollateralVault",
172
+ "name": "",
173
+ "type": "address"
174
+ }
175
+ ],
176
+ "stateMutability": "view",
177
+ "type": "function"
65
178
  }
66
179
  ]