HORIZON HASKELLDocslts/ghc-9.14.x99ffbb82026-10-19Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 99ffbb8 · 2026-10-19

Modulesolana-haskell-sdk-1.3.0.0GHC2021

Network.Solana.RPC.HTTP.Block

This module provides access to block-related JSON-RPC methods in the Solana network. These include fetching full block data, commitment levels, recent block production statistics, block ranges, timestamps, and validity of blockhashes. Useful for exploring historical blocks, validator performance, and transaction confirmation metadata.

Contents
  1. getBlock
  2. getBlockCommitment
  3. getBlockHeight
  4. getBlockProduction
  5. getBlocks
  6. getBlocksWithLimit
  7. getBlockTime
  8. getLatestBlockhash
  9. isBlockhashValid
Synopsis

getBlock

Returns identity and transaction information about a confirmed block in the ledger, using the given configuration.

A slot that holds no block is answered by the node with a JSON-RPC error, not with null: -32007 (slot skipped), -32001 (pruned from the ledger) or -32004 (not yet produced or rooted). The transport raises such errors as a JsonRpcException (CallException) that runWeb3' does not catch, so wrap the call in try to handle them. Nothing is returned only when the node itself answers null, which Agave does solely for a rooted slot missing from its blockstore without being flagged skipped.

valuegetBlock :: JsonRpc m => Slot -> m (Maybe BlockInfo)

Returns identity and transaction information about a confirmed block in the ledger. Sets maxSupportedTransactionVersion so that blocks containing versioned (v0) transactions can be decoded (without it, such blocks make the node respond with error -32015); as a result, v0 transactions are returned without their address-lookup-table data, so instruction account indices may reference addresses not present in the parsed account keys. A slot holding no block is a JSON-RPC error rather than Nothing; see getBlock'.

datadata BlockInfo

Contains identity and transaction information for a block.

Constructors

Instances2Show, FromJSON
  • Show BlockInfoDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.Block
  • FromJSON BlockInfoDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.Block

A transaction and its optional metadata as included in a block.

Constructors

Instances4Show, Generic, FromJSON, Rep

getBlockCommitment

Commitment information for a block.

Constructors

Instances2Show, FromJSON

getBlockHeight

getBlockProduction

typetype ValidatorData = [Word64]

Per-validator production counts: a two-element array of the number of leader slots and the number of blocks produced.

Range of slots considered for block production.

Constructors

Instances4Show, Generic, FromJSON, Rep

Block production statistics mapped by validator identity.

Instances4Show, Generic, FromJSON, Rep

getBlocks

getBlocksWithLimit

getBlockTime

valuegetBlockTime :: JsonRpc m => Slot -> m (Maybe Int)

Returns the estimated production time of a block (as Unix timestamp). This is based on stake-weighted votes and validator-reported timestamps. Returns Nothing if the block exists but carries no timestamp; a slot holding no block is a JSON-RPC error, as for getBlock'.

getLatestBlockhash

Contains the hash and the height of the latest block.

Constructors

Instances4Show, Generic, FromJSON, Rep

isBlockhashValid