afp-sdk 0.2.0__py3-none-any.whl → 0.2.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.
@@ -59,24 +59,6 @@ class Trade:
59
59
  intents: typing.List[Intent]
60
60
 
61
61
 
62
- @dataclass
63
- class Settlement:
64
- """Port of `struct Settlement` on the IMarginAccount contract."""
65
-
66
- position_id: hexbytes.HexBytes
67
- quantity: int
68
- price: int
69
-
70
-
71
- @dataclass
72
- class Order:
73
- """Port of `struct Order` on the ITradingProtocol contract."""
74
-
75
- margin_account_id: eth_typing.ChecksumAddress
76
- margin_account_contract: eth_typing.ChecksumAddress
77
- settlement: Settlement
78
-
79
-
80
62
  class TradingProtocol:
81
63
  """TradingProtocol contract binding.
82
64
 
@@ -473,36 +455,6 @@ class TradingProtocol:
473
455
  clearing_address,
474
456
  )
475
457
 
476
- def order_mae_check(
477
- self,
478
- orders: typing.List[Order],
479
- ) -> typing.List[bool]:
480
- """Binding for `orderMAECheck` on the TradingProtocol contract.
481
-
482
- Parameters
483
- ----------
484
- orders : typing.List[Order]
485
-
486
- Returns
487
- -------
488
- typing.List[bool]
489
- """
490
- return_value = self._contract.functions.orderMAECheck(
491
- [
492
- (
493
- item.margin_account_id,
494
- item.margin_account_contract,
495
- (
496
- item.settlement.position_id,
497
- item.settlement.quantity,
498
- item.settlement.price,
499
- ),
500
- )
501
- for item in orders
502
- ],
503
- ).call()
504
- return [bool(return_value_elem) for return_value_elem in return_value]
505
-
506
458
  def proxiable_uuid(
507
459
  self,
508
460
  ) -> hexbytes.HexBytes:
@@ -1172,55 +1124,6 @@ ABI = typing.cast(
1172
1124
  "stateMutability": "nonpayable",
1173
1125
  "type": "function",
1174
1126
  },
1175
- {
1176
- "inputs": [
1177
- {
1178
- "components": [
1179
- {
1180
- "internalType": "address",
1181
- "name": "marginAccountID",
1182
- "type": "address",
1183
- },
1184
- {
1185
- "internalType": "address",
1186
- "name": "marginAccountContract",
1187
- "type": "address",
1188
- },
1189
- {
1190
- "components": [
1191
- {
1192
- "internalType": "bytes32",
1193
- "name": "positionId",
1194
- "type": "bytes32",
1195
- },
1196
- {
1197
- "internalType": "int256",
1198
- "name": "quantity",
1199
- "type": "int256",
1200
- },
1201
- {
1202
- "internalType": "uint256",
1203
- "name": "price",
1204
- "type": "uint256",
1205
- },
1206
- ],
1207
- "internalType": "struct IMarginAccount.Settlement",
1208
- "name": "settlement",
1209
- "type": "tuple",
1210
- },
1211
- ],
1212
- "internalType": "struct ITradingProtocol.Order[]",
1213
- "name": "orders",
1214
- "type": "tuple[]",
1215
- }
1216
- ],
1217
- "name": "orderMAECheck",
1218
- "outputs": [
1219
- {"internalType": "bool[]", "name": "results", "type": "bool[]"}
1220
- ],
1221
- "stateMutability": "view",
1222
- "type": "function",
1223
- },
1224
1127
  {
1225
1128
  "inputs": [],
1226
1129
  "name": "proxiableUUID",
afp/schemas.py CHANGED
@@ -109,7 +109,8 @@ class OrderSubmission(Model):
109
109
 
110
110
 
111
111
  class Trade(Model):
112
- id: int
112
+ # Convert ID from int to str for backward compatibility
113
+ id: Annotated[str, BeforeValidator(str)]
113
114
  product_id: str
114
115
  price: Decimal
115
116
  timestamp: Timestamp
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: afp-sdk
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Autonomous Futures Protocol Python SDK
5
5
  Keywords: autonity,web3,trading,crypto,prediction,forecast,markets
6
6
  License-Expression: MIT
@@ -18,17 +18,18 @@ afp/bindings/margin_account_registry.py,sha256=mx9sAU6HuC09d-LAf9bzP57HPLa3M6qXp
18
18
  afp/bindings/mark_price_tracker_facet.py,sha256=vnVsAmpts_2Sv9Jmx3JlON8X8FJd9D2jOFhqSwXIA7A,2830
19
19
  afp/bindings/oracle_provider.py,sha256=CMpVAXdUuTP_W9ZE297B-m9MjuW90yCOhNLMVl3kCf0,15863
20
20
  afp/bindings/product_registry.py,sha256=HFWwbFKvXk0A2dZB6KBa0Ul8-vX9uvvtGj0dhRL9UUw,43701
21
- afp/bindings/trading_protocol.py,sha256=a8QLCQ9bKgV26IW1y4aY8js9ykO8l2_VTM8YPCo6SqM,43895
21
+ afp/bindings/system_viewer.py,sha256=v5yeogqMsRTjG3aRUd8O1oiQZ4ErEaOTfcctTfmcRu8,42767
22
+ afp/bindings/trading_protocol.py,sha256=FSfK4HejLQUb7oNiGmyvyqbkUAG379OXNK2F5SG1Qzg,40642
22
23
  afp/config.py,sha256=3S7k49n4ZaRko3FX6Hw95r5L-sw2XiAjWtqYiX3Omx0,1017
23
24
  afp/decorators.py,sha256=Ustc15RbXGYIEqDb9lXnd-bdhZJ8ZrztN4h_vjkLsG0,2692
24
25
  afp/enums.py,sha256=4dglBx4Amcu0GrlJn0cIj-rp9uDHZGfDEP_vMAO02xo,485
25
26
  afp/exceptions.py,sha256=RE8IE6akDgbar2PobdpOiBdGZZCYkb4jWf1ozJmdLaI,342
26
27
  afp/exchange.py,sha256=l8Cartp0R4PPe6O_Wu10YDw-5P_PbaAkd7w-W5QrlWY,5272
27
28
  afp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- afp/schemas.py,sha256=nCR8FLnq8msTFW9wsLxjTrxIzcKG85BKG-WmQ5Oazrc,4903
29
+ afp/schemas.py,sha256=8nlNPq6t_jmYEpa_WWhOIr_yvpQv5tj86uvpGTNHWZY,4996
29
30
  afp/signing.py,sha256=7fohnAvoiDA4ems_3OcVnr16OmYLSg9NnnCSzDplg6s,2235
30
31
  afp/validators.py,sha256=m61ZpP385CxsdDGJavPkXKTXnJAHKLCzedoZ8mL6daI,1818
31
- afp_sdk-0.2.0.dist-info/licenses/LICENSE,sha256=ZdaKItgc2ppfqta2OJV0oHpSJiK87PUxmUkUo-_0SB8,1065
32
- afp_sdk-0.2.0.dist-info/WHEEL,sha256=NHRAbdxxzyL9K3IO2LjmlNqKSyPZnKv2BD16YYVKo18,79
33
- afp_sdk-0.2.0.dist-info/METADATA,sha256=GXQP-Cbxe6UAMmmveYzLeG8vDgRodS0N_9jz0Bx1FlE,5618
34
- afp_sdk-0.2.0.dist-info/RECORD,,
32
+ afp_sdk-0.2.1.dist-info/licenses/LICENSE,sha256=ZdaKItgc2ppfqta2OJV0oHpSJiK87PUxmUkUo-_0SB8,1065
33
+ afp_sdk-0.2.1.dist-info/WHEEL,sha256=NHRAbdxxzyL9K3IO2LjmlNqKSyPZnKv2BD16YYVKo18,79
34
+ afp_sdk-0.2.1.dist-info/METADATA,sha256=muk0O2vQMBGviKdMsUXxCwmwKUWJqviVSkPuz4y1yMo,5618
35
+ afp_sdk-0.2.1.dist-info/RECORD,,