coinbase / coinbase-pro-node

DEPRECATED — The official Node.js library for Coinbase Pro
Apache License 2.0
844 stars 316 forks source link

Authenticated websocket fails due to timestamp serialization #377

Closed jotakami closed 4 years ago

jotakami commented 5 years ago

Subscribe messages sent to the websocket using authentication are failing; example message: { "type":"subscribe", "channels":["user","heartbeat"], "product_ids":["BTC-USD"], "signature":"...", "key":"...", "passphrase":"...", "timestamp":1565293109.888 } receives this response: �invalid (un)subscribe msg which, of course, causes a SyntaxError and crashes because that is passed into JSON.parse.

After hours of debugging I've determined this is because the timestamp is not quoted. Add quotes around the timestamp value and the message is accepted.

The websocket used to work out of the box, so I'm not sure if this was a change in the API that required strings for the timestamp or what. Oddly enough, this issue doesn't come up in the REST API.

jotakami commented 5 years ago

376 fixes this

drewrothstein commented 4 years ago

Hi, we are closing out PRs + Issues as this project is being archived.