Websocket

Mainnet websocket URL: wss://ws.pacifica.fi/wsarrow-up-right Testnet websocket URL: wss://test-ws.pacifica.fi/wsarrow-up-right

The API service provides a universal endpoint for websocket streams. The subscribed data will be streamed in the corresponding channel after the connection is established.

Subscription Message

{
    "method": "subscribe",
    "params": { ... }
}

Unsubscription Message

{
    "method": "unsubscribe",
    "params": { ... }
}

Heartbeat and Timeout

A webscoket connection will be closed if no message is sent for the past 60 seconds, or the connection has been alive for 24 hours.

To keep the connection alive without messages in 60 seconds, we can send a heartbeat message

{
    "method": "ping"
}

and alive connection will respond with

Last updated