-
Notifications
You must be signed in to change notification settings - Fork 85
Example Use Cases
- Information on a single block
- Information on specific blocks
- Information on a range of blocks
- Information on an account
- Information on a transaction
Fetch all transactions from block 5000000 that have input data, and for those that can be decoded as token transfers, return the token symbol, sending and receiving addresses, as well as the token balance of the sending address. Fiddle with this query.
{
block(number: 5000000) {
hash
transactions(filter: { withInput: true }) {
index
hash
from {
address
}
to {
address
}
decoded {
... on ERC20Transfer {
tokenContract {
symbol
}
from {
account {
address
}
tokenBalance
}
to {
account {
address
}
}
value
}
}
}
}
}
Get the amount of gas expended in each transaction sent from address "0xF5bd64885c1330994Ca1E51c003916F3278A8bE9" in blocks 5942631, 5942640, 5927788, and 5441440. Fiddle with this query.
{
blocks(numbers: [5942631, 5942640, 5927788, 5441440]) {
transactionsRoles(from:"0xF5bd64885c1330994Ca1E51c003916F3278A8bE9") {
gasPrice
}
}
}
For all blocks between 5400000 and 5400005 inclusive (6 blocks), get the balance of all addresses that sent a transaction. Fiddle with this query.
{
blocksRange(numberRange: [5400000, 5400005]) {
transactions {
hash
value
from {
address
balance
}
to {
address
}
}
}
}
Reveal what is stored at Solidity Contract storage at index 0 for account "0x06012c8cf97BEaD5deAe237070F9587f8E7A266d". Fiddle with this query.
{
account(address: "0x06012c8cf97BEaD5deAe237070F9587f8E7A266d"){
storage{
value(at: 0)
}
}
}
Fetch the log topics and attempt to decode the transaction to reveal event, entity, and standard information of transaction hash "0x7cc930cef131502bb78c13012caf0d99117892601b81fb95958aac98191fe6fb". Fiddle with this query.
{
transaction(hash: "0x7cc930cef131502bb78c13012caf0d99117892601b81fb95958aac98191fe6fb") {
logs {
topics
decoded {
event
entity
standard
}
}
}
}
- Top-Level Queries
- Example Use Cases
- Block Query Fields
- Account Query Fields
- Transaction Query Fields
- Log Query Fields
- Decoded Transaction Query Fields
- ENS plugin: resolving names into addresses