SymBot
SymBot copied to clipboard
API JSON value types are not consistent
trafficstars
This happens for at least two fields (the ones I noticed):
- data.orders.qtySum
- data.info.deal_max
In some cases, the return type is a string and in other cases it's numeric. This causes issues when deserializing the response from the API. An example below for qtySum:
"orders": [
{
"orderNo": 1,
"orderId": "1372925953",
"price": "0.16991",
"average": "0.16991",
"target": "0.17348",
"qty": "88.2",
"amount": "15.01603",
"qtySum": "88.2", <-----
"sum": "15.01603",
"type": "MARKET",
"filled": 1,
"dateFilled": "2024-03-08T17:22:42.489Z"
},
{
"orderNo": 2,
"orderId": "",
"price": "0.16651",
"average": "0.16853",
"target": "0.17207",
"qty": "90",
"amount": "15.01587",
"qtySum": 178.2, <-----
"sum": "30.0319",
"type": "MARKET",
"filled": 0
},