1 | import { SocketProvider } from "./provider-socket.js";
|
2 | import type { JsonRpcApiProviderOptions } from "./provider-jsonrpc.js";
|
3 | import type { Networkish } from "./network.js";
|
4 |
|
5 |
|
6 |
|
7 | export interface WebSocketLike {
|
8 | onopen: null | ((...args: Array<any>) => any);
|
9 | onmessage: null | ((...args: Array<any>) => any);
|
10 | onerror: null | ((...args: Array<any>) => any);
|
11 | readyState: number;
|
12 | send(payload: any): void;
|
13 | close(code?: number, reason?: string): void;
|
14 | }
|
15 | /**
|
16 | * A function which can be used to re-create a WebSocket connection
|
17 | * on disconnect.
|
18 | */
|
19 | export type WebSocketCreator = () => WebSocketLike;
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export declare class WebSocketProvider extends SocketProvider {
|
31 | #private;
|
32 | get websocket(): WebSocketLike;
|
33 | constructor(url: string | WebSocketLike | WebSocketCreator, network?: Networkish, options?: JsonRpcApiProviderOptions);
|
34 | _write(message: string): Promise<void>;
|
35 | destroy(): Promise<void>;
|
36 | }
|
37 | //# sourceMappingURL=provider-websocket.d.ts.map |
\ | No newline at end of file |