Skip to contents

Retrieves detailed information about a specific block. The block can be identified either by its hash (string) or height (integer). The verbosity level controls how much detail is returned.

Usage

mc_get_block(conn, hash_or_height, verbose = 1)

Arguments

conn

A connection object created by mc_connect.

hash_or_height

Either a character string (block hash) or an integer (block height).

verbose

Integer. Verbosity level from 0 to 4. Default is 1.

  • 0: returns only the block hash as a string.

  • 1: returns a list with basic block information.

  • 2-4: include additional details (transactions, etc.).

Value

Depends on verbose:

  • If verbose = 0: a character string with the block hash.

  • If verbose >= 1: a list containing block details (height, time, transactions, etc.).

See also

mc_get_block_hash to obtain a block hash from height, mc_list_blocks to list multiple blocks.

Other blockchain information: mc_get_block_hash(), mc_get_blockchain_info(), mc_get_chain_totals(), mc_get_last_block_info(), mc_list_blocks(), mc_list_miners()

Examples

if (FALSE) { # \dontrun{
# Get block by height
block <- mc_get_block(conn, 123456)

# Get block by hash with full transaction details
block <- mc_get_block(conn, "0000...", verbose = 2)
} # }