RPC

Constructors

Properties

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

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

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

      Returns Promise<Response>

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

Methods

  • WalletBalance returns the balance of the given address at the current head of the chain.

    Parameters

    • address: string
    • OptionalfetchOptions: RequestOptions = {}

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: string;
    }>

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

    Type Parameters

    • R

    Parameters

    • rpcOptions: RpcOptions
    • OptionalfetchOptions: RequestOptions = {}

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: R;
    }>

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

    Parameters

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

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: string;
    }>

  • Looks back from latest height for a tipset

    Parameters

    • lookback: number

      Chain epoch to look back to

    • OptionalfetchOptions: RequestOptions = {}

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: TipSet;
    }>

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

    Parameters

    • OptionalfetchOptions: RequestOptions = {}

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: Network;
    }>

  • MpoolGetNonce gets next nonce for the specified sender. Note that this method may not be atomic. Use MpoolPushMessage instead.

    Parameters

    • address: string
    • OptionalfetchOptions: RequestOptions = {}

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: number;
    }>

  • MpoolPush pushes a signed message to mempool.

    Parameters

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: CID;
    }>

  • Version returns the version of the Filecoin node.

    Parameters

    • OptionalfetchOptions: RequestOptions = {}

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: VersionResponse;
    }>

  • StateWaitMsg looks back in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth.

    Timeout is increased to 60s instead of the default 5s.

    Parameters

    Returns Promise<{
        error: {
            code: number;
            message: string;
        };
        result: undefined;
    } | {
        error: undefined;
        result: CID;
    }>