Skip to main content
  • Snap

snap_sendWebSocketMessage

Description

Send a message to an open WebSocket connection. The message will be sent to the WebSocket connection with the specified ID, which must have been previously opened by the Snap using the snap_openWebSocket method.

Parameters

object
required

An object describing the WebSocket message to send.

id

string
required

The ID of the WebSocket connection to send a message to.

message

union
required

The message to send. This can be either a string or an array of numbers representing binary data.

Options

string

or

number[]

Returns

null

This method does not return any data, so the result is always null.

Example

{
"initialPermissions": {
"endowment:network-access": {}
}
}
On this page