DOCS/GRAPHQL/BLOCKS

Blocks

Query block data including headers, transactions, and mining information.

Get Block by Height

query {
  block(
    chainId: "iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq"
    height: 689000
  ) {
    height
    hash
    time
    difficulty
    nonce
    previousBlockHash
    merkleRoot
    txCount
  }
}

Get Block by Hash

query {
  blockByHash(
    chainId: "iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq"
    hash: "000000000012abc..."
  ) {
    height
    hash
    time
    txCount
  }
}

List Recent Blocks

query {
  blocks(
    chainId: "iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq"
    limit: 10
  ) {
    blocks {
      height
      hash
      time
      txCount
    }
    totalCount
    hasMore
  }
}

Block with Transactions

query {
  block(
    chainId: "iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq"
    height: 689000
  ) {
    height
    hash
    transactions {
      txid
      valueIn
      valueOut
      fee
    }
  }
}

Block Type

type Block {
  chainId: String!
  height: BigInt!
  hash: String!
  time: DateTime!
  difficulty: Float!
  nonce: String!
  previousBlockHash: String
  merkleRoot: String!
  txCount: Int!
  size: Int
  version: Int
  transactions: [Transaction!]
}