3cqs-coder / SymBot

SymBot is a user friendly, self-hosted and automated DCA (Dollar Cost Averaging) cryptocurrency bot solution
https://www.3cqs.com
Other
175 stars 15 forks source link

API JSON value types are not consistent #45

Closed OneThrill closed 1 month ago

OneThrill commented 6 months ago

This happens for at least two fields (the ones I noticed):

  1. data.orders.qtySum
  2. 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
            },
3cqs-coder commented 1 month ago

This is now fixed