snap_closeWebSocket
Description
Closes a WebSocket connection that was previously opened with
snap_openWebSocket.
Parameters
object
requiredAn object containing the parameters for the snap_closeWebSocket method.
id
stringThe ID of the WebSocket connection to close.
Returns
null
This method does not return any data, so the result is always null.
Example
- Manifest
- Usage
{
"initialPermissions": {
"endowment:network-access": {}
}
}
await snap.request({
method: "snap_closeWebSocket",
params: { id: "websocket-1" },
});