Interface IJsonRpcClient<ChainApi, Events>

A generic interface for JSON-RPC clients

interface IJsonRpcClient<ChainApi, Events> {
    options: JsonRpcClientOptions;
    provider: JsonRpcProvider;
    rpc: ChainApi["rpc"];
    status: ConnectionStatus;
    connect(): Promise<IJsonRpcClient<ChainApi, Events>>;
    disconnect(): Promise<void>;
    off(event: Events, handler?: HandlerFn): this;
    on(event: Events, handler: HandlerFn): Unsub;
    once(event: Events, handler: HandlerFn): Unsub;
}

Type Parameters

Hierarchy (view full)

Implemented by

Properties

provider: JsonRpcProvider
rpc: ChainApi["rpc"]

Methods

  • Parameters

    • event: Events
    • Optionalhandler: HandlerFn

    Returns this

  • Parameters

    • event: Events
    • handler: HandlerFn

    Returns Unsub

  • Parameters

    • event: Events
    • handler: HandlerFn

    Returns Unsub