const socket = new WebSocket("wss://production-api.mobula.io");socket.addEventListener("open", () => { socket.send(`{ "type": "ohlcv", "authorization": "YOUR_API_KEY", "payload": { "address": "0x123456789", "chainId": "evm:1", "period": "1h", }}`);});socket.addEventListener("message", (event) => { const data = JSON.parse(event.data); console.log(data); // ...});// No need to close the socket, it will close automatically.
You can use the Network tab in your browser to see the WSS requests.