Skip to main content

websocket

Functions

<dl> <dt><a href="#initWebSocket">initWebSocket(server, app)</a></dt> <dd><p>Initialize WebSocket server</p> </dd> <dt><a href="#handleMessage">handleMessage()</a></dt> <dd><p>Handle incoming WebSocket messages from clients</p> </dd> <dt><a href="#handleAuth">handleAuth()</a></dt> <dd><p>Handle client authentication</p> </dd> <dt><a href="#handleSubscribe">handleSubscribe()</a></dt> <dd><p>Handle wallet subscription</p> </dd> <dt><a href="#handleUnsubscribe">handleUnsubscribe()</a></dt> <dd><p>Handle wallet unsubscription</p> </dd> <dt><a href="#sendToClient">sendToClient()</a></dt> <dd><p>Send message to a specific client</p> </dd> <dt><a href="#broadcast">broadcast()</a></dt> <dd><p>Broadcast to all connected clients</p> </dd> <dt><a href="#emitToWallet">emitToWallet()</a></dt> <dd><p>Emit event to clients subscribed to a specific wallet</p> </dd> <dt><a href="#emitToTenant">emitToTenant()</a></dt> <dd><p>Emit event to clients by tenant ID</p> </dd> <dt><a href="#emitTxPending">emitTxPending()</a></dt> <dd><p>Emit transaction pending event</p> </dd> <dt><a href="#emitTxConfirmed">emitTxConfirmed()</a></dt> <dd><p>Emit transaction confirmed event</p> </dd> <dt><a href="#emitTxFailed">emitTxFailed()</a></dt> <dd><p>Emit transaction failed event</p> </dd> <dt><a href="#emitBalanceUpdate">emitBalanceUpdate()</a></dt> <dd><p>Emit wallet balance update</p> </dd> <dt><a href="#emitApprovalRequired">emitApprovalRequired()</a></dt> <dd><p>Emit approval required event (HITL)</p> </dd> <dt><a href="#emitApprovalUpdate">emitApprovalUpdate()</a></dt> <dd><p>Emit approval status change</p> </dd> <dt><a href="#getWsStats">getWsStats()</a></dt> <dd><p>Get WebSocket server stats</p> </dd> <dt><a href="#closeWebSocket">closeWebSocket()</a></dt> <dd><p>Close WebSocket server gracefully</p> </dd> </dl>

<a name="initWebSocket"></a>

initWebSocket(server, app)

Initialize WebSocket server

Kind: global function

ParamTypeDescription
server<code>Server</code>HTTP server instance
app<code>Express</code>Express app for path mounting

<a name="handleMessage"></a>

handleMessage()

Handle incoming WebSocket messages from clients

Kind: global function
<a name="handleAuth"></a>

handleAuth()

Handle client authentication

Kind: global function
<a name="handleSubscribe"></a>

handleSubscribe()

Handle wallet subscription

Kind: global function
<a name="handleUnsubscribe"></a>

handleUnsubscribe()

Handle wallet unsubscription

Kind: global function
<a name="sendToClient"></a>

sendToClient()

Send message to a specific client

Kind: global function
<a name="broadcast"></a>

broadcast()

Broadcast to all connected clients

Kind: global function
<a name="emitToWallet"></a>

emitToWallet()

Emit event to clients subscribed to a specific wallet

Kind: global function
<a name="emitToTenant"></a>

emitToTenant()

Emit event to clients by tenant ID

Kind: global function
<a name="emitTxPending"></a>

emitTxPending()

Emit transaction pending event

Kind: global function
<a name="emitTxConfirmed"></a>

emitTxConfirmed()

Emit transaction confirmed event

Kind: global function
<a name="emitTxFailed"></a>

emitTxFailed()

Emit transaction failed event

Kind: global function
<a name="emitBalanceUpdate"></a>

emitBalanceUpdate()

Emit wallet balance update

Kind: global function
<a name="emitApprovalRequired"></a>

emitApprovalRequired()

Emit approval required event (HITL)

Kind: global function
<a name="emitApprovalUpdate"></a>

emitApprovalUpdate()

Emit approval status change

Kind: global function
<a name="getWsStats"></a>

getWsStats()

Get WebSocket server stats

Kind: global function
<a name="closeWebSocket"></a>

closeWebSocket()

Close WebSocket server gracefully

Kind: global function