Skip to main content

Fantom Smart Contract Events API

Endpoint

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 be 2023-07-17T00:00:00Z. Available comparison operators are after, before, between, in, is, not, notIn, since, till.

  • height: Filter by height of block where smart contract event happened. Available comparison operators are between, 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 are in, is, not, notIn.

  • smartContractType: Filter by type of the smart contract on which event happened. Avaiable comparison operators are in, 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 be 2023-07-17T00:00:00Z. Available comparison operator are after, 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 are in, is, not, notIn.

  • txHash: Filter by transaction hash of the transaction which emitted smart contract event. Available comparison operators are is, 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 happened
  • count: returns aggregate count of smart contract events
  • countBigInt: returns aggregate count of smart contract events in BigInt format
  • date: returns date of smart contract event
  • expression: performs arithmetic operation and returns value of the operation
  • maximum: returns maximum of selected measurable fields of smartContractEvents
  • minimum: returns minimum of selected measurable fields of smartContractEvents
  • smartContract: returns details of smart contract on which event happened
  • smartContractEvent: returns details about smart contract event like name, signature, and signature hash
  • transaction: returns details about transaction which emitted smart contract event
Build with Bitquery

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.