> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metalntwx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a block by number

> Returns the block for the given selector, or `null` if unknown. The standard Ethereum fields are extended with `timestampMillisPart`, `proposer`, `interopMessageRoot`, `ethereumUpdate`, `validatorSetRoot`, `nextValidatorSetRoot`, and optional `subblockMetadataRoot`. Full timestamp in milliseconds = `timestamp * 1000 + timestampMillisPart`.



## OpenAPI

````yaml /reference/json-rpc/json-rpc.json post /eth_getBlockByNumber
openapi: 3.1.0
info:
  title: Metal JSON-RPC
  version: 1.0.0
  description: Interactive playground for Metal's public JSON-RPC endpoints.
servers:
  - url: https://rpc-testnet.metalntwx.com/v1/{endpointId}
    variables:
      endpointId:
        default: YOUR_ENDPOINT_ID
        description: >-
          Your endpoint ID from the Metal console. It is a credential, so keep
          it private. Paste it once, and the playground remembers it in this
          browser.
    description: Testnet
  - url: https://rpc-devnet.metalntwx.com
    description: Devnet
security: []
tags:
  - name: Chain
    description: Identify the chain and its head.
  - name: Consensus
    description: Simplex finality, node build, and gas-token metadata.
  - name: Blocks
    description: Read blocks with Metal's millisecond timestamps and proposer.
  - name: State
    description: Read accounts, contracts, and storage.
  - name: Gas
    description: Quote gas in MIP20 gas-token base units.
  - name: Transactions
    description: Submit and inspect transactions.
  - name: Logs
    description: Query event logs.
  - name: MIP20
    description: Gas-token pricing detail standard Ethereum responses cannot represent.
paths:
  /eth_getBlockByNumber:
    post:
      tags:
        - Blocks
      summary: Get a block by number
      description: >-
        Returns the block for the given selector, or `null` if unknown. The
        standard Ethereum fields are extended with `timestampMillisPart`,
        `proposer`, `interopMessageRoot`, `ethereumUpdate`, `validatorSetRoot`,
        `nextValidatorSetRoot`, and optional `subblockMetadataRoot`. Full
        timestamp in milliseconds = `timestamp * 1000 + timestampMillisPart`.
      operationId: eth_getBlockByNumber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC protocol version. Always `2.0`.
                id:
                  type: integer
                  default: 1
                  description: Request identifier echoed back in the response.
                method:
                  type: string
                  enum:
                    - eth_getBlockByNumber
                  default: eth_getBlockByNumber
                  description: JSON-RPC method name.
                params:
                  type: array
                  prefixItems:
                    - type: string
                      default: latest
                      description: >-
                        Block selector: `"latest"`, `"pending"`, `"safe"`,
                        `"finalized"`, `"earliest"`, or a hex block number such
                        as `"0x1cf741"`.
                    - type: boolean
                      default: false
                      description: >-
                        `true` to embed full transaction objects, `false` for
                        hashes only.
                  items: false
                  minItems: 2
                  maxItems: 2
                  default:
                    - latest
                    - false
                  description: '`[blockSelector, fullTransactions]`.'
                  x-default:
                    - latest
                    - false
            example:
              jsonrpc: '2.0'
              id: 1
              method: eth_getBlockByNumber
              params:
                - latest
                - false
      responses:
        '200':
          description: >-
            JSON-RPC 2.0 response. Errors are reported in-band via an `error`
            object with `code` and `message` in place of `result`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: integer
                  result:
                    type:
                      - object
                      - 'null'
                    description: >-
                      Standard Ethereum block plus the Metal header fields
                      described below, or `null`.
                    properties:
                      hash:
                        type:
                          - string
                          - 'null'
                        pattern: ^0x[0-9a-fA-F]*$
                        description: >-
                          Hash of the complete Metal header; null for a pending
                          block.
                      parentHash:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: Hash of the parent Metal block.
                      sha3Uncles:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: Hash of the empty ommers list; Metal has no ommers.
                      miner:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: >-
                          20-byte EVM fee recipient; distinct from the BLS
                          proposer.
                      stateRoot:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: 32-byte root of the resulting EVM state.
                      transactionsRoot:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: 32-byte root of the block transactions.
                      receiptsRoot:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: 32-byte root of the transaction receipts.
                      logsBloom:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: 256-byte bloom filter for logs in this block.
                      extraData:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: Execution-header extra data.
                      mixHash:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: Execution-header mix hash.
                      nonce:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: 8-byte execution-header nonce.
                      withdrawalsRoot:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: >-
                          Withdrawals root when present in the active
                          execution-header revision.
                      parentBeaconBlockRoot:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: >-
                          Execution-header beacon-root field; Metal does not use
                          Ethereum Beacon consensus for its own finality.
                      requestsHash:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        description: >-
                          Execution requests hash when present in the active
                          execution-header revision.
                      number:
                        type:
                          - string
                          - 'null'
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: Block height; null for a pending block.
                      difficulty:
                        type: string
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: Execution-header difficulty; zero on Metal.
                      gasLimit:
                        type: string
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: Maximum execution gas for this block.
                      gasUsed:
                        type: string
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: Execution gas consumed by included transactions.
                      timestamp:
                        type: string
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: >-
                          Unix time in whole seconds. Combine with
                          timestampMillisPart for milliseconds.
                      size:
                        type: string
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: RLP-encoded block size in bytes.
                      baseFeePerGas:
                        type: string
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: Execution base fee; zero on Metal.
                      blobGasUsed:
                        type: string
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: Blob gas consumed by this block.
                      excessBlobGas:
                        type: string
                        pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                        description: Execution-header excess blob gas.
                      transactions:
                        type: array
                        description: >-
                          Transaction hashes when fullTransactions is false;
                          complete transaction objects when true.
                        items:
                          oneOf:
                            - type: string
                              pattern: ^0x[0-9a-fA-F]*$
                              description: 32-byte transaction hash.
                            - type: object
                              description: Transaction object, or `null` if unknown.
                      uncles:
                        type: array
                        maxItems: 0
                        items:
                          type: string
                          pattern: ^0x[0-9a-fA-F]*$
                          description: Ommer hash.
                        description: Empty; Metal has no ommers.
                      withdrawals:
                        type: array
                        description: Execution-header withdrawals when present.
                        items:
                          type: object
                          properties:
                            index:
                              type: string
                              pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                              description: Withdrawal index.
                            validatorIndex:
                              type: string
                              pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                              description: Validator index.
                            address:
                              type: string
                              pattern: ^0x[0-9a-fA-F]*$
                              description: Recipient address.
                            amount:
                              type: string
                              pattern: ^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$
                              description: Withdrawal amount.
                      timestampMillisPart:
                        type: string
                        description: >-
                          Hex quantity from `0x0` to `0x3e7`. Full timestamp in
                          milliseconds is `timestamp * 1000 +
                          timestampMillisPart`.
                      proposer:
                        type: string
                        description: >-
                          48-byte compressed BLS public key of the proposing
                          validator, as 0x-prefixed hex. All zeros at genesis;
                          distinct from the EVM fee recipient.
                      interopMessageRoot:
                        type: string
                        description: >-
                          32-byte cumulative interop outbox commitment as
                          0x-prefixed hex; zero before any message has been
                          sent.
                      ethereumUpdate:
                        type: string
                        description: >-
                          0x-prefixed bytes containing an Ethereum consensus
                          operation kind byte followed by its raw SSZ witness;
                          `0x` when absent.
                      validatorSetRoot:
                        type: string
                        description: >-
                          32-byte root of the validator set for this block's
                          epoch, as 0x-prefixed hex. Zero at genesis.
                      nextValidatorSetRoot:
                        type: string
                        description: >-
                          32-byte root of the next epoch's validator set, as
                          0x-prefixed hex. Equals `validatorSetRoot` while the
                          set is unchanged; zero at genesis.
                      subblockMetadataRoot:
                        type: string
                        description: >-
                          Optional 32-byte root of ordered subblock metadata, as
                          0x-prefixed hex. Omitted when absent.
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  hash: >-
                    0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722
                  number: '0x1cf6b4'
                  timestamp: '0x6a87ac45'
                  timestampMillisPart: '0x9f'
                  proposer: >-
                    0x8f59f57db707e439c261f878e88170c6848d8a3493b272c21308d879068e67da19efde55f5bf4c2eb61439232e3cae76
                  interopMessageRoot: >-
                    0x0000000000000000000000000000000000000000000000000000000000000000
                  ethereumUpdate: 0x
                  validatorSetRoot: >-
                    0x1111111111111111111111111111111111111111111111111111111111111111
                  nextValidatorSetRoot: >-
                    0x1111111111111111111111111111111111111111111111111111111111111111
                  gasUsed: '0x0'
                  gasLimit: '0x1dcd6500'
                  transactions: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.