RPC

Constructors

  • Parameters

    • options: Options
    • OptionalfetchOptions: RequestOptions

    Returns RPC

Properties

api: URL
fetch: {
    (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
    (input: string | URL | Request, init?: RequestInit): Promise<Response>;
}

Type declaration

    • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

    • (input: string | URL | Request, init?: RequestInit): Promise<Response>
    • Parameters

      • input: string | URL | Request
      • Optionalinit: RequestInit

      Returns Promise<Response>

fetchOptions: RequestOptions
headers: { Authorization?: string; "Content-Type": string }
network: Network

Methods

  • Generic method to call any method on the lotus rpc api.

    Type Parameters

    • R

    Parameters

    • rpcOptions: RpcOptions
    • OptionalfetchOptions: RequestOptions

    Returns Promise<MaybeResult<R, RequestErrors | JsonRpcError>>

  • Get the ID address for an address with different safety guarantees

    Parameters

    • params: { address: string; safety?: Safety }
    • OptionalfetchOptions: RequestOptions

    Returns Promise<MaybeResult<string, RequestErrors | JsonRpcError | RpcError>>

  • Looks back from latest height for a tipset

    Parameters

    • lookback: number

      Chain epoch to look back to

    • OptionalfetchOptions: RequestOptions

    Returns Promise<MaybeResult<TipSet, RequestErrors | JsonRpcError | RpcError>>

  • NetworkName returns the name of the network the node is synced to.

    Parameters

    • OptionalfetchOptions: RequestOptions

    Returns Promise<MaybeResult<Network, RequestErrors | JsonRpcError>>