Consensys / ethql

A GraphQL interface to Ethereum :fire:
Apache License 2.0
622 stars 85 forks source link

How to query ERC20 transfers emitted from a specific contract? #130

Open zulhfreelancer opened 4 years ago

zulhfreelancer commented 4 years ago

Hi,

I'm new to this. I have this query:

{
  blocksRange(numberRange:[8649100,8649107]) {
    transactions(filter: {withInput: true}) {
      decoded {
        ... on ERC20Transfer {
          tokenContract {
            symbol
          }
        }
      }
    }
  }
}

I have two questions:

  1. Does it possible to query all ERC20 transfers emitted from a specific contract i.e. USDC contract? The above query is somehow returns all transfers between two blocks and I don't want that. I'm just interested in USDC transfers.

  2. Is there a way to put big range for the blocksRange? From my testing, looks like it can only support up to 10 blocks. Can I query all ERC20 transfers emitted from a specific contract from the beginning (since after the contract get deployed) until the latest block?

Thanks.