afp-sdk 0.1.2__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.
- afp/api/trading.py +13 -1
- afp/bindings/system_viewer.py +1235 -0
- afp/bindings/trading_protocol.py +24 -0
- afp/schemas.py +2 -1
- afp/validators.py +13 -0
- {afp_sdk-0.1.2.dist-info → afp_sdk-0.2.1.dist-info}/METADATA +1 -1
- {afp_sdk-0.1.2.dist-info → afp_sdk-0.2.1.dist-info}/RECORD +9 -8
- {afp_sdk-0.1.2.dist-info → afp_sdk-0.2.1.dist-info}/WHEEL +1 -1
- {afp_sdk-0.1.2.dist-info → afp_sdk-0.2.1.dist-info}/licenses/LICENSE +0 -0
afp/bindings/trading_protocol.py
CHANGED
|
@@ -101,6 +101,11 @@ class TradingProtocol:
|
|
|
101
101
|
"""Binding for `event RoleRevoked` on the TradingProtocol contract."""
|
|
102
102
|
return self._contract.events.RoleRevoked
|
|
103
103
|
|
|
104
|
+
@property
|
|
105
|
+
def SequenceExecuted(self) -> contract.ContractEvent:
|
|
106
|
+
"""Binding for `event SequenceExecuted` on the TradingProtocol contract."""
|
|
107
|
+
return self._contract.events.SequenceExecuted
|
|
108
|
+
|
|
104
109
|
@property
|
|
105
110
|
def Upgraded(self) -> contract.ContractEvent:
|
|
106
111
|
"""Binding for `event Upgraded` on the TradingProtocol contract."""
|
|
@@ -718,6 +723,25 @@ ABI = typing.cast(
|
|
|
718
723
|
"name": "RoleRevoked",
|
|
719
724
|
"type": "event",
|
|
720
725
|
},
|
|
726
|
+
{
|
|
727
|
+
"anonymous": False,
|
|
728
|
+
"inputs": [
|
|
729
|
+
{
|
|
730
|
+
"indexed": False,
|
|
731
|
+
"internalType": "bool[]",
|
|
732
|
+
"name": "results",
|
|
733
|
+
"type": "bool[]",
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"indexed": False,
|
|
737
|
+
"internalType": "bytes[]",
|
|
738
|
+
"name": "errors",
|
|
739
|
+
"type": "bytes[]",
|
|
740
|
+
},
|
|
741
|
+
],
|
|
742
|
+
"name": "SequenceExecuted",
|
|
743
|
+
"type": "event",
|
|
744
|
+
},
|
|
721
745
|
{
|
|
722
746
|
"anonymous": False,
|
|
723
747
|
"inputs": [
|
afp/schemas.py
CHANGED
afp/validators.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from datetime import datetime, timedelta
|
|
2
|
+
from decimal import Decimal
|
|
2
3
|
|
|
3
4
|
from binascii import Error
|
|
4
5
|
from eth_typing.evm import ChecksumAddress
|
|
@@ -41,3 +42,15 @@ def validate_address(value: str) -> ChecksumAddress:
|
|
|
41
42
|
return Web3.to_checksum_address(value)
|
|
42
43
|
except ValueError:
|
|
43
44
|
raise ValueError(f"{value} is not a valid blockchain address")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def validate_limit_price(
|
|
48
|
+
value: Decimal, tick_size: int, rounding: str | None = None
|
|
49
|
+
) -> Decimal:
|
|
50
|
+
if rounding is None:
|
|
51
|
+
num_fractional_digits = abs(int(value.normalize().as_tuple().exponent))
|
|
52
|
+
if num_fractional_digits > tick_size:
|
|
53
|
+
raise ValueError(
|
|
54
|
+
f"Limit price {value} can have at most {tick_size} fractional digits"
|
|
55
|
+
)
|
|
56
|
+
return value.quantize(Decimal("10") ** -tick_size, rounding=rounding)
|
|
@@ -5,7 +5,7 @@ afp/api/base.py,sha256=iS-sjAc9mME2qOMEvnB6T6x9L_8oeJnHY6h79xrbAOE,2632
|
|
|
5
5
|
afp/api/builder.py,sha256=mde8XemEMKL76KgEd5rxg7RLBS6lyIfNOEGmE1_iK0M,7114
|
|
6
6
|
afp/api/clearing.py,sha256=nMVjayFkf0XYYP3aKAdgR6NaFSG4Cl_QsEuADRuIO7M,12922
|
|
7
7
|
afp/api/liquidation.py,sha256=CtME5524VVW9mXMMpORyUP205sTVqpLnHIPoTy2MGa8,5439
|
|
8
|
-
afp/api/trading.py,sha256=
|
|
8
|
+
afp/api/trading.py,sha256=HjskW4c13CwAB-AwyIsSBcvyXKKEJk7a9768tqcTzUE,10648
|
|
9
9
|
afp/bindings/__init__.py,sha256=5PDdlk0aClsTt2NgbVqP-R-z2QQp99IfXaSB13Pmf5c,1155
|
|
10
10
|
afp/bindings/auctioneer_facet.py,sha256=99FmK35trfOIJGqJqyc1NnpG0KavhH0_jNufszZ9VhA,24013
|
|
11
11
|
afp/bindings/bankruptcy_facet.py,sha256=Yg8sLhDU0crsL1ISSy4eoeQEP5jrAuiWBBlco5MtgPc,11370
|
|
@@ -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/
|
|
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=
|
|
29
|
+
afp/schemas.py,sha256=8nlNPq6t_jmYEpa_WWhOIr_yvpQv5tj86uvpGTNHWZY,4996
|
|
29
30
|
afp/signing.py,sha256=7fohnAvoiDA4ems_3OcVnr16OmYLSg9NnnCSzDplg6s,2235
|
|
30
|
-
afp/validators.py,sha256=
|
|
31
|
-
afp_sdk-0.1.
|
|
32
|
-
afp_sdk-0.1.
|
|
33
|
-
afp_sdk-0.1.
|
|
34
|
-
afp_sdk-0.1.
|
|
31
|
+
afp/validators.py,sha256=m61ZpP385CxsdDGJavPkXKTXnJAHKLCzedoZ8mL6daI,1818
|
|
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,,
|
|
File without changes
|