Class RPC

Sends RPC requests to the RPC node, also has wrappers for actions that only read the network (write actions are handled by the Wallet class)

Hierarchy (view full)

Implements

Constructors

  • Parameters

    • rpc_url: string
    • Optional use_pending: boolean = false

      If true, uses "pending" instead of "receivable" in RPC action names, for compatibility with older versions of the node

    Returns RPC

Properties

DECIMALS: any = undefined
debug: boolean = false
headers: Record<string, string>

HTTP headers to send with any RPC requests, defaults to { "Content-Type": "application/json" }

rpc_url: string
use_pending: boolean

Methods

  • The function that sends the RPC POST request

    Parameters

    • payload: Record<string, any>

    Returns Promise<Record<string, any>>