Class BlockhashSubscriber

Hierarchy

  • BlockhashSubscriber

Constructors

Properties

blockhashes: Readonly<{
    blockhash: string;
    lastValidBlockHeight: number;
}>[] = []
commitment: Commitment
connection: Connection
isSubscribed: boolean = false
latestBlockHeight: number
latestBlockHeightContext: Context
updateBlockhashIntervalId: Timeout
updateIntervalMs: number

Methods

  • Returns the latest cached blockhash, based on an offset from the latest obtained

    Returns

    Cached blockhash at the given offset, or undefined

    Parameters

    • offset: number = 0

      Offset to use, defaulting to 0

    • offsetType: "index" | "seconds" = 'index'

      If 'seconds', it will use calculate the actual element offset based on the update interval; otherwise it will return a fixed index

    Returns Readonly<{
        blockhash: string;
        lastValidBlockHeight: number;
    }>

Generated using TypeDoc