mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 14:54:21 +01:00
9 lines
280 B
Python
9 lines
280 B
Python
import json
|
|
from decimal import Decimal
|
|
from datetime import datetime
|
|
|
|
class JSONEncoder(json.JSONEncoder):
|
|
def default(self, obj):
|
|
if isinstance(obj, Decimal) or isinstance(obj, datetime):
|
|
return str(obj)
|
|
return json.JSONEncoder.default(self, obj) |