Maximum number of cells to store in the cache. Defaults to 512.
Maximum number of transactions to store in the cache. Defaults to 256.
Maximum number of blocks to store in the cache. Defaults to 128.
Time in milliseconds after which a block is considered confirmed. Defaults to DEFAULT_CONFIRMED_BLOCK_TIME (50 blocks * 10s).
Rest
...transactionLike: (TransactionLike | TransactionLike[])[]Record known transactions.
Rest
...transactions: (TransactionLike | TransactionLike[])[]Get a known transaction by hash
Rest
...outPointLikes: (OutPointLike | OutPointLike[])[]Get a known cell by out point Implement this method to enable cells query caching
Record known transaction responses. Implement this method to enable transactions query caching
Rest
...transactions: (ClientTransactionResponseLike | ClientTransactionResponseLike[])[]Get a known transaction response by hash Implement this method to enable transactions query caching
Record known block headers. Implement this method to enable block headers query caching
Rest
...headers: (ClientBlockHeaderLike | ClientBlockHeaderLike[])[]Get a known block header by hash Implement this method to enable block headers query caching
Get a known block header by number Implement this method to enable block headers query caching
Record known blocks. Implement this method to enable blocks query caching
Rest
...blocks: (ClientBlockLike | ClientBlockLike[])[]Get a known block header by hash Implement this method to enable block headers query caching
Get a known block header by number Implement this method to enable block headers query caching
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.
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.