latest_block
Returns the latest block number reported by the RPC provider. Because the chain head moves, persist the result before using it as a reproducible boundary.
Example
Live RPC
{"id":"sample_2oq8vr","title":"Sample"}
API reference
latest_block(CLIENT) #
Reads the provider's latest mined block number through the supplied client.
Inputs
| Name | Type | Use |
|---|---|---|
client | CLIENT Attached live CLIENT for the chain whose head should be read. | required positional |
Returns
| Name | Type |
|---|---|
block_number | BIGINT |
Latest block number. Returns the provider's current chain head as a BIGINT. This is intentionally time-varying; persist the returned number before using it as historical evidence.
Examples
Live RPC
{"id":"sample_hrchxq","title":"Sample"}