HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

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.

  • 8 types
  • 14 values

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
datadata TransactionWithMeta
#

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

Constructors

Instances4Show, Generic, FromJSON, Rep

getBlockCommitment

datadata BlockCommitment
#

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.

datadata BlockProductionRange
#

Range of slots considered for block production.

Constructors

Instances4Show, Generic, FromJSON, Rep
datadata BlockProduction
#

Block production statistics mapped by validator identity.

Instances4Show, Generic, FromJSON, Rep

getBlocks

1 declaration
valuegetBlocks :: JsonRpc m => Slot -> Maybe Slot -> m [Slot]
#

Returns a list of confirmed blocks between two slots (inclusive). The maximum range allowed is 500,000 slots.

getBlocksWithLimit

1 declaration

getBlockTime

1 declaration
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

4 declarations
datadata LatestBlockHash
#

Contains the hash and the height of the latest block.

Constructors

Instances4Show, Generic, FromJSON, Rep

isBlockhashValid

2 declarations