Fantom Smart Contract Events API
Fantom GraphQL queries are served at https://graphql.bitquery.io. Pass network: fantom to the ethereum field.
smartContractEvents type allows you to retrieve all events emitted by different smart contracts on Fantom Blockchain.
Here's an example query that retrieves 10 latest events from the WFTM (Wrapped Fantom) smart contract on the Fantom blockchain:
query {
ethereum(network: fantom) {
smartContractEvents(
smartContractAddress: {is: "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83"}
options: {desc: "block.timestamp.iso8601", limit: 10}
date: {after: "2026-11-20T00:00:00Z"}
) {
block {
timestamp {
iso8601
}
}
smartContractEvent {
name
signature
signatureHash
}
transaction {
hash
}
}
}
}
Filtering Transactions
Smart Contract Events can be filtered using following arguments:
-
any: -
date: Filter by date on which smart contract event happened. Date should be in ISO8601-encoded datetime string. Ex, June 17th, 2023 will be2023-07-17T00:00:00Z. Available comparison operators areafter,before,between,in,is,not,notIn,since,till. -
height: Filter by height of block where smart contract event happened. Available comparison operators arebetween,gt,gteq,in,is,lt,lteq,not,notIn. -
options: Filter returned data by ordering, limiting and constrainting smart contract events data. Available fields:asc,ascByInteger,desc,descByInteger,limit,limitBy,offset -
smartContractAddress: Filter by address of the smart contract. Available comaprision operators arein,is,not,notIn. -
smartContractType: Filter by type of the smart contract on which event happened. Avaiable comparison operators arein,is,not,notIn. -
time: Filter by time when smart contract event happened. Time should be in ISO8601-encoded datetime string. Ex, June 17th, 2023 will be2023-07-17T00:00:00Z. Available comparison operator areafter,before,between,in,is,not,notIn,since,till. -
txFrom: Filter by the address responsible for creating the transaction that emitted an event. Available comparison operators arein,is,not,notIn. -
txHash: Filter by transaction hash of the transaction which emitted smart contract event. Available comparison operators areis,in,not,notIn.
smartContractEvents field has following subfields which returns relevant information about smart contract events.
any:arguments: eturns details about arguments passed to smart contract events.block: returns block details in which smart contract event happenedcount: returns aggregate count of smart contract eventscountBigInt: returns aggregate count of smart contract events inBigIntformatdate: returns date of smart contract eventexpression: performs arithmetic operation and returns value of the operationmaximum: returns maximum of selected measurable fields ofsmartContractEventsminimum: returns minimum of selected measurable fields ofsmartContractEventssmartContract: returns details of smart contract on which event happenedsmartContractEvent: returns details about smart contract event like name, signature, and signature hashtransaction: returns details about transaction which emitted smart contract event
Related
Ready to run this in production?
Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.