Real-Time Monitoring
Stream compliance events in real time over WebSocket
Real-Time Monitoring
The Oracle provides a WebSocket endpoint for streaming compliance events in real time. Use it for dashboards, alerting, and live monitoring.
Connection
Connect to the WebSocket server at ws://host:port/ws:
Subscription Filters
Send a subscribe message to filter which events you receive:
| Pattern | Matches |
|---|---|
"transfer.executed" | Exact match only |
"transfer.*" | All transfer events (transfer.executed, transfer.blocked) |
"wallet.*" | All wallet events (wallet.verified, wallet.removed) |
"*" | All events |
Multiple filters are OR'd together. An empty filters array receives all events.
Event Format
Event types are the same as Webhooks: transfer.executed, transfer.blocked, wallet.verified, wallet.removed, compliance.violation, token.paused, token.resumed, config.updated.
Heartbeat
The server sends a WebSocket ping every 30 seconds. Clients must respond with pong (handled automatically by most WebSocket libraries). Clients that fail to respond are disconnected.
Node.js Client
Browser Client
Dashboard Integration
The Dashboard package uses a useRealtimeEvents hook that wraps the WebSocket connection:
Error Handling
Invalid JSON messages receive an error response:
The connection is not closed on error — only malformed messages are rejected.