Class PublicAPI

Hierarchy (view full)

Constructors

Properties

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

Methods

  • Parameters

    • quoteRequests: DeferredCallsQuoteRequest[]

    Returns Promise<DeferredCallsQuoteResponse[]>

  • Parameters

    • slots: Slot[]

    Returns Promise<DeferredCallsSlotResponse[]>

  • Parameters

    • deferredCallsIds: string[]

    Returns Promise<DeferredCallResponse[]>

  • Parameters

    • addressFilters: AddressFilter[]

    Returns Promise<Uint8Array[]>

  • Parameters

    • address: string

    Returns Promise<AddressInfo>

  • Parameters

    • addressFilter: AddressFilter

    Returns Promise<Uint8Array>

  • Parameters

    • address: string
    • final: boolean = true

    Returns Promise<bigint>

  • Parameters

    • blockId: string

    Returns Promise<BlockInfo>

  • Parameters

    • slot: Slot

    Returns Promise<Block>

  • 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

    Returns Promise<(null | Uint8Array)[]>

  • Parameters

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

    Returns Promise<null | Uint8Array>

  • Returns the number of keys to request per datastore keys query.

    Returns Promise<number>

    Remarks

    This is MAX_DATASTORE_KEYS_QUERY, lowered to the node's max_datastore_keys_query when the node reports a smaller limit: asking for more keys than this limit makes the query fail.

  • Parameters

    • endorsementId: string

    Returns Promise<EndorsementInfo>

  • Parameters

    • Optional start: number
    • Optional end: number

    Returns Promise<GraphInterval[]>

  • Parameters

    • addresses: string[]

    Returns Promise<AddressInfo[]>

  • Parameters

    • blockIds: string[]

    Returns Promise<BlockInfo[]>

  • Parameters

    • endorsementIds: string[]

    Returns Promise<EndorsementInfo[]>

  • Parameters

    • slots: Slot[]

    Returns Promise<TransferReceipt[][]>

  • Parameters

    • operationId: string

    Returns Promise<undefined | OperationInfo>

  • 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.

  • Retrieves operations by id.

    Parameters

    • operationIds: string[]

    Returns Promise<OperationInfo[]>

    Remarks

    The node rejects requests with more than max_arguments ids (128 by default), so the ids are sent in batches of DEFAULT_MAX_ARGUMENT_ARRAY_SIZE.

  • Parameters

    • slot: Slot

    Returns Promise<TransferReceipt[]>

  • Parameters

    • pagination: Pagination

    Returns Promise<Staker[]>

  • Parameters

    • data: OperationInput[]

    Returns Promise<string[]>