afp-sdk 0.5.4__py3-none-any.whl → 0.6.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.
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 +227 -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.0.dist-info}/METADATA +73 -10
  43. afp_sdk-0.6.0.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.0.dist-info}/WHEEL +0 -0
  49. {afp_sdk-0.5.4.dist-info → afp_sdk-0.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1467 @@
1
+ """ProductRegistryFacet 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 import types
11
+ from web3.contract import contract
12
+
13
+ from .types import (
14
+ ProductState,
15
+ ExpirySpecification,
16
+ ProductMetadata,
17
+ OracleSpecification,
18
+ BaseProduct,
19
+ MarginSpecification,
20
+ FuturesProductV1,
21
+ PredictionProductV1,
22
+ )
23
+
24
+
25
+ class ProductRegistryFacet:
26
+ """ProductRegistryFacet contract binding.
27
+
28
+ Parameters
29
+ ----------
30
+ w3 : web3.Web3
31
+ address : eth_typing.ChecksumAddress
32
+ The address of a deployed ProductRegistryFacet contract.
33
+ """
34
+
35
+ _contract: contract.Contract
36
+
37
+ def __init__(
38
+ self,
39
+ w3: web3.Web3,
40
+ address: eth_typing.ChecksumAddress,
41
+ ):
42
+ self._contract = w3.eth.contract(
43
+ address=address,
44
+ abi=ABI,
45
+ )
46
+
47
+ def claim_builder_rewards(
48
+ self,
49
+ product_id: hexbytes.HexBytes,
50
+ ) -> contract.ContractFunction:
51
+ """Binding for `claimBuilderRewards` on the ProductRegistryFacet contract.
52
+
53
+ Parameters
54
+ ----------
55
+ product_id : hexbytes.HexBytes
56
+
57
+ Returns
58
+ -------
59
+ web3.contract.contract.ContractFunction
60
+ A contract function instance to be sent in a transaction.
61
+ """
62
+ return self._contract.functions.claimBuilderRewards(
63
+ product_id,
64
+ )
65
+
66
+ def expiry_specification(
67
+ self,
68
+ product_id: hexbytes.HexBytes,
69
+ block_identifier: types.BlockIdentifier = "latest",
70
+ ) -> ExpirySpecification:
71
+ """Binding for `expirySpecification` on the ProductRegistryFacet contract.
72
+
73
+ Parameters
74
+ ----------
75
+ product_id : hexbytes.HexBytes
76
+ block_identifier : web3.types.BlockIdentifier
77
+ The block identifier, defaults to the latest block.
78
+
79
+ Returns
80
+ -------
81
+ ExpirySpecification
82
+ """
83
+ return_value = self._contract.functions.expirySpecification(
84
+ product_id,
85
+ ).call(block_identifier=block_identifier)
86
+ return ExpirySpecification(int(return_value[0]), int(return_value[1]))
87
+
88
+ def futures_product_v1(
89
+ self,
90
+ product_id: hexbytes.HexBytes,
91
+ block_identifier: types.BlockIdentifier = "latest",
92
+ ) -> FuturesProductV1:
93
+ """Binding for `futuresProductV1` on the ProductRegistryFacet contract.
94
+
95
+ Parameters
96
+ ----------
97
+ product_id : hexbytes.HexBytes
98
+ block_identifier : web3.types.BlockIdentifier
99
+ The block identifier, defaults to the latest block.
100
+
101
+ Returns
102
+ -------
103
+ FuturesProductV1
104
+ """
105
+ return_value = self._contract.functions.futuresProductV1(
106
+ product_id,
107
+ ).call(block_identifier=block_identifier)
108
+ return FuturesProductV1(
109
+ BaseProduct(
110
+ ProductMetadata(
111
+ eth_typing.ChecksumAddress(return_value[0][0][0]),
112
+ str(return_value[0][0][1]),
113
+ str(return_value[0][0][2]),
114
+ ),
115
+ OracleSpecification(
116
+ eth_typing.ChecksumAddress(return_value[0][1][0]),
117
+ int(return_value[0][1][1]),
118
+ int(return_value[0][1][2]),
119
+ int(return_value[0][1][3]),
120
+ hexbytes.HexBytes(return_value[0][1][4]),
121
+ ),
122
+ eth_typing.ChecksumAddress(return_value[0][2]),
123
+ int(return_value[0][3]),
124
+ int(return_value[0][4]),
125
+ int(return_value[0][5]),
126
+ str(return_value[0][6]),
127
+ ),
128
+ ExpirySpecification(int(return_value[1][0]), int(return_value[1][1])),
129
+ MarginSpecification(int(return_value[2][0]), int(return_value[2][1])),
130
+ )
131
+
132
+ def id(
133
+ self,
134
+ product: BaseProduct,
135
+ block_identifier: types.BlockIdentifier = "latest",
136
+ ) -> hexbytes.HexBytes:
137
+ """Binding for `id` on the ProductRegistryFacet contract.
138
+
139
+ Parameters
140
+ ----------
141
+ product : BaseProduct
142
+ block_identifier : web3.types.BlockIdentifier
143
+ The block identifier, defaults to the latest block.
144
+
145
+ Returns
146
+ -------
147
+ hexbytes.HexBytes
148
+ """
149
+ return_value = self._contract.functions.id(
150
+ (
151
+ (
152
+ product.metadata.builder,
153
+ product.metadata.symbol,
154
+ product.metadata.description,
155
+ ),
156
+ (
157
+ product.oracle_spec.oracle_address,
158
+ product.oracle_spec.fsv_decimals,
159
+ product.oracle_spec.fsp_alpha,
160
+ product.oracle_spec.fsp_beta,
161
+ product.oracle_spec.fsv_calldata,
162
+ ),
163
+ product.collateral_asset,
164
+ product.start_time,
165
+ product.point_value,
166
+ product.price_decimals,
167
+ product.extended_metadata,
168
+ ),
169
+ ).call(block_identifier=block_identifier)
170
+ return hexbytes.HexBytes(return_value)
171
+
172
+ def increase_builder_stake(
173
+ self,
174
+ product_id: hexbytes.HexBytes,
175
+ stake_amount: int,
176
+ ) -> contract.ContractFunction:
177
+ """Binding for `increaseBuilderStake` on the ProductRegistryFacet contract.
178
+
179
+ Parameters
180
+ ----------
181
+ product_id : hexbytes.HexBytes
182
+ stake_amount : int
183
+
184
+ Returns
185
+ -------
186
+ web3.contract.contract.ContractFunction
187
+ A contract function instance to be sent in a transaction.
188
+ """
189
+ return self._contract.functions.increaseBuilderStake(
190
+ product_id,
191
+ stake_amount,
192
+ )
193
+
194
+ def is_builder_stake_valid(
195
+ self,
196
+ stake_amount: int,
197
+ collateral: eth_typing.ChecksumAddress,
198
+ block_identifier: types.BlockIdentifier = "latest",
199
+ ) -> bool:
200
+ """Binding for `isBuilderStakeValid` on the ProductRegistryFacet contract.
201
+
202
+ Parameters
203
+ ----------
204
+ stake_amount : int
205
+ collateral : eth_typing.ChecksumAddress
206
+ block_identifier : web3.types.BlockIdentifier
207
+ The block identifier, defaults to the latest block.
208
+
209
+ Returns
210
+ -------
211
+ bool
212
+ """
213
+ return_value = self._contract.functions.isBuilderStakeValid(
214
+ stake_amount,
215
+ collateral,
216
+ ).call(block_identifier=block_identifier)
217
+ return bool(return_value)
218
+
219
+ def min_builder_stake(
220
+ self,
221
+ collateral: eth_typing.ChecksumAddress,
222
+ block_identifier: types.BlockIdentifier = "latest",
223
+ ) -> int:
224
+ """Binding for `minBuilderStake` on the ProductRegistryFacet contract.
225
+
226
+ Parameters
227
+ ----------
228
+ collateral : eth_typing.ChecksumAddress
229
+ block_identifier : web3.types.BlockIdentifier
230
+ The block identifier, defaults to the latest block.
231
+
232
+ Returns
233
+ -------
234
+ int
235
+ """
236
+ return_value = self._contract.functions.minBuilderStake(
237
+ collateral,
238
+ ).call(block_identifier=block_identifier)
239
+ return int(return_value)
240
+
241
+ def mmr(
242
+ self,
243
+ product_id: hexbytes.HexBytes,
244
+ block_identifier: types.BlockIdentifier = "latest",
245
+ ) -> int:
246
+ """Binding for `mmr` on the ProductRegistryFacet contract.
247
+
248
+ Parameters
249
+ ----------
250
+ product_id : hexbytes.HexBytes
251
+ block_identifier : web3.types.BlockIdentifier
252
+ The block identifier, defaults to the latest block.
253
+
254
+ Returns
255
+ -------
256
+ int
257
+ """
258
+ return_value = self._contract.functions.mmr(
259
+ product_id,
260
+ ).call(block_identifier=block_identifier)
261
+ return int(return_value)
262
+
263
+ def prediction_product_v1(
264
+ self,
265
+ product_id: hexbytes.HexBytes,
266
+ block_identifier: types.BlockIdentifier = "latest",
267
+ ) -> PredictionProductV1:
268
+ """Binding for `predictionProductV1` on the ProductRegistryFacet contract.
269
+
270
+ Parameters
271
+ ----------
272
+ product_id : hexbytes.HexBytes
273
+ block_identifier : web3.types.BlockIdentifier
274
+ The block identifier, defaults to the latest block.
275
+
276
+ Returns
277
+ -------
278
+ PredictionProductV1
279
+ """
280
+ return_value = self._contract.functions.predictionProductV1(
281
+ product_id,
282
+ ).call(block_identifier=block_identifier)
283
+ return PredictionProductV1(
284
+ BaseProduct(
285
+ ProductMetadata(
286
+ eth_typing.ChecksumAddress(return_value[0][0][0]),
287
+ str(return_value[0][0][1]),
288
+ str(return_value[0][0][2]),
289
+ ),
290
+ OracleSpecification(
291
+ eth_typing.ChecksumAddress(return_value[0][1][0]),
292
+ int(return_value[0][1][1]),
293
+ int(return_value[0][1][2]),
294
+ int(return_value[0][1][3]),
295
+ hexbytes.HexBytes(return_value[0][1][4]),
296
+ ),
297
+ eth_typing.ChecksumAddress(return_value[0][2]),
298
+ int(return_value[0][3]),
299
+ int(return_value[0][4]),
300
+ int(return_value[0][5]),
301
+ str(return_value[0][6]),
302
+ ),
303
+ ExpirySpecification(int(return_value[1][0]), int(return_value[1][1])),
304
+ int(return_value[2]),
305
+ int(return_value[3]),
306
+ )
307
+
308
+ def product_treasury(
309
+ self,
310
+ product_id: hexbytes.HexBytes,
311
+ block_identifier: types.BlockIdentifier = "latest",
312
+ ) -> eth_typing.ChecksumAddress:
313
+ """Binding for `productTreasury` on the ProductRegistryFacet contract.
314
+
315
+ Parameters
316
+ ----------
317
+ product_id : hexbytes.HexBytes
318
+ block_identifier : web3.types.BlockIdentifier
319
+ The block identifier, defaults to the latest block.
320
+
321
+ Returns
322
+ -------
323
+ eth_typing.ChecksumAddress
324
+ """
325
+ return_value = self._contract.functions.productTreasury(
326
+ product_id,
327
+ ).call(block_identifier=block_identifier)
328
+ return eth_typing.ChecksumAddress(return_value)
329
+
330
+ def products(
331
+ self,
332
+ product_id: hexbytes.HexBytes,
333
+ block_identifier: types.BlockIdentifier = "latest",
334
+ ) -> typing.Tuple[int, BaseProduct]:
335
+ """Binding for `products` on the ProductRegistryFacet contract.
336
+
337
+ Parameters
338
+ ----------
339
+ product_id : hexbytes.HexBytes
340
+ block_identifier : web3.types.BlockIdentifier
341
+ The block identifier, defaults to the latest block.
342
+
343
+ Returns
344
+ -------
345
+ int
346
+ BaseProduct
347
+ """
348
+ return_value = self._contract.functions.products(
349
+ product_id,
350
+ ).call(block_identifier=block_identifier)
351
+ return (
352
+ int(return_value[0]),
353
+ BaseProduct(
354
+ ProductMetadata(
355
+ eth_typing.ChecksumAddress(return_value[1][0][0]),
356
+ str(return_value[1][0][1]),
357
+ str(return_value[1][0][2]),
358
+ ),
359
+ OracleSpecification(
360
+ eth_typing.ChecksumAddress(return_value[1][1][0]),
361
+ int(return_value[1][1][1]),
362
+ int(return_value[1][1][2]),
363
+ int(return_value[1][1][3]),
364
+ hexbytes.HexBytes(return_value[1][1][4]),
365
+ ),
366
+ eth_typing.ChecksumAddress(return_value[1][2]),
367
+ int(return_value[1][3]),
368
+ int(return_value[1][4]),
369
+ int(return_value[1][5]),
370
+ str(return_value[1][6]),
371
+ ),
372
+ )
373
+
374
+ def register_future_product(
375
+ self,
376
+ product: FuturesProductV1,
377
+ initial_builder_stake: int,
378
+ ) -> contract.ContractFunction:
379
+ """Binding for `registerFutureProduct` on the ProductRegistryFacet contract.
380
+
381
+ Parameters
382
+ ----------
383
+ product : FuturesProductV1
384
+ initial_builder_stake : int
385
+
386
+ Returns
387
+ -------
388
+ web3.contract.contract.ContractFunction
389
+ A contract function instance to be sent in a transaction.
390
+ """
391
+ return self._contract.functions.registerFutureProduct(
392
+ (
393
+ (
394
+ (
395
+ product.base.metadata.builder,
396
+ product.base.metadata.symbol,
397
+ product.base.metadata.description,
398
+ ),
399
+ (
400
+ product.base.oracle_spec.oracle_address,
401
+ product.base.oracle_spec.fsv_decimals,
402
+ product.base.oracle_spec.fsp_alpha,
403
+ product.base.oracle_spec.fsp_beta,
404
+ product.base.oracle_spec.fsv_calldata,
405
+ ),
406
+ product.base.collateral_asset,
407
+ product.base.start_time,
408
+ product.base.point_value,
409
+ product.base.price_decimals,
410
+ product.base.extended_metadata,
411
+ ),
412
+ (
413
+ product.expiry_spec.earliest_fsp_submission_time,
414
+ product.expiry_spec.tradeout_interval,
415
+ ),
416
+ (product.margin_spec.imr, product.margin_spec.mmr),
417
+ ),
418
+ initial_builder_stake,
419
+ )
420
+
421
+ def register_prediction_product(
422
+ self,
423
+ product: PredictionProductV1,
424
+ initial_builder_stake: int,
425
+ ) -> contract.ContractFunction:
426
+ """Binding for `registerPredictionProduct` on the ProductRegistryFacet contract.
427
+
428
+ Parameters
429
+ ----------
430
+ product : PredictionProductV1
431
+ initial_builder_stake : int
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.registerPredictionProduct(
439
+ (
440
+ (
441
+ (
442
+ product.base.metadata.builder,
443
+ product.base.metadata.symbol,
444
+ product.base.metadata.description,
445
+ ),
446
+ (
447
+ product.base.oracle_spec.oracle_address,
448
+ product.base.oracle_spec.fsv_decimals,
449
+ product.base.oracle_spec.fsp_alpha,
450
+ product.base.oracle_spec.fsp_beta,
451
+ product.base.oracle_spec.fsv_calldata,
452
+ ),
453
+ product.base.collateral_asset,
454
+ product.base.start_time,
455
+ product.base.point_value,
456
+ product.base.price_decimals,
457
+ product.base.extended_metadata,
458
+ ),
459
+ (
460
+ product.expiry_spec.earliest_fsp_submission_time,
461
+ product.expiry_spec.tradeout_interval,
462
+ ),
463
+ product.max_price,
464
+ product.min_price,
465
+ ),
466
+ initial_builder_stake,
467
+ )
468
+
469
+ def state(
470
+ self,
471
+ product_id: hexbytes.HexBytes,
472
+ block_identifier: types.BlockIdentifier = "latest",
473
+ ) -> ProductState:
474
+ """Binding for `state` on the ProductRegistryFacet contract.
475
+
476
+ Parameters
477
+ ----------
478
+ product_id : hexbytes.HexBytes
479
+ block_identifier : web3.types.BlockIdentifier
480
+ The block identifier, defaults to the latest block.
481
+
482
+ Returns
483
+ -------
484
+ ProductState
485
+ """
486
+ return_value = self._contract.functions.state(
487
+ product_id,
488
+ ).call(block_identifier=block_identifier)
489
+ return ProductState(return_value)
490
+
491
+ def type_of(
492
+ self,
493
+ product_id: hexbytes.HexBytes,
494
+ block_identifier: types.BlockIdentifier = "latest",
495
+ ) -> int:
496
+ """Binding for `typeOf` on the ProductRegistryFacet contract.
497
+
498
+ Parameters
499
+ ----------
500
+ product_id : hexbytes.HexBytes
501
+ block_identifier : web3.types.BlockIdentifier
502
+ The block identifier, defaults to the latest block.
503
+
504
+ Returns
505
+ -------
506
+ int
507
+ """
508
+ return_value = self._contract.functions.typeOf(
509
+ product_id,
510
+ ).call(block_identifier=block_identifier)
511
+ return int(return_value)
512
+
513
+
514
+ ABI = typing.cast(
515
+ eth_typing.ABI,
516
+ [
517
+ {
518
+ "type": "function",
519
+ "name": "claimBuilderRewards",
520
+ "inputs": [
521
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
522
+ ],
523
+ "outputs": [],
524
+ "stateMutability": "nonpayable",
525
+ },
526
+ {
527
+ "type": "function",
528
+ "name": "expirySpecification",
529
+ "inputs": [
530
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
531
+ ],
532
+ "outputs": [
533
+ {
534
+ "name": "",
535
+ "type": "tuple",
536
+ "internalType": "struct ExpirySpecification",
537
+ "components": [
538
+ {
539
+ "name": "earliestFSPSubmissionTime",
540
+ "type": "uint256",
541
+ "internalType": "uint256",
542
+ },
543
+ {
544
+ "name": "tradeoutInterval",
545
+ "type": "uint256",
546
+ "internalType": "uint256",
547
+ },
548
+ ],
549
+ }
550
+ ],
551
+ "stateMutability": "view",
552
+ },
553
+ {
554
+ "type": "function",
555
+ "name": "futuresProductV1",
556
+ "inputs": [
557
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
558
+ ],
559
+ "outputs": [
560
+ {
561
+ "name": "",
562
+ "type": "tuple",
563
+ "internalType": "struct FuturesProductV1",
564
+ "components": [
565
+ {
566
+ "name": "base",
567
+ "type": "tuple",
568
+ "internalType": "struct BaseProduct",
569
+ "components": [
570
+ {
571
+ "name": "metadata",
572
+ "type": "tuple",
573
+ "internalType": "struct ProductMetadata",
574
+ "components": [
575
+ {
576
+ "name": "builder",
577
+ "type": "address",
578
+ "internalType": "address",
579
+ },
580
+ {
581
+ "name": "symbol",
582
+ "type": "string",
583
+ "internalType": "string",
584
+ },
585
+ {
586
+ "name": "description",
587
+ "type": "string",
588
+ "internalType": "string",
589
+ },
590
+ ],
591
+ },
592
+ {
593
+ "name": "oracleSpec",
594
+ "type": "tuple",
595
+ "internalType": "struct OracleSpecification",
596
+ "components": [
597
+ {
598
+ "name": "oracleAddress",
599
+ "type": "address",
600
+ "internalType": "address",
601
+ },
602
+ {
603
+ "name": "fsvDecimals",
604
+ "type": "uint8",
605
+ "internalType": "uint8",
606
+ },
607
+ {
608
+ "name": "fspAlpha",
609
+ "type": "int256",
610
+ "internalType": "int256",
611
+ },
612
+ {
613
+ "name": "fspBeta",
614
+ "type": "int256",
615
+ "internalType": "int256",
616
+ },
617
+ {
618
+ "name": "fsvCalldata",
619
+ "type": "bytes",
620
+ "internalType": "bytes",
621
+ },
622
+ ],
623
+ },
624
+ {
625
+ "name": "collateralAsset",
626
+ "type": "address",
627
+ "internalType": "address",
628
+ },
629
+ {
630
+ "name": "startTime",
631
+ "type": "uint256",
632
+ "internalType": "uint256",
633
+ },
634
+ {
635
+ "name": "pointValue",
636
+ "type": "uint256",
637
+ "internalType": "uint256",
638
+ },
639
+ {
640
+ "name": "priceDecimals",
641
+ "type": "uint8",
642
+ "internalType": "uint8",
643
+ },
644
+ {
645
+ "name": "extendedMetadata",
646
+ "type": "string",
647
+ "internalType": "string",
648
+ },
649
+ ],
650
+ },
651
+ {
652
+ "name": "expirySpec",
653
+ "type": "tuple",
654
+ "internalType": "struct ExpirySpecification",
655
+ "components": [
656
+ {
657
+ "name": "earliestFSPSubmissionTime",
658
+ "type": "uint256",
659
+ "internalType": "uint256",
660
+ },
661
+ {
662
+ "name": "tradeoutInterval",
663
+ "type": "uint256",
664
+ "internalType": "uint256",
665
+ },
666
+ ],
667
+ },
668
+ {
669
+ "name": "marginSpec",
670
+ "type": "tuple",
671
+ "internalType": "struct MarginSpecification",
672
+ "components": [
673
+ {
674
+ "name": "imr",
675
+ "type": "uint256",
676
+ "internalType": "uint256",
677
+ },
678
+ {
679
+ "name": "mmr",
680
+ "type": "uint256",
681
+ "internalType": "uint256",
682
+ },
683
+ ],
684
+ },
685
+ ],
686
+ }
687
+ ],
688
+ "stateMutability": "view",
689
+ },
690
+ {
691
+ "type": "function",
692
+ "name": "id",
693
+ "inputs": [
694
+ {
695
+ "name": "product",
696
+ "type": "tuple",
697
+ "internalType": "struct BaseProduct",
698
+ "components": [
699
+ {
700
+ "name": "metadata",
701
+ "type": "tuple",
702
+ "internalType": "struct ProductMetadata",
703
+ "components": [
704
+ {
705
+ "name": "builder",
706
+ "type": "address",
707
+ "internalType": "address",
708
+ },
709
+ {
710
+ "name": "symbol",
711
+ "type": "string",
712
+ "internalType": "string",
713
+ },
714
+ {
715
+ "name": "description",
716
+ "type": "string",
717
+ "internalType": "string",
718
+ },
719
+ ],
720
+ },
721
+ {
722
+ "name": "oracleSpec",
723
+ "type": "tuple",
724
+ "internalType": "struct OracleSpecification",
725
+ "components": [
726
+ {
727
+ "name": "oracleAddress",
728
+ "type": "address",
729
+ "internalType": "address",
730
+ },
731
+ {
732
+ "name": "fsvDecimals",
733
+ "type": "uint8",
734
+ "internalType": "uint8",
735
+ },
736
+ {
737
+ "name": "fspAlpha",
738
+ "type": "int256",
739
+ "internalType": "int256",
740
+ },
741
+ {
742
+ "name": "fspBeta",
743
+ "type": "int256",
744
+ "internalType": "int256",
745
+ },
746
+ {
747
+ "name": "fsvCalldata",
748
+ "type": "bytes",
749
+ "internalType": "bytes",
750
+ },
751
+ ],
752
+ },
753
+ {
754
+ "name": "collateralAsset",
755
+ "type": "address",
756
+ "internalType": "address",
757
+ },
758
+ {
759
+ "name": "startTime",
760
+ "type": "uint256",
761
+ "internalType": "uint256",
762
+ },
763
+ {
764
+ "name": "pointValue",
765
+ "type": "uint256",
766
+ "internalType": "uint256",
767
+ },
768
+ {
769
+ "name": "priceDecimals",
770
+ "type": "uint8",
771
+ "internalType": "uint8",
772
+ },
773
+ {
774
+ "name": "extendedMetadata",
775
+ "type": "string",
776
+ "internalType": "string",
777
+ },
778
+ ],
779
+ }
780
+ ],
781
+ "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}],
782
+ "stateMutability": "pure",
783
+ },
784
+ {
785
+ "type": "function",
786
+ "name": "increaseBuilderStake",
787
+ "inputs": [
788
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"},
789
+ {"name": "stakeAmount", "type": "uint256", "internalType": "uint256"},
790
+ ],
791
+ "outputs": [],
792
+ "stateMutability": "nonpayable",
793
+ },
794
+ {
795
+ "type": "function",
796
+ "name": "isBuilderStakeValid",
797
+ "inputs": [
798
+ {"name": "stakeAmount", "type": "uint256", "internalType": "uint256"},
799
+ {"name": "collateral", "type": "address", "internalType": "address"},
800
+ ],
801
+ "outputs": [{"name": "", "type": "bool", "internalType": "bool"}],
802
+ "stateMutability": "view",
803
+ },
804
+ {
805
+ "type": "function",
806
+ "name": "minBuilderStake",
807
+ "inputs": [
808
+ {"name": "collateral", "type": "address", "internalType": "address"}
809
+ ],
810
+ "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}],
811
+ "stateMutability": "view",
812
+ },
813
+ {
814
+ "type": "function",
815
+ "name": "mmr",
816
+ "inputs": [
817
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
818
+ ],
819
+ "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}],
820
+ "stateMutability": "view",
821
+ },
822
+ {
823
+ "type": "function",
824
+ "name": "predictionProductV1",
825
+ "inputs": [
826
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
827
+ ],
828
+ "outputs": [
829
+ {
830
+ "name": "",
831
+ "type": "tuple",
832
+ "internalType": "struct PredictionProductV1",
833
+ "components": [
834
+ {
835
+ "name": "base",
836
+ "type": "tuple",
837
+ "internalType": "struct BaseProduct",
838
+ "components": [
839
+ {
840
+ "name": "metadata",
841
+ "type": "tuple",
842
+ "internalType": "struct ProductMetadata",
843
+ "components": [
844
+ {
845
+ "name": "builder",
846
+ "type": "address",
847
+ "internalType": "address",
848
+ },
849
+ {
850
+ "name": "symbol",
851
+ "type": "string",
852
+ "internalType": "string",
853
+ },
854
+ {
855
+ "name": "description",
856
+ "type": "string",
857
+ "internalType": "string",
858
+ },
859
+ ],
860
+ },
861
+ {
862
+ "name": "oracleSpec",
863
+ "type": "tuple",
864
+ "internalType": "struct OracleSpecification",
865
+ "components": [
866
+ {
867
+ "name": "oracleAddress",
868
+ "type": "address",
869
+ "internalType": "address",
870
+ },
871
+ {
872
+ "name": "fsvDecimals",
873
+ "type": "uint8",
874
+ "internalType": "uint8",
875
+ },
876
+ {
877
+ "name": "fspAlpha",
878
+ "type": "int256",
879
+ "internalType": "int256",
880
+ },
881
+ {
882
+ "name": "fspBeta",
883
+ "type": "int256",
884
+ "internalType": "int256",
885
+ },
886
+ {
887
+ "name": "fsvCalldata",
888
+ "type": "bytes",
889
+ "internalType": "bytes",
890
+ },
891
+ ],
892
+ },
893
+ {
894
+ "name": "collateralAsset",
895
+ "type": "address",
896
+ "internalType": "address",
897
+ },
898
+ {
899
+ "name": "startTime",
900
+ "type": "uint256",
901
+ "internalType": "uint256",
902
+ },
903
+ {
904
+ "name": "pointValue",
905
+ "type": "uint256",
906
+ "internalType": "uint256",
907
+ },
908
+ {
909
+ "name": "priceDecimals",
910
+ "type": "uint8",
911
+ "internalType": "uint8",
912
+ },
913
+ {
914
+ "name": "extendedMetadata",
915
+ "type": "string",
916
+ "internalType": "string",
917
+ },
918
+ ],
919
+ },
920
+ {
921
+ "name": "expirySpec",
922
+ "type": "tuple",
923
+ "internalType": "struct ExpirySpecification",
924
+ "components": [
925
+ {
926
+ "name": "earliestFSPSubmissionTime",
927
+ "type": "uint256",
928
+ "internalType": "uint256",
929
+ },
930
+ {
931
+ "name": "tradeoutInterval",
932
+ "type": "uint256",
933
+ "internalType": "uint256",
934
+ },
935
+ ],
936
+ },
937
+ {
938
+ "name": "maxPrice",
939
+ "type": "int256",
940
+ "internalType": "int256",
941
+ },
942
+ {
943
+ "name": "minPrice",
944
+ "type": "int256",
945
+ "internalType": "int256",
946
+ },
947
+ ],
948
+ }
949
+ ],
950
+ "stateMutability": "view",
951
+ },
952
+ {
953
+ "type": "function",
954
+ "name": "productTreasury",
955
+ "inputs": [
956
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
957
+ ],
958
+ "outputs": [{"name": "", "type": "address", "internalType": "address"}],
959
+ "stateMutability": "view",
960
+ },
961
+ {
962
+ "type": "function",
963
+ "name": "products",
964
+ "inputs": [
965
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
966
+ ],
967
+ "outputs": [
968
+ {"name": "", "type": "uint8", "internalType": "enum ProductType"},
969
+ {
970
+ "name": "",
971
+ "type": "tuple",
972
+ "internalType": "struct BaseProduct",
973
+ "components": [
974
+ {
975
+ "name": "metadata",
976
+ "type": "tuple",
977
+ "internalType": "struct ProductMetadata",
978
+ "components": [
979
+ {
980
+ "name": "builder",
981
+ "type": "address",
982
+ "internalType": "address",
983
+ },
984
+ {
985
+ "name": "symbol",
986
+ "type": "string",
987
+ "internalType": "string",
988
+ },
989
+ {
990
+ "name": "description",
991
+ "type": "string",
992
+ "internalType": "string",
993
+ },
994
+ ],
995
+ },
996
+ {
997
+ "name": "oracleSpec",
998
+ "type": "tuple",
999
+ "internalType": "struct OracleSpecification",
1000
+ "components": [
1001
+ {
1002
+ "name": "oracleAddress",
1003
+ "type": "address",
1004
+ "internalType": "address",
1005
+ },
1006
+ {
1007
+ "name": "fsvDecimals",
1008
+ "type": "uint8",
1009
+ "internalType": "uint8",
1010
+ },
1011
+ {
1012
+ "name": "fspAlpha",
1013
+ "type": "int256",
1014
+ "internalType": "int256",
1015
+ },
1016
+ {
1017
+ "name": "fspBeta",
1018
+ "type": "int256",
1019
+ "internalType": "int256",
1020
+ },
1021
+ {
1022
+ "name": "fsvCalldata",
1023
+ "type": "bytes",
1024
+ "internalType": "bytes",
1025
+ },
1026
+ ],
1027
+ },
1028
+ {
1029
+ "name": "collateralAsset",
1030
+ "type": "address",
1031
+ "internalType": "address",
1032
+ },
1033
+ {
1034
+ "name": "startTime",
1035
+ "type": "uint256",
1036
+ "internalType": "uint256",
1037
+ },
1038
+ {
1039
+ "name": "pointValue",
1040
+ "type": "uint256",
1041
+ "internalType": "uint256",
1042
+ },
1043
+ {
1044
+ "name": "priceDecimals",
1045
+ "type": "uint8",
1046
+ "internalType": "uint8",
1047
+ },
1048
+ {
1049
+ "name": "extendedMetadata",
1050
+ "type": "string",
1051
+ "internalType": "string",
1052
+ },
1053
+ ],
1054
+ },
1055
+ ],
1056
+ "stateMutability": "view",
1057
+ },
1058
+ {
1059
+ "type": "function",
1060
+ "name": "registerFutureProduct",
1061
+ "inputs": [
1062
+ {
1063
+ "name": "product",
1064
+ "type": "tuple",
1065
+ "internalType": "struct FuturesProductV1",
1066
+ "components": [
1067
+ {
1068
+ "name": "base",
1069
+ "type": "tuple",
1070
+ "internalType": "struct BaseProduct",
1071
+ "components": [
1072
+ {
1073
+ "name": "metadata",
1074
+ "type": "tuple",
1075
+ "internalType": "struct ProductMetadata",
1076
+ "components": [
1077
+ {
1078
+ "name": "builder",
1079
+ "type": "address",
1080
+ "internalType": "address",
1081
+ },
1082
+ {
1083
+ "name": "symbol",
1084
+ "type": "string",
1085
+ "internalType": "string",
1086
+ },
1087
+ {
1088
+ "name": "description",
1089
+ "type": "string",
1090
+ "internalType": "string",
1091
+ },
1092
+ ],
1093
+ },
1094
+ {
1095
+ "name": "oracleSpec",
1096
+ "type": "tuple",
1097
+ "internalType": "struct OracleSpecification",
1098
+ "components": [
1099
+ {
1100
+ "name": "oracleAddress",
1101
+ "type": "address",
1102
+ "internalType": "address",
1103
+ },
1104
+ {
1105
+ "name": "fsvDecimals",
1106
+ "type": "uint8",
1107
+ "internalType": "uint8",
1108
+ },
1109
+ {
1110
+ "name": "fspAlpha",
1111
+ "type": "int256",
1112
+ "internalType": "int256",
1113
+ },
1114
+ {
1115
+ "name": "fspBeta",
1116
+ "type": "int256",
1117
+ "internalType": "int256",
1118
+ },
1119
+ {
1120
+ "name": "fsvCalldata",
1121
+ "type": "bytes",
1122
+ "internalType": "bytes",
1123
+ },
1124
+ ],
1125
+ },
1126
+ {
1127
+ "name": "collateralAsset",
1128
+ "type": "address",
1129
+ "internalType": "address",
1130
+ },
1131
+ {
1132
+ "name": "startTime",
1133
+ "type": "uint256",
1134
+ "internalType": "uint256",
1135
+ },
1136
+ {
1137
+ "name": "pointValue",
1138
+ "type": "uint256",
1139
+ "internalType": "uint256",
1140
+ },
1141
+ {
1142
+ "name": "priceDecimals",
1143
+ "type": "uint8",
1144
+ "internalType": "uint8",
1145
+ },
1146
+ {
1147
+ "name": "extendedMetadata",
1148
+ "type": "string",
1149
+ "internalType": "string",
1150
+ },
1151
+ ],
1152
+ },
1153
+ {
1154
+ "name": "expirySpec",
1155
+ "type": "tuple",
1156
+ "internalType": "struct ExpirySpecification",
1157
+ "components": [
1158
+ {
1159
+ "name": "earliestFSPSubmissionTime",
1160
+ "type": "uint256",
1161
+ "internalType": "uint256",
1162
+ },
1163
+ {
1164
+ "name": "tradeoutInterval",
1165
+ "type": "uint256",
1166
+ "internalType": "uint256",
1167
+ },
1168
+ ],
1169
+ },
1170
+ {
1171
+ "name": "marginSpec",
1172
+ "type": "tuple",
1173
+ "internalType": "struct MarginSpecification",
1174
+ "components": [
1175
+ {
1176
+ "name": "imr",
1177
+ "type": "uint256",
1178
+ "internalType": "uint256",
1179
+ },
1180
+ {
1181
+ "name": "mmr",
1182
+ "type": "uint256",
1183
+ "internalType": "uint256",
1184
+ },
1185
+ ],
1186
+ },
1187
+ ],
1188
+ },
1189
+ {
1190
+ "name": "initialBuilderStake",
1191
+ "type": "uint256",
1192
+ "internalType": "uint256",
1193
+ },
1194
+ ],
1195
+ "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}],
1196
+ "stateMutability": "nonpayable",
1197
+ },
1198
+ {
1199
+ "type": "function",
1200
+ "name": "registerPredictionProduct",
1201
+ "inputs": [
1202
+ {
1203
+ "name": "product",
1204
+ "type": "tuple",
1205
+ "internalType": "struct PredictionProductV1",
1206
+ "components": [
1207
+ {
1208
+ "name": "base",
1209
+ "type": "tuple",
1210
+ "internalType": "struct BaseProduct",
1211
+ "components": [
1212
+ {
1213
+ "name": "metadata",
1214
+ "type": "tuple",
1215
+ "internalType": "struct ProductMetadata",
1216
+ "components": [
1217
+ {
1218
+ "name": "builder",
1219
+ "type": "address",
1220
+ "internalType": "address",
1221
+ },
1222
+ {
1223
+ "name": "symbol",
1224
+ "type": "string",
1225
+ "internalType": "string",
1226
+ },
1227
+ {
1228
+ "name": "description",
1229
+ "type": "string",
1230
+ "internalType": "string",
1231
+ },
1232
+ ],
1233
+ },
1234
+ {
1235
+ "name": "oracleSpec",
1236
+ "type": "tuple",
1237
+ "internalType": "struct OracleSpecification",
1238
+ "components": [
1239
+ {
1240
+ "name": "oracleAddress",
1241
+ "type": "address",
1242
+ "internalType": "address",
1243
+ },
1244
+ {
1245
+ "name": "fsvDecimals",
1246
+ "type": "uint8",
1247
+ "internalType": "uint8",
1248
+ },
1249
+ {
1250
+ "name": "fspAlpha",
1251
+ "type": "int256",
1252
+ "internalType": "int256",
1253
+ },
1254
+ {
1255
+ "name": "fspBeta",
1256
+ "type": "int256",
1257
+ "internalType": "int256",
1258
+ },
1259
+ {
1260
+ "name": "fsvCalldata",
1261
+ "type": "bytes",
1262
+ "internalType": "bytes",
1263
+ },
1264
+ ],
1265
+ },
1266
+ {
1267
+ "name": "collateralAsset",
1268
+ "type": "address",
1269
+ "internalType": "address",
1270
+ },
1271
+ {
1272
+ "name": "startTime",
1273
+ "type": "uint256",
1274
+ "internalType": "uint256",
1275
+ },
1276
+ {
1277
+ "name": "pointValue",
1278
+ "type": "uint256",
1279
+ "internalType": "uint256",
1280
+ },
1281
+ {
1282
+ "name": "priceDecimals",
1283
+ "type": "uint8",
1284
+ "internalType": "uint8",
1285
+ },
1286
+ {
1287
+ "name": "extendedMetadata",
1288
+ "type": "string",
1289
+ "internalType": "string",
1290
+ },
1291
+ ],
1292
+ },
1293
+ {
1294
+ "name": "expirySpec",
1295
+ "type": "tuple",
1296
+ "internalType": "struct ExpirySpecification",
1297
+ "components": [
1298
+ {
1299
+ "name": "earliestFSPSubmissionTime",
1300
+ "type": "uint256",
1301
+ "internalType": "uint256",
1302
+ },
1303
+ {
1304
+ "name": "tradeoutInterval",
1305
+ "type": "uint256",
1306
+ "internalType": "uint256",
1307
+ },
1308
+ ],
1309
+ },
1310
+ {
1311
+ "name": "maxPrice",
1312
+ "type": "int256",
1313
+ "internalType": "int256",
1314
+ },
1315
+ {
1316
+ "name": "minPrice",
1317
+ "type": "int256",
1318
+ "internalType": "int256",
1319
+ },
1320
+ ],
1321
+ },
1322
+ {
1323
+ "name": "initialBuilderStake",
1324
+ "type": "uint256",
1325
+ "internalType": "uint256",
1326
+ },
1327
+ ],
1328
+ "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}],
1329
+ "stateMutability": "nonpayable",
1330
+ },
1331
+ {
1332
+ "type": "function",
1333
+ "name": "state",
1334
+ "inputs": [
1335
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1336
+ ],
1337
+ "outputs": [
1338
+ {"name": "", "type": "uint8", "internalType": "enum ProductState"}
1339
+ ],
1340
+ "stateMutability": "view",
1341
+ },
1342
+ {
1343
+ "type": "function",
1344
+ "name": "typeOf",
1345
+ "inputs": [
1346
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1347
+ ],
1348
+ "outputs": [
1349
+ {"name": "", "type": "uint8", "internalType": "enum ProductType"}
1350
+ ],
1351
+ "stateMutability": "view",
1352
+ },
1353
+ {
1354
+ "type": "error",
1355
+ "name": "DepositNotPossible",
1356
+ "inputs": [
1357
+ {"name": "state", "type": "uint8", "internalType": "enum ProductState"}
1358
+ ],
1359
+ },
1360
+ {
1361
+ "type": "error",
1362
+ "name": "InsufficientBalance",
1363
+ "inputs": [
1364
+ {"name": "account", "type": "address", "internalType": "address"},
1365
+ {"name": "balance", "type": "uint256", "internalType": "uint256"},
1366
+ {"name": "required", "type": "uint256", "internalType": "uint256"},
1367
+ ],
1368
+ },
1369
+ {
1370
+ "type": "error",
1371
+ "name": "InvalidFSPSubmissionTime",
1372
+ "inputs": [
1373
+ {"name": "startTime", "type": "uint256", "internalType": "uint256"},
1374
+ {
1375
+ "name": "earliestFSPSubmissionTime",
1376
+ "type": "uint256",
1377
+ "internalType": "uint256",
1378
+ },
1379
+ ],
1380
+ },
1381
+ {
1382
+ "type": "error",
1383
+ "name": "InvalidFieldAccess",
1384
+ "inputs": [
1385
+ {
1386
+ "name": "productType",
1387
+ "type": "uint8",
1388
+ "internalType": "enum ProductType",
1389
+ },
1390
+ {"name": "field", "type": "string", "internalType": "string"},
1391
+ ],
1392
+ },
1393
+ {
1394
+ "type": "error",
1395
+ "name": "InvalidParameter",
1396
+ "inputs": [
1397
+ {"name": "paramName", "type": "string", "internalType": "string"}
1398
+ ],
1399
+ },
1400
+ {
1401
+ "type": "error",
1402
+ "name": "InvalidPriceRange",
1403
+ "inputs": [
1404
+ {"name": "minPrice", "type": "int256", "internalType": "int256"},
1405
+ {"name": "maxPrice", "type": "int256", "internalType": "int256"},
1406
+ ],
1407
+ },
1408
+ {
1409
+ "type": "error",
1410
+ "name": "InvalidProductId",
1411
+ "inputs": [
1412
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1413
+ ],
1414
+ },
1415
+ {
1416
+ "type": "error",
1417
+ "name": "InvalidStartTime",
1418
+ "inputs": [
1419
+ {"name": "startTime", "type": "uint256", "internalType": "uint256"},
1420
+ {
1421
+ "name": "blockTimestamp",
1422
+ "type": "uint256",
1423
+ "internalType": "uint256",
1424
+ },
1425
+ ],
1426
+ },
1427
+ {
1428
+ "type": "error",
1429
+ "name": "NotEnoughFee",
1430
+ "inputs": [
1431
+ {"name": "fee", "type": "uint256", "internalType": "uint256"},
1432
+ {"name": "requiredFee", "type": "uint256", "internalType": "uint256"},
1433
+ ],
1434
+ },
1435
+ {
1436
+ "type": "error",
1437
+ "name": "NotFound",
1438
+ "inputs": [
1439
+ {"name": "parameter", "type": "string", "internalType": "string"}
1440
+ ],
1441
+ },
1442
+ {
1443
+ "type": "error",
1444
+ "name": "NotImplemented",
1445
+ "inputs": [{"name": "feature", "type": "string", "internalType": "string"}],
1446
+ },
1447
+ {
1448
+ "type": "error",
1449
+ "name": "ProductExists",
1450
+ "inputs": [
1451
+ {"name": "productId", "type": "bytes32", "internalType": "bytes32"}
1452
+ ],
1453
+ },
1454
+ {
1455
+ "type": "error",
1456
+ "name": "SafeCastOverflowedUintToInt",
1457
+ "inputs": [{"name": "value", "type": "uint256", "internalType": "uint256"}],
1458
+ },
1459
+ {
1460
+ "type": "error",
1461
+ "name": "Unauthorized",
1462
+ "inputs": [
1463
+ {"name": "account", "type": "address", "internalType": "address"}
1464
+ ],
1465
+ },
1466
+ ],
1467
+ )