mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
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:
9
bfxapi/utils/decimal.py
Normal file
9
bfxapi/utils/decimal.py
Normal 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)
|
||||
Reference in New Issue
Block a user