• Fetch a confirmed block at a given slot, including transactions and rewards.

    Parameters

    • t: HttpTransport

      HTTP transport instance

    • slot: Slot

      Slot number of the block to retrieve

    • opts: GetBlockOpts = {}

      Encoding, transaction detail level, reward inclusion, and other options

    Returns Promise<BlockResult | null>

    The block result, or null if the block is not available

    const block = await getBlock(transport, 200_000_000);
    if (block) console.log(`Blockhash: ${block.blockhash}`);

    1.0.0