bitcoin utxo query optimise

Returns the latest inputs and outputs on Bitcoin, where date since 2024-02-23 and date till 2024-02-24: block height, timestamp time, input address address, value, transaction hash and output address address.

By Divyasshree N · saved 26 February 2024 · run 3 times · Bitquery API v1

What it returns

Filters

The query

query getBlockTxs($fromBlock: Int!, $toBlock: Int!, $fromDateTime: ISO8601DateTime!, $toDateTime: ISO8601DateTime!) {
  bitcoin(network: bitcoin) {
    inputs(
      height: {gteq: $fromBlock, lteq: $toBlock}
      options: {desc: "block.timestamp.time"}
      date: {since: $fromDateTime, till: $toDateTime}
    ) {
      block {
        height
        timestamp {
          time
        }
      }
      inputAddress {
        address
      }
      value
      transaction {
        hash
      }
    }
    outputs(
      height: {gteq: $fromBlock, lteq: $toBlock}
      options: {desc: "block.height"}
      date: {since: $fromDateTime, till: $toDateTime}
    ) {
      value
      outputAddress {
        address
      }
      transaction {
        hash
      }
      block {
        height
      }
    }
  }
}

Variables

{
  "fromDateTime": "2024-02-23T12:38:04.656392",
  "toDateTime" : "2024-02-24T22:38:04.656392",
  "fromBlock": 831797,
  "toBlock": 831798
}

Similar queries