Skip to main content
Use one Relayer WebSocket connection to send control messages and receive events for subscribed topics.

Definition

Client-to-server messages are control messages. A control message has an action, optional requestId, and action-specific fields. Server-to-client messages are acknowledgments or pushed events.

Lifecycle

1

Connect

Open wss://relayer.xoxno.com/ws for subscriptions, broadcast, and relay. Use wss://relayer.xoxno.com/ws/stats only for push-only network stats.
2

Subscribe

Send {"action":"subscribe","topic":"..."} for each topic you need.
3

Read the acknowledgment

Match requestId when present. Acknowledgment success means the Relayer accepted the control message; future event delivery still depends on matching chain activity.
4

Process events

Branch on type, such as gasStats, networkStats, accountDelta, or txStatus.
5

Unsubscribe and reconnect

Unsubscribe from topics you no longer need. After reconnect, re-send subscriptions because topic state belongs to the prior connection.

Limits

Worked Example

Reconnect Rules