GENERALBYTESCOM / batm_public

BATM Public Repository
www.generalbytes.com
Other
98 stars 240 forks source link

Coinbase v2 API returns JSON object instead of String for the currency prop #833

Closed rudygodoy closed 1 year ago

rudygodoy commented 1 year ago

Sometime around the end of July the Coinbase DTO began to fail, making requests also fail. It seems the currency object now returns another JSON object, rather than a String, as described on the API documentation.

It seems that the currency JSON object is now compliant with the Currency endpoint's JSON object, returning one of these:

{
    "code": "BTC",
    "name": "Bitcoin",
    "color": "#F7931A",
    "sort_index": 100,
    "exponent": 8,
    "type": "crypto",
    "address_regex": "^([13][a-km-zA-HJ-NP-Z1-9]{25,34})|^(bc1[qzry9x8gf2tvdw0s3jn54khce6mua7l]([qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}|[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58}))$",
    "asset_id": "5b71fc48-3dd3-540c-809b-f8c94d0e68b5"
  }

I believe, for fixing this issue, we would just need to return the "code" prop instead.

https://github.com/GENERALBYTESCOM/batm_public/blob/785e621e4bbba951d51b6cb4cf20ccb69e98c4fe/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/wallets/coinbase/v2/dto/CBAccount.java#L130

rudygodoy commented 1 year ago

It has been fixed in patch 20230601.34