first and last activity

Returns one transaction on Ethereum, where tx sender is 0x1ba5…a1b8 and tx to is 0x1ba5…a1b8, sorted by block timestamp iso8601: hash, block height and iso8601.

By Pankaj · saved 13 January 2022 · run 1 time · Bitquery API v1

What it returns

Filters

The query

query ($address: String!, $network: EthereumNetwork!) {
  summary: ethereum(network: $network) {
    lastSent: transactions(
      txSender: {is: $address}
      options: {limit: 1, desc: "block.timestamp.iso8601"}
    ) {
      hash
      block {
        height
        timestamp {
          iso8601
        }
      }
    }
    lastReceived: transactions(
      txTo: {is: $address}
      options: {limit: 1, desc: "block.timestamp.iso8601"}
    ) {
      hash
      block {
        height
        timestamp {
          iso8601
        }
      }
    }
    firstSent: transactions(
      txSender: {is: $address}
      options: {limit: 1, asc: "block.timestamp.iso8601"}
    ) {
      hash
      block {
        height
        timestamp {
          iso8601
        }
      }
    }
    firstReceived: transactions(
      txTo: {is: $address}
      options: {limit: 1, offset: 0, asc: "block.timestamp.iso8601"}
    ) {
      hash
      block {
        height
        timestamp {
          iso8601
        }
      }
    }
  }
}

Variables

{
  "address": "0x1ba5674e4EeEdC0267Af71FE00C65F0414dda1b8",
  "network": "ethereum"
}

Similar queries