Apply lots of refactoring to the websocket subpackage (fix every mypy error and warning). Add integers.py and decimal.py to bfxapi.utils package. Update requirements.txt and setup.py with new mypy dependencies.

This commit is contained in:
Davide Casale
2022-12-16 18:30:41 +01:00
parent 0e4cbd40a6
commit 0a53ab7f7e
10 changed files with 393 additions and 348 deletions

9
bfxapi/utils/decimal.py Normal file
View File

@@ -0,0 +1,9 @@
import json
from decimal import Decimal
class DecimalEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Decimal):
return str(obj)
return json.JSONEncoder.default(self, obj)