Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebsocketClient

Hierarchy

  • WebsocketClient

Implements

Index

Constructors

constructor

  • new WebsocketClient(baseUrl?: string, onError?: function): WebsocketClient
  • Parameters

    • Default value baseUrl: string = "ws://localhost:46657"
    • Default value onError: function = defaultErrorHandler
        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns WebsocketClient

Methods

connected

  • connected(): Promise<void>
  • Resolves as soon as websocket is connected. execute() queues requests automatically, so this should be required for testing purposes only.

    Returns Promise<void>

disconnect

  • disconnect(): void

execute

  • execute(request: JsonRpcRequest): Promise<JsonRpcSuccessResponse>

listen

Protected responseForRequestId

  • responseForRequestId(id: JsonRpcId): Promise<JsonRpcResponse>

Generated using TypeDoc