afp-sdk 0.1.0__py3-none-any.whl

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,1019 @@
1
+ """ClearingFacet contract binding and data structures."""
2
+
3
+ # This module has been generated using pyabigen v0.2.16
4
+
5
+ import enum
6
+ import typing
7
+ from dataclasses import dataclass
8
+
9
+ import eth_typing
10
+ import hexbytes
11
+ import web3
12
+ from web3.contract import contract
13
+
14
+
15
+ class Side(enum.IntEnum):
16
+ """Port of `enum Side` on the ClearingFacet contract."""
17
+
18
+ BID = 0
19
+ ASK = 1
20
+
21
+
22
+ @dataclass
23
+ class AuctionConfig:
24
+ """Port of `struct AuctionConfig` on the IAuctioneer contract."""
25
+
26
+ restoration_buffer: int
27
+ liquidation_duration: int
28
+
29
+
30
+ @dataclass
31
+ class ClearingConfig:
32
+ """Port of `struct ClearingConfig` on the IClearing contract."""
33
+
34
+ clearing_fee_rate: int
35
+
36
+
37
+ @dataclass
38
+ class Config:
39
+ """Port of `struct Config` on the IClearing contract."""
40
+
41
+ auction_config: AuctionConfig
42
+ clearing_config: ClearingConfig
43
+
44
+
45
+ @dataclass
46
+ class IntentData:
47
+ """Port of `struct IntentData` on the IClearing contract."""
48
+
49
+ nonce: int
50
+ trading_protocol_id: eth_typing.ChecksumAddress
51
+ product_id: hexbytes.HexBytes
52
+ limit_price: int
53
+ quantity: int
54
+ max_trading_fee_rate: int
55
+ good_until: int
56
+ side: Side
57
+
58
+
59
+ @dataclass
60
+ class Intent:
61
+ """Port of `struct Intent` on the IClearing contract."""
62
+
63
+ margin_account_id: eth_typing.ChecksumAddress
64
+ intent_account_id: eth_typing.ChecksumAddress
65
+ hash: hexbytes.HexBytes
66
+ data: IntentData
67
+ signature: hexbytes.HexBytes
68
+
69
+
70
+ @dataclass
71
+ class Trade:
72
+ """Port of `struct Trade` on the IClearing contract."""
73
+
74
+ product_id: hexbytes.HexBytes
75
+ protocol_id: eth_typing.ChecksumAddress
76
+ trade_id: int
77
+ price: int
78
+ timestamp: int
79
+ accounts: typing.List[eth_typing.ChecksumAddress]
80
+ quantities: typing.List[int]
81
+ fee_rates: typing.List[int]
82
+ intents: typing.List[Intent]
83
+
84
+
85
+ class ClearingFacet:
86
+ """ClearingFacet contract binding.
87
+
88
+ Parameters
89
+ ----------
90
+ w3 : web3.Web3
91
+ address : eth_typing.ChecksumAddress
92
+ The address of a deployed ClearingFacet contract.
93
+ """
94
+
95
+ _contract: contract.Contract
96
+
97
+ def __init__(
98
+ self,
99
+ w3: web3.Web3,
100
+ address: eth_typing.ChecksumAddress,
101
+ ):
102
+ self._contract = w3.eth.contract(
103
+ address=address,
104
+ abi=ABI,
105
+ )
106
+
107
+ @property
108
+ def TradeExecuted(self) -> contract.ContractEvent:
109
+ """Binding for `event TradeExecuted` on the ClearingFacet contract."""
110
+ return self._contract.events.TradeExecuted
111
+
112
+ def max_trading_fee_rate(
113
+ self,
114
+ ) -> int:
115
+ """Binding for `MAX_TRADING_FEE_RATE` on the ClearingFacet contract.
116
+
117
+ Returns
118
+ -------
119
+ int
120
+ """
121
+ return_value = self._contract.functions.MAX_TRADING_FEE_RATE().call()
122
+ return int(return_value)
123
+
124
+ def clearing_fee_rate(
125
+ self,
126
+ ) -> int:
127
+ """Binding for `clearingFeeRate` on the ClearingFacet contract.
128
+
129
+ Returns
130
+ -------
131
+ int
132
+ """
133
+ return_value = self._contract.functions.clearingFeeRate().call()
134
+ return int(return_value)
135
+
136
+ def config(
137
+ self,
138
+ ) -> Config:
139
+ """Binding for `config` on the ClearingFacet contract.
140
+
141
+ Returns
142
+ -------
143
+ Config
144
+ """
145
+ return_value = self._contract.functions.config().call()
146
+ return Config(
147
+ AuctionConfig(int(return_value[0][0]), int(return_value[0][1])),
148
+ ClearingConfig(int(return_value[1][0])),
149
+ )
150
+
151
+ def estimate_fees(
152
+ self,
153
+ product_id: hexbytes.HexBytes,
154
+ price: int,
155
+ quantity: int,
156
+ trading_fee_rate: int,
157
+ ) -> typing.Tuple[int, int]:
158
+ """Binding for `estimateFees` on the ClearingFacet contract.
159
+
160
+ Parameters
161
+ ----------
162
+ product_id : hexbytes.HexBytes
163
+ price : int
164
+ quantity : int
165
+ trading_fee_rate : int
166
+
167
+ Returns
168
+ -------
169
+ int
170
+ int
171
+ """
172
+ return_value = self._contract.functions.estimateFees(
173
+ product_id,
174
+ price,
175
+ quantity,
176
+ trading_fee_rate,
177
+ ).call()
178
+ return (
179
+ int(return_value[0]),
180
+ int(return_value[1]),
181
+ )
182
+
183
+ def execute(
184
+ self,
185
+ trade: Trade,
186
+ fallback_on_failure: bool,
187
+ ) -> contract.ContractFunction:
188
+ """Binding for `execute` on the ClearingFacet contract.
189
+
190
+ Parameters
191
+ ----------
192
+ trade : Trade
193
+ fallback_on_failure : bool
194
+
195
+ Returns
196
+ -------
197
+ web3.contract.contract.ContractFunction
198
+ A contract function instance to be sent in a transaction.
199
+ """
200
+ return self._contract.functions.execute(
201
+ (
202
+ trade.product_id,
203
+ trade.protocol_id,
204
+ trade.trade_id,
205
+ trade.price,
206
+ trade.timestamp,
207
+ trade.accounts,
208
+ trade.quantities,
209
+ trade.fee_rates,
210
+ [
211
+ (
212
+ trade_item.margin_account_id,
213
+ trade_item.intent_account_id,
214
+ trade_item.hash,
215
+ (
216
+ trade_item.data.nonce,
217
+ trade_item.data.trading_protocol_id,
218
+ trade_item.data.product_id,
219
+ trade_item.data.limit_price,
220
+ trade_item.data.quantity,
221
+ trade_item.data.max_trading_fee_rate,
222
+ trade_item.data.good_until,
223
+ int(trade_item.data.side),
224
+ ),
225
+ trade_item.signature,
226
+ )
227
+ for trade_item in trade.intents
228
+ ],
229
+ ),
230
+ fallback_on_failure,
231
+ )
232
+
233
+ def finalize_initialization(
234
+ self,
235
+ margin_account_registry: eth_typing.ChecksumAddress,
236
+ ) -> contract.ContractFunction:
237
+ """Binding for `finalizeInitialization` on the ClearingFacet contract.
238
+
239
+ Parameters
240
+ ----------
241
+ margin_account_registry : eth_typing.ChecksumAddress
242
+
243
+ Returns
244
+ -------
245
+ web3.contract.contract.ContractFunction
246
+ A contract function instance to be sent in a transaction.
247
+ """
248
+ return self._contract.functions.finalizeInitialization(
249
+ margin_account_registry,
250
+ )
251
+
252
+ def get_admin(
253
+ self,
254
+ ) -> eth_typing.ChecksumAddress:
255
+ """Binding for `getAdmin` on the ClearingFacet contract.
256
+
257
+ Returns
258
+ -------
259
+ eth_typing.ChecksumAddress
260
+ """
261
+ return_value = self._contract.functions.getAdmin().call()
262
+ return eth_typing.ChecksumAddress(return_value)
263
+
264
+ def get_margin_account_registry(
265
+ self,
266
+ ) -> eth_typing.ChecksumAddress:
267
+ """Binding for `getMarginAccountRegistry` on the ClearingFacet contract.
268
+
269
+ Returns
270
+ -------
271
+ eth_typing.ChecksumAddress
272
+ """
273
+ return_value = self._contract.functions.getMarginAccountRegistry().call()
274
+ return eth_typing.ChecksumAddress(return_value)
275
+
276
+ def get_product_registry(
277
+ self,
278
+ ) -> eth_typing.ChecksumAddress:
279
+ """Binding for `getProductRegistry` on the ClearingFacet contract.
280
+
281
+ Returns
282
+ -------
283
+ eth_typing.ChecksumAddress
284
+ """
285
+ return_value = self._contract.functions.getProductRegistry().call()
286
+ return eth_typing.ChecksumAddress(return_value)
287
+
288
+ def get_treasury(
289
+ self,
290
+ ) -> eth_typing.ChecksumAddress:
291
+ """Binding for `getTreasury` on the ClearingFacet contract.
292
+
293
+ Returns
294
+ -------
295
+ eth_typing.ChecksumAddress
296
+ """
297
+ return_value = self._contract.functions.getTreasury().call()
298
+ return eth_typing.ChecksumAddress(return_value)
299
+
300
+ def hash_intent(
301
+ self,
302
+ intent: Intent,
303
+ ) -> hexbytes.HexBytes:
304
+ """Binding for `hashIntent` on the ClearingFacet contract.
305
+
306
+ Parameters
307
+ ----------
308
+ intent : Intent
309
+
310
+ Returns
311
+ -------
312
+ hexbytes.HexBytes
313
+ """
314
+ return_value = self._contract.functions.hashIntent(
315
+ (
316
+ intent.margin_account_id,
317
+ intent.intent_account_id,
318
+ intent.hash,
319
+ (
320
+ intent.data.nonce,
321
+ intent.data.trading_protocol_id,
322
+ intent.data.product_id,
323
+ intent.data.limit_price,
324
+ intent.data.quantity,
325
+ intent.data.max_trading_fee_rate,
326
+ intent.data.good_until,
327
+ int(intent.data.side),
328
+ ),
329
+ intent.signature,
330
+ ),
331
+ ).call()
332
+ return hexbytes.HexBytes(return_value)
333
+
334
+ def initialize(
335
+ self,
336
+ _product_registry: eth_typing.ChecksumAddress,
337
+ _treasury: eth_typing.ChecksumAddress,
338
+ ) -> contract.ContractFunction:
339
+ """Binding for `initialize` on the ClearingFacet contract.
340
+
341
+ Parameters
342
+ ----------
343
+ _product_registry : eth_typing.ChecksumAddress
344
+ _treasury : eth_typing.ChecksumAddress
345
+
346
+ Returns
347
+ -------
348
+ web3.contract.contract.ContractFunction
349
+ A contract function instance to be sent in a transaction.
350
+ """
351
+ return self._contract.functions.initialize(
352
+ _product_registry,
353
+ _treasury,
354
+ )
355
+
356
+ def is_admin_active(
357
+ self,
358
+ ) -> bool:
359
+ """Binding for `isAdminActive` on the ClearingFacet contract.
360
+
361
+ Returns
362
+ -------
363
+ bool
364
+ """
365
+ return_value = self._contract.functions.isAdminActive().call()
366
+ return bool(return_value)
367
+
368
+ def set_active(
369
+ self,
370
+ active: bool,
371
+ ) -> contract.ContractFunction:
372
+ """Binding for `setActive` on the ClearingFacet contract.
373
+
374
+ Parameters
375
+ ----------
376
+ active : bool
377
+
378
+ Returns
379
+ -------
380
+ web3.contract.contract.ContractFunction
381
+ A contract function instance to be sent in a transaction.
382
+ """
383
+ return self._contract.functions.setActive(
384
+ active,
385
+ )
386
+
387
+ def set_admin(
388
+ self,
389
+ new_admin: eth_typing.ChecksumAddress,
390
+ ) -> contract.ContractFunction:
391
+ """Binding for `setAdmin` on the ClearingFacet contract.
392
+
393
+ Parameters
394
+ ----------
395
+ new_admin : eth_typing.ChecksumAddress
396
+
397
+ Returns
398
+ -------
399
+ web3.contract.contract.ContractFunction
400
+ A contract function instance to be sent in a transaction.
401
+ """
402
+ return self._contract.functions.setAdmin(
403
+ new_admin,
404
+ )
405
+
406
+ def set_config(
407
+ self,
408
+ _config: Config,
409
+ ) -> contract.ContractFunction:
410
+ """Binding for `setConfig` on the ClearingFacet contract.
411
+
412
+ Parameters
413
+ ----------
414
+ _config : Config
415
+
416
+ Returns
417
+ -------
418
+ web3.contract.contract.ContractFunction
419
+ A contract function instance to be sent in a transaction.
420
+ """
421
+ return self._contract.functions.setConfig(
422
+ (
423
+ (
424
+ _config.auction_config.restoration_buffer,
425
+ _config.auction_config.liquidation_duration,
426
+ ),
427
+ (_config.clearing_config.clearing_fee_rate),
428
+ ),
429
+ )
430
+
431
+ def version(
432
+ self,
433
+ ) -> str:
434
+ """Binding for `version` on the ClearingFacet contract.
435
+
436
+ Returns
437
+ -------
438
+ str
439
+ """
440
+ return_value = self._contract.functions.version().call()
441
+ return str(return_value)
442
+
443
+
444
+ ABI = typing.cast(
445
+ eth_typing.ABI,
446
+ [
447
+ {
448
+ "inputs": [
449
+ {"internalType": "bytes4", "name": "selector", "type": "bytes4"},
450
+ {"internalType": "address", "name": "sender", "type": "address"},
451
+ ],
452
+ "name": "AdminControlledNotAuthorized",
453
+ "type": "error",
454
+ },
455
+ {"inputs": [], "name": "AlreadyInitialized", "type": "error"},
456
+ {
457
+ "inputs": [
458
+ {"internalType": "address", "name": "marginAccount", "type": "address"}
459
+ ],
460
+ "name": "DuplicateMarginAccount",
461
+ "type": "error",
462
+ },
463
+ {"inputs": [], "name": "ECDSAInvalidSignature", "type": "error"},
464
+ {
465
+ "inputs": [
466
+ {"internalType": "uint256", "name": "length", "type": "uint256"}
467
+ ],
468
+ "name": "ECDSAInvalidSignatureLength",
469
+ "type": "error",
470
+ },
471
+ {
472
+ "inputs": [{"internalType": "bytes32", "name": "s", "type": "bytes32"}],
473
+ "name": "ECDSAInvalidSignatureS",
474
+ "type": "error",
475
+ },
476
+ {
477
+ "inputs": [
478
+ {"internalType": "address", "name": "intentAccount", "type": "address"}
479
+ ],
480
+ "name": "IntentFullySpent",
481
+ "type": "error",
482
+ },
483
+ {
484
+ "inputs": [{"internalType": "int256", "name": "feeSum", "type": "int256"}],
485
+ "name": "InvalidFeeSum",
486
+ "type": "error",
487
+ },
488
+ {
489
+ "inputs": [
490
+ {"internalType": "string", "name": "parameter", "type": "string"}
491
+ ],
492
+ "name": "InvalidIntent",
493
+ "type": "error",
494
+ },
495
+ {
496
+ "inputs": [
497
+ {"internalType": "string", "name": "paramName", "type": "string"}
498
+ ],
499
+ "name": "InvalidParameter",
500
+ "type": "error",
501
+ },
502
+ {
503
+ "inputs": [
504
+ {"internalType": "enum ProductState", "name": "state", "type": "uint8"}
505
+ ],
506
+ "name": "InvalidProductState",
507
+ "type": "error",
508
+ },
509
+ {
510
+ "inputs": [
511
+ {"internalType": "address", "name": "signer", "type": "address"},
512
+ {
513
+ "internalType": "address",
514
+ "name": "expectedSigner",
515
+ "type": "address",
516
+ },
517
+ ],
518
+ "name": "InvalidSignature",
519
+ "type": "error",
520
+ },
521
+ {
522
+ "inputs": [
523
+ {"internalType": "uint256", "name": "length", "type": "uint256"}
524
+ ],
525
+ "name": "InvalidTradeIntents",
526
+ "type": "error",
527
+ },
528
+ {
529
+ "inputs": [
530
+ {"internalType": "address", "name": "marginAccount", "type": "address"}
531
+ ],
532
+ "name": "MAECheckFailed",
533
+ "type": "error",
534
+ },
535
+ {
536
+ "inputs": [
537
+ {"internalType": "int256", "name": "feeRate", "type": "int256"},
538
+ {"internalType": "uint256", "name": "maxFeeRate", "type": "uint256"},
539
+ ],
540
+ "name": "MaxFeeRateExceeded",
541
+ "type": "error",
542
+ },
543
+ {
544
+ "inputs": [
545
+ {"internalType": "uint256", "name": "buySide", "type": "uint256"},
546
+ {"internalType": "uint256", "name": "sellSide", "type": "uint256"},
547
+ ],
548
+ "name": "MismatchedTrade",
549
+ "type": "error",
550
+ },
551
+ {"inputs": [], "name": "QueueIsEmpty", "type": "error"},
552
+ {
553
+ "inputs": [
554
+ {"internalType": "address", "name": "account", "type": "address"}
555
+ ],
556
+ "name": "Unauthorized",
557
+ "type": "error",
558
+ },
559
+ {
560
+ "inputs": [
561
+ {"internalType": "address", "name": "needed", "type": "address"},
562
+ {"internalType": "address", "name": "got", "type": "address"},
563
+ ],
564
+ "name": "UnauthorizedTradeSubmitter",
565
+ "type": "error",
566
+ },
567
+ {
568
+ "anonymous": False,
569
+ "inputs": [
570
+ {
571
+ "indexed": True,
572
+ "internalType": "bytes32",
573
+ "name": "productID",
574
+ "type": "bytes32",
575
+ },
576
+ {
577
+ "indexed": True,
578
+ "internalType": "address",
579
+ "name": "protocolID",
580
+ "type": "address",
581
+ },
582
+ {
583
+ "indexed": True,
584
+ "internalType": "address",
585
+ "name": "marginAccount",
586
+ "type": "address",
587
+ },
588
+ {
589
+ "indexed": False,
590
+ "internalType": "uint256",
591
+ "name": "price",
592
+ "type": "uint256",
593
+ },
594
+ {
595
+ "indexed": False,
596
+ "internalType": "uint256",
597
+ "name": "quantity",
598
+ "type": "uint256",
599
+ },
600
+ ],
601
+ "name": "TradeExecuted",
602
+ "type": "event",
603
+ },
604
+ {
605
+ "inputs": [],
606
+ "name": "MAX_TRADING_FEE_RATE",
607
+ "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
608
+ "stateMutability": "pure",
609
+ "type": "function",
610
+ },
611
+ {
612
+ "inputs": [],
613
+ "name": "clearingFeeRate",
614
+ "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
615
+ "stateMutability": "view",
616
+ "type": "function",
617
+ },
618
+ {
619
+ "inputs": [],
620
+ "name": "config",
621
+ "outputs": [
622
+ {
623
+ "components": [
624
+ {
625
+ "components": [
626
+ {
627
+ "internalType": "uint64",
628
+ "name": "restorationBuffer",
629
+ "type": "uint64",
630
+ },
631
+ {
632
+ "internalType": "uint256",
633
+ "name": "liquidationDuration",
634
+ "type": "uint256",
635
+ },
636
+ ],
637
+ "internalType": "struct IAuctioneer.AuctionConfig",
638
+ "name": "auctionConfig",
639
+ "type": "tuple",
640
+ },
641
+ {
642
+ "components": [
643
+ {
644
+ "internalType": "uint32",
645
+ "name": "clearingFeeRate",
646
+ "type": "uint32",
647
+ }
648
+ ],
649
+ "internalType": "struct IClearing.ClearingConfig",
650
+ "name": "clearingConfig",
651
+ "type": "tuple",
652
+ },
653
+ ],
654
+ "internalType": "struct IClearing.Config",
655
+ "name": "",
656
+ "type": "tuple",
657
+ }
658
+ ],
659
+ "stateMutability": "view",
660
+ "type": "function",
661
+ },
662
+ {
663
+ "inputs": [
664
+ {"internalType": "bytes32", "name": "productID", "type": "bytes32"},
665
+ {"internalType": "uint256", "name": "price", "type": "uint256"},
666
+ {"internalType": "uint256", "name": "quantity", "type": "uint256"},
667
+ {"internalType": "int256", "name": "tradingFeeRate", "type": "int256"},
668
+ ],
669
+ "name": "estimateFees",
670
+ "outputs": [
671
+ {"internalType": "uint256", "name": "clearingFee", "type": "uint256"},
672
+ {"internalType": "int256", "name": "tradingFee", "type": "int256"},
673
+ ],
674
+ "stateMutability": "view",
675
+ "type": "function",
676
+ },
677
+ {
678
+ "inputs": [
679
+ {
680
+ "components": [
681
+ {
682
+ "internalType": "bytes32",
683
+ "name": "productID",
684
+ "type": "bytes32",
685
+ },
686
+ {
687
+ "internalType": "address",
688
+ "name": "protocolID",
689
+ "type": "address",
690
+ },
691
+ {
692
+ "internalType": "uint256",
693
+ "name": "tradeID",
694
+ "type": "uint256",
695
+ },
696
+ {"internalType": "uint256", "name": "price", "type": "uint256"},
697
+ {
698
+ "internalType": "uint256",
699
+ "name": "timestamp",
700
+ "type": "uint256",
701
+ },
702
+ {
703
+ "internalType": "address[]",
704
+ "name": "accounts",
705
+ "type": "address[]",
706
+ },
707
+ {
708
+ "internalType": "uint256[]",
709
+ "name": "quantities",
710
+ "type": "uint256[]",
711
+ },
712
+ {
713
+ "internalType": "int256[]",
714
+ "name": "feeRates",
715
+ "type": "int256[]",
716
+ },
717
+ {
718
+ "components": [
719
+ {
720
+ "internalType": "address",
721
+ "name": "marginAccountID",
722
+ "type": "address",
723
+ },
724
+ {
725
+ "internalType": "address",
726
+ "name": "intentAccountID",
727
+ "type": "address",
728
+ },
729
+ {
730
+ "internalType": "bytes32",
731
+ "name": "hash",
732
+ "type": "bytes32",
733
+ },
734
+ {
735
+ "components": [
736
+ {
737
+ "internalType": "uint256",
738
+ "name": "nonce",
739
+ "type": "uint256",
740
+ },
741
+ {
742
+ "internalType": "address",
743
+ "name": "tradingProtocolID",
744
+ "type": "address",
745
+ },
746
+ {
747
+ "internalType": "bytes32",
748
+ "name": "productID",
749
+ "type": "bytes32",
750
+ },
751
+ {
752
+ "internalType": "uint256",
753
+ "name": "limitPrice",
754
+ "type": "uint256",
755
+ },
756
+ {
757
+ "internalType": "uint256",
758
+ "name": "quantity",
759
+ "type": "uint256",
760
+ },
761
+ {
762
+ "internalType": "uint256",
763
+ "name": "maxTradingFeeRate",
764
+ "type": "uint256",
765
+ },
766
+ {
767
+ "internalType": "uint256",
768
+ "name": "goodUntil",
769
+ "type": "uint256",
770
+ },
771
+ {
772
+ "internalType": "enum Side",
773
+ "name": "side",
774
+ "type": "uint8",
775
+ },
776
+ ],
777
+ "internalType": "struct IClearing.IntentData",
778
+ "name": "data",
779
+ "type": "tuple",
780
+ },
781
+ {
782
+ "internalType": "bytes",
783
+ "name": "signature",
784
+ "type": "bytes",
785
+ },
786
+ ],
787
+ "internalType": "struct IClearing.Intent[]",
788
+ "name": "intents",
789
+ "type": "tuple[]",
790
+ },
791
+ ],
792
+ "internalType": "struct IClearing.Trade",
793
+ "name": "trade",
794
+ "type": "tuple",
795
+ },
796
+ {"internalType": "bool", "name": "fallbackOnFailure", "type": "bool"},
797
+ ],
798
+ "name": "execute",
799
+ "outputs": [],
800
+ "stateMutability": "nonpayable",
801
+ "type": "function",
802
+ },
803
+ {
804
+ "inputs": [
805
+ {
806
+ "internalType": "address",
807
+ "name": "marginAccountRegistry",
808
+ "type": "address",
809
+ }
810
+ ],
811
+ "name": "finalizeInitialization",
812
+ "outputs": [],
813
+ "stateMutability": "nonpayable",
814
+ "type": "function",
815
+ },
816
+ {
817
+ "inputs": [],
818
+ "name": "getAdmin",
819
+ "outputs": [{"internalType": "address", "name": "", "type": "address"}],
820
+ "stateMutability": "view",
821
+ "type": "function",
822
+ },
823
+ {
824
+ "inputs": [],
825
+ "name": "getMarginAccountRegistry",
826
+ "outputs": [
827
+ {
828
+ "internalType": "contract IMarginAccountRegistry",
829
+ "name": "",
830
+ "type": "address",
831
+ }
832
+ ],
833
+ "stateMutability": "view",
834
+ "type": "function",
835
+ },
836
+ {
837
+ "inputs": [],
838
+ "name": "getProductRegistry",
839
+ "outputs": [
840
+ {
841
+ "internalType": "contract IProductRegistry",
842
+ "name": "",
843
+ "type": "address",
844
+ }
845
+ ],
846
+ "stateMutability": "view",
847
+ "type": "function",
848
+ },
849
+ {
850
+ "inputs": [],
851
+ "name": "getTreasury",
852
+ "outputs": [{"internalType": "address", "name": "", "type": "address"}],
853
+ "stateMutability": "view",
854
+ "type": "function",
855
+ },
856
+ {
857
+ "inputs": [
858
+ {
859
+ "components": [
860
+ {
861
+ "internalType": "address",
862
+ "name": "marginAccountID",
863
+ "type": "address",
864
+ },
865
+ {
866
+ "internalType": "address",
867
+ "name": "intentAccountID",
868
+ "type": "address",
869
+ },
870
+ {"internalType": "bytes32", "name": "hash", "type": "bytes32"},
871
+ {
872
+ "components": [
873
+ {
874
+ "internalType": "uint256",
875
+ "name": "nonce",
876
+ "type": "uint256",
877
+ },
878
+ {
879
+ "internalType": "address",
880
+ "name": "tradingProtocolID",
881
+ "type": "address",
882
+ },
883
+ {
884
+ "internalType": "bytes32",
885
+ "name": "productID",
886
+ "type": "bytes32",
887
+ },
888
+ {
889
+ "internalType": "uint256",
890
+ "name": "limitPrice",
891
+ "type": "uint256",
892
+ },
893
+ {
894
+ "internalType": "uint256",
895
+ "name": "quantity",
896
+ "type": "uint256",
897
+ },
898
+ {
899
+ "internalType": "uint256",
900
+ "name": "maxTradingFeeRate",
901
+ "type": "uint256",
902
+ },
903
+ {
904
+ "internalType": "uint256",
905
+ "name": "goodUntil",
906
+ "type": "uint256",
907
+ },
908
+ {
909
+ "internalType": "enum Side",
910
+ "name": "side",
911
+ "type": "uint8",
912
+ },
913
+ ],
914
+ "internalType": "struct IClearing.IntentData",
915
+ "name": "data",
916
+ "type": "tuple",
917
+ },
918
+ {"internalType": "bytes", "name": "signature", "type": "bytes"},
919
+ ],
920
+ "internalType": "struct IClearing.Intent",
921
+ "name": "intent",
922
+ "type": "tuple",
923
+ }
924
+ ],
925
+ "name": "hashIntent",
926
+ "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}],
927
+ "stateMutability": "pure",
928
+ "type": "function",
929
+ },
930
+ {
931
+ "inputs": [
932
+ {
933
+ "internalType": "address",
934
+ "name": "_productRegistry",
935
+ "type": "address",
936
+ },
937
+ {"internalType": "address", "name": "_treasury", "type": "address"},
938
+ ],
939
+ "name": "initialize",
940
+ "outputs": [],
941
+ "stateMutability": "nonpayable",
942
+ "type": "function",
943
+ },
944
+ {
945
+ "inputs": [],
946
+ "name": "isAdminActive",
947
+ "outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
948
+ "stateMutability": "view",
949
+ "type": "function",
950
+ },
951
+ {
952
+ "inputs": [{"internalType": "bool", "name": "active", "type": "bool"}],
953
+ "name": "setActive",
954
+ "outputs": [],
955
+ "stateMutability": "nonpayable",
956
+ "type": "function",
957
+ },
958
+ {
959
+ "inputs": [
960
+ {"internalType": "address", "name": "newAdmin", "type": "address"}
961
+ ],
962
+ "name": "setAdmin",
963
+ "outputs": [],
964
+ "stateMutability": "nonpayable",
965
+ "type": "function",
966
+ },
967
+ {
968
+ "inputs": [
969
+ {
970
+ "components": [
971
+ {
972
+ "components": [
973
+ {
974
+ "internalType": "uint64",
975
+ "name": "restorationBuffer",
976
+ "type": "uint64",
977
+ },
978
+ {
979
+ "internalType": "uint256",
980
+ "name": "liquidationDuration",
981
+ "type": "uint256",
982
+ },
983
+ ],
984
+ "internalType": "struct IAuctioneer.AuctionConfig",
985
+ "name": "auctionConfig",
986
+ "type": "tuple",
987
+ },
988
+ {
989
+ "components": [
990
+ {
991
+ "internalType": "uint32",
992
+ "name": "clearingFeeRate",
993
+ "type": "uint32",
994
+ }
995
+ ],
996
+ "internalType": "struct IClearing.ClearingConfig",
997
+ "name": "clearingConfig",
998
+ "type": "tuple",
999
+ },
1000
+ ],
1001
+ "internalType": "struct IClearing.Config",
1002
+ "name": "_config",
1003
+ "type": "tuple",
1004
+ }
1005
+ ],
1006
+ "name": "setConfig",
1007
+ "outputs": [],
1008
+ "stateMutability": "nonpayable",
1009
+ "type": "function",
1010
+ },
1011
+ {
1012
+ "inputs": [],
1013
+ "name": "version",
1014
+ "outputs": [{"internalType": "string", "name": "", "type": "string"}],
1015
+ "stateMutability": "pure",
1016
+ "type": "function",
1017
+ },
1018
+ ],
1019
+ )