The ClientCache class is mainly designed for chained transactions. Consumed & Created cells are "marked" so they can be correctly handled when composing transactions. It also act as cache for rpc requests to reduce cost, but this is optional.

Hierarchy (view full)

Constructors

  • Parameters

    • maxCells: number = 512

      Maximum number of cells to store in the cache. Defaults to 512.

    • maxTxs: number = 256

      Maximum number of transactions to store in the cache. Defaults to 256.

    • maxBlocks: number = 128

      Maximum number of blocks to store in the cache. Defaults to 128.

    • confirmedBlockTimeLike: NumLike = DEFAULT_CONFIRMED_BLOCK_TIME

      Time in milliseconds after which a block is considered confirmed. Defaults to DEFAULT_CONFIRMED_BLOCK_TIME (50 blocks * 10s).

    Returns ClientCacheMemory

Methods

  • Checks if a block header is considered confirmed. The default implementation compares the header's timestamp against the current time and a configured confirmation time. Override this method for custom confirmation logic.

    Parameters

    Returns boolean