Default provider that uses the Fetch API to call a single node.

Hierarchy

  • FetchProvider

Implements

Constructors

Properties

Methods

Constructors

Properties

fetch: Fetch
url: string

Methods

  • Call an API endpoint and return the response. Provider is responsible for JSON encoding the params and decoding the response.

    Argument

    path The endpoint path, e.g. /v1/chain/get_info

    Argument

    params The request body if any.

    Parameters

    • path: string
    • Optional params: unknown

    Returns Promise<{
        headers: {};
        json: any;
        status: any;
        text: any;
    }>