Example code for the getBlock json-rpc method. Сomplete guide on how to use getBlock json-rpc in GetBlock.io Web3 documentation.
Parameters
u64 - u64
slot, as u64 integer
Config - object
Optional.
Configuration object containing the following optional fields: - encoding: string - encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when the data field is type string. - transaction.message.instructions: list If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts, data, and programIdIndex fields). - transactionDetails: string (optional) - level of transaction detail to return, either "full", "signatures", or "none". If parameter not provided, the default detail level is "full". - rewards: bool (optional) - whether to populate the rewards array. If parameter not provided, the default includes rewards. - Commitment (optional) - "processed" is not supported. If parameter not provided, the default is "finalized".