Skip to contents

Retrieves information about one or more blocks. The blocks parameter can be a single block height/hash, a range (e.g., "100-200"), or -%d to list the most recent blocks.

Usage

mc_list_blocks(conn, blocks, verbose = FALSE)

Arguments

conn

A connection object created by mc_connect.

blocks

Specification of which blocks to list. Can be:

  • a single block height (integer) or hash (string),

  • a range string like "100-200",

  • a negative integer -n to list the n most recent blocks.

verbose

Logical. If TRUE, returns detailed block information. Default is FALSE.

Value

A data frame (converted via rpc_res_to_df) with one row per block.

Examples

if (FALSE) { # \dontrun{
# List the last 5 blocks
last5 <- mc_list_blocks(conn, -5)

# List blocks 100 to 105
range <- mc_list_blocks(conn, "100-105", verbose = TRUE)
} # }