afp-sdk 0.5.4__py3-none-any.whl → 0.6.1__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.
Files changed (49) hide show
  1. afp/__init__.py +4 -1
  2. afp/afp.py +11 -0
  3. afp/api/admin.py +1 -1
  4. afp/api/base.py +11 -2
  5. afp/api/margin_account.py +12 -148
  6. afp/api/product.py +302 -148
  7. afp/api/trading.py +10 -19
  8. afp/auth.py +14 -0
  9. afp/bindings/__init__.py +30 -16
  10. afp/bindings/admin_facet.py +890 -0
  11. afp/bindings/clearing_facet.py +356 -773
  12. afp/bindings/facade.py +9 -6
  13. afp/bindings/final_settlement_facet.py +258 -99
  14. afp/bindings/margin_account.py +524 -839
  15. afp/bindings/margin_account_facet.py +722 -0
  16. afp/bindings/margin_account_registry.py +184 -310
  17. afp/bindings/mark_price_tracker_facet.py +74 -16
  18. afp/bindings/product_registry.py +1577 -541
  19. afp/bindings/product_registry_facet.py +1467 -0
  20. afp/bindings/system_viewer.py +592 -369
  21. afp/bindings/types.py +223 -0
  22. afp/config.py +4 -0
  23. afp/constants.py +49 -6
  24. afp/decorators.py +25 -3
  25. afp/dtos.py +142 -0
  26. afp/exceptions.py +10 -0
  27. afp/exchange.py +10 -8
  28. afp/hashing.py +7 -5
  29. afp/ipfs.py +245 -0
  30. afp/json-schemas/bafyreiaw34o6l3rmatabzbds2i2myazdw2yolevcpsoyd2i2g3ms7wa2eq.json +1 -0
  31. afp/json-schemas/bafyreibnfg6nq74dvpkre5rakkccij7iadp5rxpim7omsatjnrpmj3y7v4.json +1 -0
  32. afp/json-schemas/bafyreicgr6dfo5yduixjkcifghiulskfegwojvuwodtouvivl362zndhxe.json +1 -0
  33. afp/json-schemas/bafyreicheoypx6synljushh7mq2572iyhlolf4nake2p5dwobgnj3r5eua.json +1 -0
  34. afp/json-schemas/bafyreid35a67db4sqh4fs6boddyt2xvscbqy6nqvsp5jjur56qhkw4ixre.json +1 -0
  35. afp/json-schemas/bafyreidzs7okcpqiss6ztftltyptqwnw5e5opsy5yntospekjha4kpykaa.json +1 -0
  36. afp/json-schemas/bafyreifcec2km7hxwq6oqzjlspni2mgipetjb7pqtaewh2efislzoctboi.json +1 -0
  37. afp/json-schemas/bafyreihn3oiaxffe4e2w7pwtreadpw3obfd7gqlogbcxm56jc2hzfvco74.json +1 -0
  38. afp/json-schemas/bafyreihur3dzwhja6uxsbcw6eeoj3xmmc4e3zkmyzpot5v5dleevxe5zam.json +1 -0
  39. afp/schemas.py +236 -177
  40. afp/types.py +169 -0
  41. afp/validators.py +218 -8
  42. {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.1.dist-info}/METADATA +76 -11
  43. afp_sdk-0.6.1.dist-info/RECORD +50 -0
  44. afp/bindings/auctioneer_facet.py +0 -752
  45. afp/bindings/bankruptcy_facet.py +0 -391
  46. afp/bindings/trading_protocol.py +0 -1158
  47. afp_sdk-0.5.4.dist-info/RECORD +0 -37
  48. {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.1.dist-info}/WHEEL +0 -0
  49. {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,1158 +0,0 @@
1
- """TradingProtocol contract binding and data structures."""
2
-
3
- # This module has been generated using pyabigen v0.2.16
4
-
5
- import typing
6
-
7
- import eth_typing
8
- import hexbytes
9
- import web3
10
- from web3.contract import contract
11
-
12
- from .clearing_facet import Trade
13
-
14
-
15
- class TradingProtocol:
16
- """TradingProtocol contract binding.
17
-
18
- Parameters
19
- ----------
20
- w3 : web3.Web3
21
- address : eth_typing.ChecksumAddress
22
- The address of a deployed TradingProtocol contract.
23
- """
24
-
25
- _contract: contract.Contract
26
-
27
- def __init__(
28
- self,
29
- w3: web3.Web3,
30
- address: eth_typing.ChecksumAddress,
31
- ):
32
- self._contract = w3.eth.contract(
33
- address=address,
34
- abi=ABI,
35
- )
36
-
37
- @property
38
- def Initialized(self) -> contract.ContractEvent:
39
- """Binding for `event Initialized` on the TradingProtocol contract."""
40
- return self._contract.events.Initialized
41
-
42
- @property
43
- def RoleAdminChanged(self) -> contract.ContractEvent:
44
- """Binding for `event RoleAdminChanged` on the TradingProtocol contract."""
45
- return self._contract.events.RoleAdminChanged
46
-
47
- @property
48
- def RoleGranted(self) -> contract.ContractEvent:
49
- """Binding for `event RoleGranted` on the TradingProtocol contract."""
50
- return self._contract.events.RoleGranted
51
-
52
- @property
53
- def RoleRevoked(self) -> contract.ContractEvent:
54
- """Binding for `event RoleRevoked` on the TradingProtocol contract."""
55
- return self._contract.events.RoleRevoked
56
-
57
- @property
58
- def SequenceExecuted(self) -> contract.ContractEvent:
59
- """Binding for `event SequenceExecuted` on the TradingProtocol contract."""
60
- return self._contract.events.SequenceExecuted
61
-
62
- @property
63
- def Upgraded(self) -> contract.ContractEvent:
64
- """Binding for `event Upgraded` on the TradingProtocol contract."""
65
- return self._contract.events.Upgraded
66
-
67
- def default_admin_role(
68
- self,
69
- ) -> hexbytes.HexBytes:
70
- """Binding for `DEFAULT_ADMIN_ROLE` on the TradingProtocol contract.
71
-
72
- Returns
73
- -------
74
- hexbytes.HexBytes
75
- """
76
- return_value = self._contract.functions.DEFAULT_ADMIN_ROLE().call()
77
- return hexbytes.HexBytes(return_value)
78
-
79
- def trade_submitter_role(
80
- self,
81
- ) -> hexbytes.HexBytes:
82
- """Binding for `TRADE_SUBMITTER_ROLE` on the TradingProtocol contract.
83
-
84
- Returns
85
- -------
86
- hexbytes.HexBytes
87
- """
88
- return_value = self._contract.functions.TRADE_SUBMITTER_ROLE().call()
89
- return hexbytes.HexBytes(return_value)
90
-
91
- def upgrade_interface_version(
92
- self,
93
- ) -> str:
94
- """Binding for `UPGRADE_INTERFACE_VERSION` on the TradingProtocol contract.
95
-
96
- Returns
97
- -------
98
- str
99
- """
100
- return_value = self._contract.functions.UPGRADE_INTERFACE_VERSION().call()
101
- return str(return_value)
102
-
103
- def add_trade_submitter(
104
- self,
105
- submitter: eth_typing.ChecksumAddress,
106
- ) -> contract.ContractFunction:
107
- """Binding for `addTradeSubmitter` on the TradingProtocol contract.
108
-
109
- Parameters
110
- ----------
111
- submitter : eth_typing.ChecksumAddress
112
-
113
- Returns
114
- -------
115
- web3.contract.contract.ContractFunction
116
- A contract function instance to be sent in a transaction.
117
- """
118
- return self._contract.functions.addTradeSubmitter(
119
- submitter,
120
- )
121
-
122
- def change_owner(
123
- self,
124
- new_owner: eth_typing.ChecksumAddress,
125
- ) -> contract.ContractFunction:
126
- """Binding for `changeOwner` on the TradingProtocol contract.
127
-
128
- Parameters
129
- ----------
130
- new_owner : eth_typing.ChecksumAddress
131
-
132
- Returns
133
- -------
134
- web3.contract.contract.ContractFunction
135
- A contract function instance to be sent in a transaction.
136
- """
137
- return self._contract.functions.changeOwner(
138
- new_owner,
139
- )
140
-
141
- def deposit(
142
- self,
143
- margin_account_contract: eth_typing.ChecksumAddress,
144
- amount: int,
145
- ) -> contract.ContractFunction:
146
- """Binding for `deposit` on the TradingProtocol contract.
147
-
148
- Parameters
149
- ----------
150
- margin_account_contract : eth_typing.ChecksumAddress
151
- amount : int
152
-
153
- Returns
154
- -------
155
- web3.contract.contract.ContractFunction
156
- A contract function instance to be sent in a transaction.
157
- """
158
- return self._contract.functions.deposit(
159
- margin_account_contract,
160
- amount,
161
- )
162
-
163
- def execute(
164
- self,
165
- trade: Trade,
166
- fallback_on_failure: bool,
167
- ) -> contract.ContractFunction:
168
- """Binding for `execute` on the TradingProtocol contract.
169
-
170
- Parameters
171
- ----------
172
- trade : Trade
173
- fallback_on_failure : bool
174
-
175
- Returns
176
- -------
177
- web3.contract.contract.ContractFunction
178
- A contract function instance to be sent in a transaction.
179
- """
180
- return self._contract.functions.execute(
181
- (
182
- trade.product_id,
183
- trade.protocol_id,
184
- trade.trade_id,
185
- trade.price,
186
- trade.timestamp,
187
- trade.accounts,
188
- trade.quantities,
189
- trade.fee_rates,
190
- [
191
- (
192
- trade_item.margin_account_id,
193
- trade_item.intent_account_id,
194
- trade_item.hash,
195
- (
196
- trade_item.data.nonce,
197
- trade_item.data.trading_protocol_id,
198
- trade_item.data.product_id,
199
- trade_item.data.limit_price,
200
- trade_item.data.quantity,
201
- trade_item.data.max_trading_fee_rate,
202
- trade_item.data.good_until,
203
- int(trade_item.data.side),
204
- ),
205
- trade_item.signature,
206
- )
207
- for trade_item in trade.intents
208
- ],
209
- ),
210
- fallback_on_failure,
211
- )
212
-
213
- def execute_sequence(
214
- self,
215
- trades: typing.List[Trade],
216
- fallback_on_failure: bool,
217
- ) -> contract.ContractFunction:
218
- """Binding for `executeSequence` on the TradingProtocol contract.
219
-
220
- Parameters
221
- ----------
222
- trades : typing.List[Trade]
223
- fallback_on_failure : bool
224
-
225
- Returns
226
- -------
227
- web3.contract.contract.ContractFunction
228
- A contract function instance to be sent in a transaction.
229
- """
230
- return self._contract.functions.executeSequence(
231
- [
232
- (
233
- item.product_id,
234
- item.protocol_id,
235
- item.trade_id,
236
- item.price,
237
- item.timestamp,
238
- item.accounts,
239
- item.quantities,
240
- item.fee_rates,
241
- [
242
- (
243
- item_item.margin_account_id,
244
- item_item.intent_account_id,
245
- item_item.hash,
246
- (
247
- item_item.data.nonce,
248
- item_item.data.trading_protocol_id,
249
- item_item.data.product_id,
250
- item_item.data.limit_price,
251
- item_item.data.quantity,
252
- item_item.data.max_trading_fee_rate,
253
- item_item.data.good_until,
254
- int(item_item.data.side),
255
- ),
256
- item_item.signature,
257
- )
258
- for item_item in item.intents
259
- ],
260
- )
261
- for item in trades
262
- ],
263
- fallback_on_failure,
264
- )
265
-
266
- def get_role_admin(
267
- self,
268
- role: hexbytes.HexBytes,
269
- ) -> hexbytes.HexBytes:
270
- """Binding for `getRoleAdmin` on the TradingProtocol contract.
271
-
272
- Parameters
273
- ----------
274
- role : hexbytes.HexBytes
275
-
276
- Returns
277
- -------
278
- hexbytes.HexBytes
279
- """
280
- return_value = self._contract.functions.getRoleAdmin(
281
- role,
282
- ).call()
283
- return hexbytes.HexBytes(return_value)
284
-
285
- def get_role_member(
286
- self,
287
- role: hexbytes.HexBytes,
288
- index: int,
289
- ) -> eth_typing.ChecksumAddress:
290
- """Binding for `getRoleMember` on the TradingProtocol contract.
291
-
292
- Parameters
293
- ----------
294
- role : hexbytes.HexBytes
295
- index : int
296
-
297
- Returns
298
- -------
299
- eth_typing.ChecksumAddress
300
- """
301
- return_value = self._contract.functions.getRoleMember(
302
- role,
303
- index,
304
- ).call()
305
- return eth_typing.ChecksumAddress(return_value)
306
-
307
- def get_role_member_count(
308
- self,
309
- role: hexbytes.HexBytes,
310
- ) -> int:
311
- """Binding for `getRoleMemberCount` on the TradingProtocol contract.
312
-
313
- Parameters
314
- ----------
315
- role : hexbytes.HexBytes
316
-
317
- Returns
318
- -------
319
- int
320
- """
321
- return_value = self._contract.functions.getRoleMemberCount(
322
- role,
323
- ).call()
324
- return int(return_value)
325
-
326
- def get_role_members(
327
- self,
328
- role: hexbytes.HexBytes,
329
- ) -> typing.List[eth_typing.ChecksumAddress]:
330
- """Binding for `getRoleMembers` on the TradingProtocol contract.
331
-
332
- Parameters
333
- ----------
334
- role : hexbytes.HexBytes
335
-
336
- Returns
337
- -------
338
- typing.List[eth_typing.ChecksumAddress]
339
- """
340
- return_value = self._contract.functions.getRoleMembers(
341
- role,
342
- ).call()
343
- return [
344
- eth_typing.ChecksumAddress(return_value_elem)
345
- for return_value_elem in return_value
346
- ]
347
-
348
- def grant_role(
349
- self,
350
- role: hexbytes.HexBytes,
351
- account: eth_typing.ChecksumAddress,
352
- ) -> contract.ContractFunction:
353
- """Binding for `grantRole` on the TradingProtocol contract.
354
-
355
- Parameters
356
- ----------
357
- role : hexbytes.HexBytes
358
- account : eth_typing.ChecksumAddress
359
-
360
- Returns
361
- -------
362
- web3.contract.contract.ContractFunction
363
- A contract function instance to be sent in a transaction.
364
- """
365
- return self._contract.functions.grantRole(
366
- role,
367
- account,
368
- )
369
-
370
- def has_role(
371
- self,
372
- role: hexbytes.HexBytes,
373
- account: eth_typing.ChecksumAddress,
374
- ) -> bool:
375
- """Binding for `hasRole` on the TradingProtocol contract.
376
-
377
- Parameters
378
- ----------
379
- role : hexbytes.HexBytes
380
- account : eth_typing.ChecksumAddress
381
-
382
- Returns
383
- -------
384
- bool
385
- """
386
- return_value = self._contract.functions.hasRole(
387
- role,
388
- account,
389
- ).call()
390
- return bool(return_value)
391
-
392
- def initialize(
393
- self,
394
- clearing_address: eth_typing.ChecksumAddress,
395
- ) -> contract.ContractFunction:
396
- """Binding for `initialize` on the TradingProtocol contract.
397
-
398
- Parameters
399
- ----------
400
- clearing_address : eth_typing.ChecksumAddress
401
-
402
- Returns
403
- -------
404
- web3.contract.contract.ContractFunction
405
- A contract function instance to be sent in a transaction.
406
- """
407
- return self._contract.functions.initialize(
408
- clearing_address,
409
- )
410
-
411
- def proxiable_uuid(
412
- self,
413
- ) -> hexbytes.HexBytes:
414
- """Binding for `proxiableUUID` on the TradingProtocol contract.
415
-
416
- Returns
417
- -------
418
- hexbytes.HexBytes
419
- """
420
- return_value = self._contract.functions.proxiableUUID().call()
421
- return hexbytes.HexBytes(return_value)
422
-
423
- def remove_trade_submitter(
424
- self,
425
- submitter: eth_typing.ChecksumAddress,
426
- ) -> contract.ContractFunction:
427
- """Binding for `removeTradeSubmitter` on the TradingProtocol contract.
428
-
429
- Parameters
430
- ----------
431
- submitter : eth_typing.ChecksumAddress
432
-
433
- Returns
434
- -------
435
- web3.contract.contract.ContractFunction
436
- A contract function instance to be sent in a transaction.
437
- """
438
- return self._contract.functions.removeTradeSubmitter(
439
- submitter,
440
- )
441
-
442
- def renounce_role(
443
- self,
444
- role: hexbytes.HexBytes,
445
- caller_confirmation: eth_typing.ChecksumAddress,
446
- ) -> contract.ContractFunction:
447
- """Binding for `renounceRole` on the TradingProtocol contract.
448
-
449
- Parameters
450
- ----------
451
- role : hexbytes.HexBytes
452
- caller_confirmation : eth_typing.ChecksumAddress
453
-
454
- Returns
455
- -------
456
- web3.contract.contract.ContractFunction
457
- A contract function instance to be sent in a transaction.
458
- """
459
- return self._contract.functions.renounceRole(
460
- role,
461
- caller_confirmation,
462
- )
463
-
464
- def revoke_role(
465
- self,
466
- role: hexbytes.HexBytes,
467
- account: eth_typing.ChecksumAddress,
468
- ) -> contract.ContractFunction:
469
- """Binding for `revokeRole` on the TradingProtocol contract.
470
-
471
- Parameters
472
- ----------
473
- role : hexbytes.HexBytes
474
- account : eth_typing.ChecksumAddress
475
-
476
- Returns
477
- -------
478
- web3.contract.contract.ContractFunction
479
- A contract function instance to be sent in a transaction.
480
- """
481
- return self._contract.functions.revokeRole(
482
- role,
483
- account,
484
- )
485
-
486
- def supports_interface(
487
- self,
488
- interface_id: hexbytes.HexBytes,
489
- ) -> bool:
490
- """Binding for `supportsInterface` on the TradingProtocol contract.
491
-
492
- Parameters
493
- ----------
494
- interface_id : hexbytes.HexBytes
495
-
496
- Returns
497
- -------
498
- bool
499
- """
500
- return_value = self._contract.functions.supportsInterface(
501
- interface_id,
502
- ).call()
503
- return bool(return_value)
504
-
505
- def upgrade_to_and_call(
506
- self,
507
- new_implementation: eth_typing.ChecksumAddress,
508
- data: hexbytes.HexBytes,
509
- ) -> contract.ContractFunction:
510
- """Binding for `upgradeToAndCall` on the TradingProtocol contract.
511
-
512
- Parameters
513
- ----------
514
- new_implementation : eth_typing.ChecksumAddress
515
- data : hexbytes.HexBytes
516
-
517
- Returns
518
- -------
519
- web3.contract.contract.ContractFunction
520
- A contract function instance to be sent in a transaction.
521
- """
522
- return self._contract.functions.upgradeToAndCall(
523
- new_implementation,
524
- data,
525
- )
526
-
527
- def withdraw(
528
- self,
529
- margin_account_contract: eth_typing.ChecksumAddress,
530
- amount: int,
531
- ) -> contract.ContractFunction:
532
- """Binding for `withdraw` on the TradingProtocol contract.
533
-
534
- Parameters
535
- ----------
536
- margin_account_contract : eth_typing.ChecksumAddress
537
- amount : int
538
-
539
- Returns
540
- -------
541
- web3.contract.contract.ContractFunction
542
- A contract function instance to be sent in a transaction.
543
- """
544
- return self._contract.functions.withdraw(
545
- margin_account_contract,
546
- amount,
547
- )
548
-
549
-
550
- ABI = typing.cast(
551
- eth_typing.ABI,
552
- [
553
- {"inputs": [], "name": "AccessControlBadConfirmation", "type": "error"},
554
- {
555
- "inputs": [
556
- {"internalType": "address", "name": "account", "type": "address"},
557
- {"internalType": "bytes32", "name": "neededRole", "type": "bytes32"},
558
- ],
559
- "name": "AccessControlUnauthorizedAccount",
560
- "type": "error",
561
- },
562
- {
563
- "inputs": [
564
- {"internalType": "address", "name": "target", "type": "address"}
565
- ],
566
- "name": "AddressEmptyCode",
567
- "type": "error",
568
- },
569
- {
570
- "inputs": [
571
- {"internalType": "address", "name": "implementation", "type": "address"}
572
- ],
573
- "name": "ERC1967InvalidImplementation",
574
- "type": "error",
575
- },
576
- {"inputs": [], "name": "ERC1967NonPayable", "type": "error"},
577
- {"inputs": [], "name": "FailedCall", "type": "error"},
578
- {"inputs": [], "name": "InvalidInitialization", "type": "error"},
579
- {"inputs": [], "name": "NotInitializing", "type": "error"},
580
- {
581
- "inputs": [{"internalType": "address", "name": "token", "type": "address"}],
582
- "name": "SafeERC20FailedOperation",
583
- "type": "error",
584
- },
585
- {"inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error"},
586
- {
587
- "inputs": [{"internalType": "bytes32", "name": "slot", "type": "bytes32"}],
588
- "name": "UUPSUnsupportedProxiableUUID",
589
- "type": "error",
590
- },
591
- {
592
- "anonymous": False,
593
- "inputs": [
594
- {
595
- "indexed": False,
596
- "internalType": "uint64",
597
- "name": "version",
598
- "type": "uint64",
599
- }
600
- ],
601
- "name": "Initialized",
602
- "type": "event",
603
- },
604
- {
605
- "anonymous": False,
606
- "inputs": [
607
- {
608
- "indexed": True,
609
- "internalType": "bytes32",
610
- "name": "role",
611
- "type": "bytes32",
612
- },
613
- {
614
- "indexed": True,
615
- "internalType": "bytes32",
616
- "name": "previousAdminRole",
617
- "type": "bytes32",
618
- },
619
- {
620
- "indexed": True,
621
- "internalType": "bytes32",
622
- "name": "newAdminRole",
623
- "type": "bytes32",
624
- },
625
- ],
626
- "name": "RoleAdminChanged",
627
- "type": "event",
628
- },
629
- {
630
- "anonymous": False,
631
- "inputs": [
632
- {
633
- "indexed": True,
634
- "internalType": "bytes32",
635
- "name": "role",
636
- "type": "bytes32",
637
- },
638
- {
639
- "indexed": True,
640
- "internalType": "address",
641
- "name": "account",
642
- "type": "address",
643
- },
644
- {
645
- "indexed": True,
646
- "internalType": "address",
647
- "name": "sender",
648
- "type": "address",
649
- },
650
- ],
651
- "name": "RoleGranted",
652
- "type": "event",
653
- },
654
- {
655
- "anonymous": False,
656
- "inputs": [
657
- {
658
- "indexed": True,
659
- "internalType": "bytes32",
660
- "name": "role",
661
- "type": "bytes32",
662
- },
663
- {
664
- "indexed": True,
665
- "internalType": "address",
666
- "name": "account",
667
- "type": "address",
668
- },
669
- {
670
- "indexed": True,
671
- "internalType": "address",
672
- "name": "sender",
673
- "type": "address",
674
- },
675
- ],
676
- "name": "RoleRevoked",
677
- "type": "event",
678
- },
679
- {
680
- "anonymous": False,
681
- "inputs": [
682
- {
683
- "indexed": False,
684
- "internalType": "bool[]",
685
- "name": "results",
686
- "type": "bool[]",
687
- },
688
- {
689
- "indexed": False,
690
- "internalType": "bytes[]",
691
- "name": "errors",
692
- "type": "bytes[]",
693
- },
694
- ],
695
- "name": "SequenceExecuted",
696
- "type": "event",
697
- },
698
- {
699
- "anonymous": False,
700
- "inputs": [
701
- {
702
- "indexed": True,
703
- "internalType": "address",
704
- "name": "implementation",
705
- "type": "address",
706
- }
707
- ],
708
- "name": "Upgraded",
709
- "type": "event",
710
- },
711
- {
712
- "inputs": [],
713
- "name": "DEFAULT_ADMIN_ROLE",
714
- "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}],
715
- "stateMutability": "view",
716
- "type": "function",
717
- },
718
- {
719
- "inputs": [],
720
- "name": "TRADE_SUBMITTER_ROLE",
721
- "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}],
722
- "stateMutability": "view",
723
- "type": "function",
724
- },
725
- {
726
- "inputs": [],
727
- "name": "UPGRADE_INTERFACE_VERSION",
728
- "outputs": [{"internalType": "string", "name": "", "type": "string"}],
729
- "stateMutability": "view",
730
- "type": "function",
731
- },
732
- {
733
- "inputs": [
734
- {"internalType": "address", "name": "submitter", "type": "address"}
735
- ],
736
- "name": "addTradeSubmitter",
737
- "outputs": [],
738
- "stateMutability": "nonpayable",
739
- "type": "function",
740
- },
741
- {
742
- "inputs": [
743
- {"internalType": "address", "name": "newOwner", "type": "address"}
744
- ],
745
- "name": "changeOwner",
746
- "outputs": [],
747
- "stateMutability": "nonpayable",
748
- "type": "function",
749
- },
750
- {
751
- "inputs": [
752
- {
753
- "internalType": "address",
754
- "name": "marginAccountContract",
755
- "type": "address",
756
- },
757
- {"internalType": "uint256", "name": "amount", "type": "uint256"},
758
- ],
759
- "name": "deposit",
760
- "outputs": [],
761
- "stateMutability": "nonpayable",
762
- "type": "function",
763
- },
764
- {
765
- "inputs": [
766
- {
767
- "components": [
768
- {
769
- "internalType": "bytes32",
770
- "name": "productID",
771
- "type": "bytes32",
772
- },
773
- {
774
- "internalType": "address",
775
- "name": "protocolID",
776
- "type": "address",
777
- },
778
- {
779
- "internalType": "uint256",
780
- "name": "tradeID",
781
- "type": "uint256",
782
- },
783
- {"internalType": "uint256", "name": "price", "type": "uint256"},
784
- {
785
- "internalType": "uint256",
786
- "name": "timestamp",
787
- "type": "uint256",
788
- },
789
- {
790
- "internalType": "address[]",
791
- "name": "accounts",
792
- "type": "address[]",
793
- },
794
- {
795
- "internalType": "uint256[]",
796
- "name": "quantities",
797
- "type": "uint256[]",
798
- },
799
- {
800
- "internalType": "int256[]",
801
- "name": "feeRates",
802
- "type": "int256[]",
803
- },
804
- {
805
- "components": [
806
- {
807
- "internalType": "address",
808
- "name": "marginAccountID",
809
- "type": "address",
810
- },
811
- {
812
- "internalType": "address",
813
- "name": "intentAccountID",
814
- "type": "address",
815
- },
816
- {
817
- "internalType": "bytes32",
818
- "name": "hash",
819
- "type": "bytes32",
820
- },
821
- {
822
- "components": [
823
- {
824
- "internalType": "uint256",
825
- "name": "nonce",
826
- "type": "uint256",
827
- },
828
- {
829
- "internalType": "address",
830
- "name": "tradingProtocolID",
831
- "type": "address",
832
- },
833
- {
834
- "internalType": "bytes32",
835
- "name": "productID",
836
- "type": "bytes32",
837
- },
838
- {
839
- "internalType": "uint256",
840
- "name": "limitPrice",
841
- "type": "uint256",
842
- },
843
- {
844
- "internalType": "uint256",
845
- "name": "quantity",
846
- "type": "uint256",
847
- },
848
- {
849
- "internalType": "uint256",
850
- "name": "maxTradingFeeRate",
851
- "type": "uint256",
852
- },
853
- {
854
- "internalType": "uint256",
855
- "name": "goodUntil",
856
- "type": "uint256",
857
- },
858
- {
859
- "internalType": "enum Side",
860
- "name": "side",
861
- "type": "uint8",
862
- },
863
- ],
864
- "internalType": "struct IClearing.IntentData",
865
- "name": "data",
866
- "type": "tuple",
867
- },
868
- {
869
- "internalType": "bytes",
870
- "name": "signature",
871
- "type": "bytes",
872
- },
873
- ],
874
- "internalType": "struct IClearing.Intent[]",
875
- "name": "intents",
876
- "type": "tuple[]",
877
- },
878
- ],
879
- "internalType": "struct IClearing.Trade",
880
- "name": "trade",
881
- "type": "tuple",
882
- },
883
- {"internalType": "bool", "name": "fallbackOnFailure", "type": "bool"},
884
- ],
885
- "name": "execute",
886
- "outputs": [],
887
- "stateMutability": "nonpayable",
888
- "type": "function",
889
- },
890
- {
891
- "inputs": [
892
- {
893
- "components": [
894
- {
895
- "internalType": "bytes32",
896
- "name": "productID",
897
- "type": "bytes32",
898
- },
899
- {
900
- "internalType": "address",
901
- "name": "protocolID",
902
- "type": "address",
903
- },
904
- {
905
- "internalType": "uint256",
906
- "name": "tradeID",
907
- "type": "uint256",
908
- },
909
- {"internalType": "uint256", "name": "price", "type": "uint256"},
910
- {
911
- "internalType": "uint256",
912
- "name": "timestamp",
913
- "type": "uint256",
914
- },
915
- {
916
- "internalType": "address[]",
917
- "name": "accounts",
918
- "type": "address[]",
919
- },
920
- {
921
- "internalType": "uint256[]",
922
- "name": "quantities",
923
- "type": "uint256[]",
924
- },
925
- {
926
- "internalType": "int256[]",
927
- "name": "feeRates",
928
- "type": "int256[]",
929
- },
930
- {
931
- "components": [
932
- {
933
- "internalType": "address",
934
- "name": "marginAccountID",
935
- "type": "address",
936
- },
937
- {
938
- "internalType": "address",
939
- "name": "intentAccountID",
940
- "type": "address",
941
- },
942
- {
943
- "internalType": "bytes32",
944
- "name": "hash",
945
- "type": "bytes32",
946
- },
947
- {
948
- "components": [
949
- {
950
- "internalType": "uint256",
951
- "name": "nonce",
952
- "type": "uint256",
953
- },
954
- {
955
- "internalType": "address",
956
- "name": "tradingProtocolID",
957
- "type": "address",
958
- },
959
- {
960
- "internalType": "bytes32",
961
- "name": "productID",
962
- "type": "bytes32",
963
- },
964
- {
965
- "internalType": "uint256",
966
- "name": "limitPrice",
967
- "type": "uint256",
968
- },
969
- {
970
- "internalType": "uint256",
971
- "name": "quantity",
972
- "type": "uint256",
973
- },
974
- {
975
- "internalType": "uint256",
976
- "name": "maxTradingFeeRate",
977
- "type": "uint256",
978
- },
979
- {
980
- "internalType": "uint256",
981
- "name": "goodUntil",
982
- "type": "uint256",
983
- },
984
- {
985
- "internalType": "enum Side",
986
- "name": "side",
987
- "type": "uint8",
988
- },
989
- ],
990
- "internalType": "struct IClearing.IntentData",
991
- "name": "data",
992
- "type": "tuple",
993
- },
994
- {
995
- "internalType": "bytes",
996
- "name": "signature",
997
- "type": "bytes",
998
- },
999
- ],
1000
- "internalType": "struct IClearing.Intent[]",
1001
- "name": "intents",
1002
- "type": "tuple[]",
1003
- },
1004
- ],
1005
- "internalType": "struct IClearing.Trade[]",
1006
- "name": "trades",
1007
- "type": "tuple[]",
1008
- },
1009
- {"internalType": "bool", "name": "fallbackOnFailure", "type": "bool"},
1010
- ],
1011
- "name": "executeSequence",
1012
- "outputs": [],
1013
- "stateMutability": "nonpayable",
1014
- "type": "function",
1015
- },
1016
- {
1017
- "inputs": [{"internalType": "bytes32", "name": "role", "type": "bytes32"}],
1018
- "name": "getRoleAdmin",
1019
- "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}],
1020
- "stateMutability": "view",
1021
- "type": "function",
1022
- },
1023
- {
1024
- "inputs": [
1025
- {"internalType": "bytes32", "name": "role", "type": "bytes32"},
1026
- {"internalType": "uint256", "name": "index", "type": "uint256"},
1027
- ],
1028
- "name": "getRoleMember",
1029
- "outputs": [{"internalType": "address", "name": "", "type": "address"}],
1030
- "stateMutability": "view",
1031
- "type": "function",
1032
- },
1033
- {
1034
- "inputs": [{"internalType": "bytes32", "name": "role", "type": "bytes32"}],
1035
- "name": "getRoleMemberCount",
1036
- "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
1037
- "stateMutability": "view",
1038
- "type": "function",
1039
- },
1040
- {
1041
- "inputs": [{"internalType": "bytes32", "name": "role", "type": "bytes32"}],
1042
- "name": "getRoleMembers",
1043
- "outputs": [{"internalType": "address[]", "name": "", "type": "address[]"}],
1044
- "stateMutability": "view",
1045
- "type": "function",
1046
- },
1047
- {
1048
- "inputs": [
1049
- {"internalType": "bytes32", "name": "role", "type": "bytes32"},
1050
- {"internalType": "address", "name": "account", "type": "address"},
1051
- ],
1052
- "name": "grantRole",
1053
- "outputs": [],
1054
- "stateMutability": "nonpayable",
1055
- "type": "function",
1056
- },
1057
- {
1058
- "inputs": [
1059
- {"internalType": "bytes32", "name": "role", "type": "bytes32"},
1060
- {"internalType": "address", "name": "account", "type": "address"},
1061
- ],
1062
- "name": "hasRole",
1063
- "outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
1064
- "stateMutability": "view",
1065
- "type": "function",
1066
- },
1067
- {
1068
- "inputs": [
1069
- {
1070
- "internalType": "address",
1071
- "name": "clearingAddress",
1072
- "type": "address",
1073
- }
1074
- ],
1075
- "name": "initialize",
1076
- "outputs": [],
1077
- "stateMutability": "nonpayable",
1078
- "type": "function",
1079
- },
1080
- {
1081
- "inputs": [],
1082
- "name": "proxiableUUID",
1083
- "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}],
1084
- "stateMutability": "view",
1085
- "type": "function",
1086
- },
1087
- {
1088
- "inputs": [
1089
- {"internalType": "address", "name": "submitter", "type": "address"}
1090
- ],
1091
- "name": "removeTradeSubmitter",
1092
- "outputs": [],
1093
- "stateMutability": "nonpayable",
1094
- "type": "function",
1095
- },
1096
- {
1097
- "inputs": [
1098
- {"internalType": "bytes32", "name": "role", "type": "bytes32"},
1099
- {
1100
- "internalType": "address",
1101
- "name": "callerConfirmation",
1102
- "type": "address",
1103
- },
1104
- ],
1105
- "name": "renounceRole",
1106
- "outputs": [],
1107
- "stateMutability": "nonpayable",
1108
- "type": "function",
1109
- },
1110
- {
1111
- "inputs": [
1112
- {"internalType": "bytes32", "name": "role", "type": "bytes32"},
1113
- {"internalType": "address", "name": "account", "type": "address"},
1114
- ],
1115
- "name": "revokeRole",
1116
- "outputs": [],
1117
- "stateMutability": "nonpayable",
1118
- "type": "function",
1119
- },
1120
- {
1121
- "inputs": [
1122
- {"internalType": "bytes4", "name": "interfaceId", "type": "bytes4"}
1123
- ],
1124
- "name": "supportsInterface",
1125
- "outputs": [{"internalType": "bool", "name": "", "type": "bool"}],
1126
- "stateMutability": "view",
1127
- "type": "function",
1128
- },
1129
- {
1130
- "inputs": [
1131
- {
1132
- "internalType": "address",
1133
- "name": "newImplementation",
1134
- "type": "address",
1135
- },
1136
- {"internalType": "bytes", "name": "data", "type": "bytes"},
1137
- ],
1138
- "name": "upgradeToAndCall",
1139
- "outputs": [],
1140
- "stateMutability": "payable",
1141
- "type": "function",
1142
- },
1143
- {
1144
- "inputs": [
1145
- {
1146
- "internalType": "address",
1147
- "name": "marginAccountContract",
1148
- "type": "address",
1149
- },
1150
- {"internalType": "uint256", "name": "amount", "type": "uint256"},
1151
- ],
1152
- "name": "withdraw",
1153
- "outputs": [],
1154
- "stateMutability": "nonpayable",
1155
- "type": "function",
1156
- },
1157
- ],
1158
- )