Overview
We use Socket.IO v4 protocol for WebSocket communication.
Connection Information
WebSocket URL:
for sandbox:
https://wss-test.1dex.com/socket.io
for production:
https://wss.1dex.com/socket.io
Protocol: Socket.IO v4
Ping Interval: 10 seconds
Ping Timeout: 5 seconds
Connection Timeout: 5 seconds
Authentication Flow
1. User Authentication
Users can authenticate by sending the authenticate
event:
socket.emit('authenticate', 'api-key');
socket.on('authenticated', (response) => {
console.log(response);
// response:
// {
// "status": "success",
// "account": "account"
// }
});
2. Unauthenticate
socket.emit('unauthenticate', 'api-key');
Last updated