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.
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.