Skip to content

webSocket

webSocket(url?, config?): WebSocketTransport

Parameters

url?: string

URL of the JSON-RPC API. Defaults to the chain’s public RPC URL.

config?: WebSocketTransportConfig

Returns

WebSocketTransport

Description

Creates a WebSocket transport that connects to a JSON-RPC API.

Defined in

node_modules/.pnpm/viem@2.21.15_bufferutil@4.0.8_typescript@5.6.2_utf-8-validate@6.0.4_zod@3.23.8/node_modules/viem/_types/clients/transports/webSocket.d.ts:59