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 CHANGED
@@ -124,8 +124,9 @@ class Trading(ExchangeAPI):
124
124
 
125
125
  Raises
126
126
  ------
127
- afp.exceptions.ValidationError
128
- If the exchange rejects the intent.
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
@@ -26,5 +26,9 @@ class NotFoundError(ExchangeError):
26
26
  pass
27
27
 
28
28
 
29
+ class RateLimitExceeded(ExchangeError):
30
+ pass
31
+
32
+
29
33
  class ValidationError(ExchangeError):
30
34
  pass
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
- trading_fee_rate: Decimal
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: afp-sdk
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: Autonomous Futures Protocol Python SDK
5
5
  Keywords: autonity,web3,trading,crypto,prediction,forecast,markets
6
6
  License-Expression: MIT
@@ -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=y5Q2KApEpUau9R8G9KUqOdm4ymhw9Hbu9d2dkG80AsQ,17262
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=frdS-EH84K0fOf92RgRgNkTe3VII2m36XNCS8eyXLLM,390
29
- afp/exchange.py,sha256=QQAfglOzsxo_T0BUOFAkxI2wUbda1sKStMXUO9IcDbw,7498
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=zyZOPvAdDnXp60kqYqX-OoWnKvRLPZT7at0A0MHlurc,6746
32
+ afp/schemas.py,sha256=sCARcUvUNEZMcR2nn3iWrygAaoYqv038cLI9EXJFG9A,6818
33
33
  afp/validators.py,sha256=zQvPu3HDu6ADnEE72EJlS5hc1-xfru78Mzd74s1u_EM,1841
34
- afp_sdk-0.5.3.dist-info/licenses/LICENSE,sha256=ZdaKItgc2ppfqta2OJV0oHpSJiK87PUxmUkUo-_0SB8,1065
35
- afp_sdk-0.5.3.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
36
- afp_sdk-0.5.3.dist-info/METADATA,sha256=__Jo9oroNSkI1O9-vAOSA2HrSEONWX95AB4nLKkrjg0,6354
37
- afp_sdk-0.5.3.dist-info/RECORD,,
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,,