How to get data from a specif token v2?

I’m trying to get the most recent transactions of a token, with these data: “transaction hash”, “from”, “to”, “value”, and the “date” of each transaction.

But I don’t know in what field I should put the parameter “$address” (token contract address) to search the transactions of the specific token using API v2.

This is what my query looks like:

const GET_TRANSACTIONS = gql`
    query GetTransactions($address: String!) {
        EVM(network: eth, dataset: realtime) {
            Transactions(limit: { count: 5 }) {
                Transaction {
                    Hash
                    From
                    To
                    Value(maximum: Block_Nonce)
                }
                Block {
                    Date
                }
            }
        }
    }
`;

We have currency filter at Transfer level, you can use that. For example

query MyQuery {
  EVM(dataset: combined, network: eth) {
    Transfers(
      limit: {count: 10}
      where: {Transfer: {Currency: {SmartContract: {is: "0x8ce578bad214d59aefafb49bd20408e81271796f"}}}}
    ) {
      Block {
        Hash
        Time
        Number
      }
      Transaction {
        From
        To
        Hash
        Value
        Type
      }
      ChainId
      Transfer {
        Amount
        Sender
        Receiver
        Currency {
          Symbol
          SmartContract
          Name
        }
      }
    }
  }
}

1 Like