Improve JSONEncoder class in bfxapi.utils.json_encoder.

This commit is contained in:
Davide Casale
2023-05-26 18:02:41 +02:00
parent dbc61ab275
commit bc0f83d408
3 changed files with 58 additions and 57 deletions

View File

@@ -128,7 +128,7 @@ class RestAuthenticatedEndpoints(Middleware):
all: bool = False) -> Notification[List[Order]]:
body = {
"ids": ids, "cids": cids, "gids": gids,
"all": int(all)
"all": all
}
return _Notification[List[Order]](serializers.Order, is_iterable=True) \
@@ -319,7 +319,7 @@ class RestAuthenticatedEndpoints(Middleware):
rate: Optional[int] = None,
period: Optional[int] = None) -> Notification[FundingAutoRenew]:
body = {
"status": int(status), "currency": currency, "amount": amount,
"status": status, "currency": currency, "amount": amount,
"rate": rate, "period": period
}
@@ -449,7 +449,7 @@ class RestAuthenticatedEndpoints(Middleware):
renew: bool = False) -> Notification[DepositAddress]:
return _Notification[DepositAddress](serializers.DepositAddress) \
.parse(*self._post("auth/w/deposit/address", \
body={ "wallet": wallet, "method": method, "renew": int(renew) }))
body={ "wallet": wallet, "method": method, "renew": renew }))
def generate_deposit_invoice(self,
wallet: str,