Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Connection

A connection to a fullnode JSON RPC endpoint

Hierarchy

  • Connection

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private _rpcClient

_rpcClient: RPCClient

url

url: string

Methods

request

  • request(method: string, params: any[]): Promise<any>
  • Sends a request to the server.

    Parameters

    • method: string

      The method to call.

    • params: any[]

      The parameters to pass to the method.

    Returns Promise<any>

    A promise that resolves to the result of the method call.

subscribe

  • Subscribes to a stream of events.

    Type parameters

    • T

    Parameters

    • method: string

      The method to call.

    • params: any[]

      The parameters to pass to the method.

    • subscriber: Subscriber<T>

      The subscriber to send events to.

    Returns Promise<Subscription>

    Subscription object.

Generated using TypeDoc