import { Network } from '../../node_modules/@btc-vision/bitcoin/build/index.js'; import { AbstractRpcProvider } from './AbstractRpcProvider.js'; import { JsonRpcPayload } from './interfaces/JSONRpc.js'; import { JsonRpcCallResult } from './interfaces/JSONRpcResult.js'; import { ConnectionState } from './websocket/types/ConnectionState.js'; import { SubscriptionType } from './websocket/types/SubscriptionType.js'; import { WebSocketClientConfig } from './websocket/types/WebSocketClientConfig.js'; import { BlockNotification, EpochNotification, EventHandler, MempoolNotification, SubscriptionHandler, WebSocketClientEvent } from './websocket/types/WebSocketProviderTypes.js'; export interface WebSocketRpcProviderConfig { readonly url: string; readonly network: Network; readonly websocketConfig?: Partial>; } export declare class WebSocketRpcProvider extends AbstractRpcProvider { private readonly config; private readonly pendingRequests; private readonly subscriptions; private readonly eventHandlers; private socket; private state; private requestId; private reconnectAttempt; private pingTimeout; private sessionId; private userRequestedDisconnect; private protoRoot; private protoTypes; constructor(providerConfig: WebSocketRpcProviderConfig); getState(): ConnectionState; isReady(): boolean; connect(): Promise; disconnect(): void; on(event: WebSocketClientEvent, handler: EventHandler): void; off(event: WebSocketClientEvent, handler: EventHandler): void; subscribeBlocks(handler: SubscriptionHandler): Promise; subscribeEpochs(handler: SubscriptionHandler): Promise; subscribeMempool(handler: SubscriptionHandler): Promise; unsubscribe(subscriptionType: SubscriptionType): Promise; clearCache(): void; _send(payload: JsonRpcPayload | JsonRpcPayload[]): Promise; protected providerUrl(url: string): string; private sendJsonRpcRequest; private translateJsonRpcParamsToFieldIds; private convertOPNetTypeToString; private convertTransaction; private convertBlockResponse; private translateProtoResponse; private connectWebSocket; private buildWebSocketUrl; private performHandshake; private buildMessageByFieldId; private getFieldById; private getFieldNameById; private getNestedType; private getType; private nextRequestId; private buildMessage; private sendRequest; private send; private handleMessage; private handleErrorResponse; private handleBlockNotification; private handleEpochNotification; private handleMempoolNotification; private handleClose; private reconnect; private resubscribe; private cleanupPendingRequests; private schedulePing; private cancelPing; private ping; private emit; private sleep; }