Class JsonRPCClient

Hierarchy (view full)

Constructors

Properties

connector: Connector
lastStatus: NodeStatus
options: Partial<ClientOptions> = {}
url: string

Methods

  • Retrieves the datastore keys of a contract from get_addresses.

    Parameters

    • contract: string

      The contract address

    • filter: Uint8Array = ...

      Only keys starting with these bytes are returned

    • final: boolean = true

      Whether to read the final or the candidate keys

    Returns Promise<Uint8Array[]>

    The keys starting with filter

    Deprecated

    get_addresses returns at most max_datastore_keys_query keys per address (500 by default), with no way to page, and the filter is applied after that cap: keys can be missing without error. Use JsonRpcPublicProvider.getStorageKeys or getMultipleAddressesDatastoreKeys, which page through get_addresses_datastore_keys with the prefix applied by the node.

  • Parameters

    • key: string | Uint8Array
    • address: string
    • final: boolean = true

    Returns Promise<null | Uint8Array>

  • Returns the execution status of an operation.

    Parameters

    • operationId: string

    Returns Promise<OperationStatus>

    Remarks

    in_pool is not used to compute the status: since MAIN.5.1, nodes keep speculatively executed operations in their pool until their execution is final, so an operation can be both in the pool and executed.