getBlock takes a number or a tag:
const latest = await client.getBlock() console.log(latest.number, latest.transactions.length)
By default you get transaction hashes only. Pass includeTransactions: true and you get the full objects instead — more data over the wire, so ask for it only when you need it.
const full = await client.getBlock({
blockNumber: latest.number - 4n,
includeTransactions: true,
})Remember 4n: latest.number is a bigint and mixing it with a plain number throws.
// This chain is short enough to walk end to end.