@hashpower/collateral-abi 0.1.0 → 0.2.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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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"
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "collateral-margin-abi",
3
+ "type": "module",
4
+ "exports": {
5
+ "./*": "./*"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashpower/collateral-abi",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "ABIs and deployment addresses for the Hashpower unified collateral system (CollateralVault, PortfolioMarginEngine, Points) on Base",
5
5
  "license": "MIT",
6
6
  "type": "module",