Cause: Attempting to connect/subscribe with a missing API key.Solution:
// ❌ This will failconst ws = new WebSocket('wss://ws.amberdata.com/spot');// ✅ Must provide API keyconst ws = new WebSocket('wss://ws.amberdata.com/spot', { headers: { 'x-api-key': 'VALID_API_KEY_HERE' }});
5. Missing Parameter(s)
Error Response:
{ "jsonrpc": "2.0", "id": 1, "error": { "description": "params must contain either 1 or 2 elements", "code": 400 }}
Cause: Attempting to subscribe with no parameters.Solution:
// ❌ This will fail{ "jsonrpc": "2.0", "id": 1, "method": "subscribe"}// ✅ Must provide params{ "jsonrpc": "2.0", "id": 1, "method": "subscribe", "params": [ "market:spot:trades", { "pair": "btc_usd", "exchange": "gdax" } ]}