afp-sdk 0.5.3__py3-none-any.whl → 0.5.4__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 +9 -3
- afp/exceptions.py +4 -0
- afp/exchange.py +3 -0
- afp/schemas.py +3 -1
- {afp_sdk-0.5.3.dist-info → afp_sdk-0.5.4.dist-info}/METADATA +1 -1
- {afp_sdk-0.5.3.dist-info → afp_sdk-0.5.4.dist-info}/RECORD +8 -8
- {afp_sdk-0.5.3.dist-info → afp_sdk-0.5.4.dist-info}/WHEEL +0 -0
- {afp_sdk-0.5.3.dist-info → afp_sdk-0.5.4.dist-info}/licenses/LICENSE +0 -0
afp/api/trading.py
CHANGED
|
@@ -124,8 +124,9 @@ class Trading(ExchangeAPI):
|
|
|
124
124
|
|
|
125
125
|
Raises
|
|
126
126
|
------
|
|
127
|
-
afp.exceptions.
|
|
128
|
-
If the exchange rejects the
|
|
127
|
+
afp.exceptions.RateLimitExceeded
|
|
128
|
+
If the exchange rejects the order because of too many requests from the
|
|
129
|
+
authenticated account.
|
|
129
130
|
"""
|
|
130
131
|
submission = OrderSubmission(
|
|
131
132
|
type=OrderType.LIMIT_ORDER,
|
|
@@ -147,8 +148,13 @@ class Trading(ExchangeAPI):
|
|
|
147
148
|
|
|
148
149
|
Raises
|
|
149
150
|
------
|
|
151
|
+
afp.exceptions.NotFoundError
|
|
152
|
+
If the exchange rejects the cancellation because the intent does not exist.
|
|
153
|
+
afp.exceptions.RateLimitExceeded
|
|
154
|
+
If the exchange rejects the cancellation because of too many requests from
|
|
155
|
+
the authenticated account.
|
|
150
156
|
afp.exceptions.ValidationError
|
|
151
|
-
If the exchange rejects the cancellation.
|
|
157
|
+
If the exchange rejects the cancellation because it is invalid.
|
|
152
158
|
"""
|
|
153
159
|
nonce = self._generate_nonce()
|
|
154
160
|
cancellation_hash = hashing.generate_order_cancellation_hash(nonce, intent_hash)
|
afp/exceptions.py
CHANGED
afp/exchange.py
CHANGED
|
@@ -11,6 +11,7 @@ from .exceptions import (
|
|
|
11
11
|
AuthorizationError,
|
|
12
12
|
ExchangeError,
|
|
13
13
|
NotFoundError,
|
|
14
|
+
RateLimitExceeded,
|
|
14
15
|
ValidationError,
|
|
15
16
|
)
|
|
16
17
|
from .schemas import (
|
|
@@ -198,6 +199,8 @@ class ExchangeClient:
|
|
|
198
199
|
raise AuthorizationError(http_error) from http_error
|
|
199
200
|
if http_error.response.status_code == requests.codes.NOT_FOUND:
|
|
200
201
|
raise NotFoundError(http_error) from http_error
|
|
202
|
+
if http_error.response.status_code == requests.codes.TOO_MANY_REQUESTS:
|
|
203
|
+
raise RateLimitExceeded(http_error) from http_error
|
|
201
204
|
if http_error.response.status_code == requests.codes.BAD_REQUEST:
|
|
202
205
|
try:
|
|
203
206
|
reason = response.json()["detail"]
|
afp/schemas.py
CHANGED
|
@@ -78,7 +78,8 @@ class LoginSubmission(Model):
|
|
|
78
78
|
|
|
79
79
|
class ExchangeParameters(Model):
|
|
80
80
|
trading_protocol_id: str
|
|
81
|
-
|
|
81
|
+
maker_trading_fee_rate: Decimal
|
|
82
|
+
taker_trading_fee_rate: Decimal
|
|
82
83
|
|
|
83
84
|
|
|
84
85
|
# Admin API
|
|
@@ -182,6 +183,7 @@ class OrderFill(Model):
|
|
|
182
183
|
trade: Trade
|
|
183
184
|
quantity: int
|
|
184
185
|
price: Decimal
|
|
186
|
+
trading_fee_rate: Decimal
|
|
185
187
|
|
|
186
188
|
|
|
187
189
|
class OrderFillFilter(PaginationFilter):
|
|
@@ -5,7 +5,7 @@ afp/api/admin.py,sha256=6TiWCo0SB41CtXYTkTYYGQY7MrdB6OMTyU3-0J0V_7o,2170
|
|
|
5
5
|
afp/api/base.py,sha256=5X1joEwFX4gxYUDCSTvp_hSFCfLZCktnW-UtZFxDquk,4471
|
|
6
6
|
afp/api/margin_account.py,sha256=sC1DF7J3QTHR7cXcRjTG33oZswVy6qr9xnevQbrQ-ew,15256
|
|
7
7
|
afp/api/product.py,sha256=2N4bPBahuw19GcBbBL20oQ5RFRuUxa5LOZzmN7hs39U,10156
|
|
8
|
-
afp/api/trading.py,sha256=
|
|
8
|
+
afp/api/trading.py,sha256=RvsMjPBiuwyB64SsiVAUgKXFRazodq-iht6FdlgSX1A,17649
|
|
9
9
|
afp/auth.py,sha256=sV_9E6CgRWV1xYoppc4IdrnqNo5ZNDBIp6QF3fQbMWE,2055
|
|
10
10
|
afp/bindings/__init__.py,sha256=_n9xoogYi8AAlSx_PE-wjnwP1ujVyDUwoRM0BSm243U,1271
|
|
11
11
|
afp/bindings/auctioneer_facet.py,sha256=4p906zdU2lUsqpWlsiLE3dlxTPrlNpqk8DtjiQUWJ8M,23919
|
|
@@ -25,13 +25,13 @@ afp/config.py,sha256=_WKywiuty8poE1A0v46uBe1JGpfCzRlxCPamKennfpE,699
|
|
|
25
25
|
afp/constants.py,sha256=EvDhLpKBOsc8OHGm1paiUAdAetPGD4nyi13coB8rd14,1930
|
|
26
26
|
afp/decorators.py,sha256=SEUQtbgPGc4iVPtBQV2eiCejcDAVImmXcI0uPXFhtJA,2774
|
|
27
27
|
afp/enums.py,sha256=9JhwdLcTNhyKabKdrALAlCeL3C5XfeXYSSSXSCsuTzE,688
|
|
28
|
-
afp/exceptions.py,sha256=
|
|
29
|
-
afp/exchange.py,sha256=
|
|
28
|
+
afp/exceptions.py,sha256=sgPOzrqbB0u8Kc6N65j5_0y4owyyq4oU6-5idcJO7Rs,441
|
|
29
|
+
afp/exchange.py,sha256=auy5SRNaf1PdsqY4HU8w4tAe1KPb_sAGsTW-K-HW76o,7673
|
|
30
30
|
afp/hashing.py,sha256=gBCWN93-ydRPlgnnorSvDQlylcnglrAypRDb-1K-20I,1949
|
|
31
31
|
afp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
|
-
afp/schemas.py,sha256=
|
|
32
|
+
afp/schemas.py,sha256=sCARcUvUNEZMcR2nn3iWrygAaoYqv038cLI9EXJFG9A,6818
|
|
33
33
|
afp/validators.py,sha256=zQvPu3HDu6ADnEE72EJlS5hc1-xfru78Mzd74s1u_EM,1841
|
|
34
|
-
afp_sdk-0.5.
|
|
35
|
-
afp_sdk-0.5.
|
|
36
|
-
afp_sdk-0.5.
|
|
37
|
-
afp_sdk-0.5.
|
|
34
|
+
afp_sdk-0.5.4.dist-info/licenses/LICENSE,sha256=ZdaKItgc2ppfqta2OJV0oHpSJiK87PUxmUkUo-_0SB8,1065
|
|
35
|
+
afp_sdk-0.5.4.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
36
|
+
afp_sdk-0.5.4.dist-info/METADATA,sha256=dGqKdpflOR9xCeYhMMZHzCcXzwgM0ItpP8NJFOj2C_0,6354
|
|
37
|
+
afp_sdk-0.5.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|