Sort by Multiple fields

The query shows how to sort result by two fields

Returns 10 blocks on Ethereum, where date since 2023-03-24 and date till 2023-03-31, sorted by transaction count height, highest first: timestamp time, height, transaction count, miner address and reward.

By Omkar Acharekar · saved 31 March 2023 · run 4 times · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {
  ethereum(network: $network) {
    blocks(
      options: {desc: ["transactionCount", "height"], limit: $limit, offset: $offset}
      date: {since: $from, till: $till}
    ) {
      timestamp {
        time(format: "%Y-%m-%d %H:%M:%S")
      }
      height
      transactionCount
      address: miner {
        address
      }
      reward
    }
  }
}

Variables

{
  "limit": 10,
  "offset": 0,
  "network": "ethereum",
  "from": "2023-03-24",
  "till": "2023-03-31T23:59:59",
  "dateFormat": "%Y-%m-%d"
}

Similar queries