Get a list of a specific event’s occurrences emitted from the contract during a specified time period.
Provide the name of the event, and an optional filter to define the time period to get events for.
// Define the shape of the event data
public struct MyEvent
public string from;
public string to;
public string tokenId;
// Get all emitted events
var data = await contract.events.Get<MyEvent>("eventName");
structure (generic type)
The event data structure to deserialize into, i.e. what shape the event data should be in.
The name of the event to get logs for.
In Solidity, an event is triggered by the
// An example Solidity contract
emit Transfer(); // Triggering event
To listen to this event, use the name of the event as it appears in the contract.
var data = await contract.events.Get<MyEvent>("Transfer");
An optional object containing the
toBlock numbers for the time period to get events for.
order field indicates the ordering of the events;
desc (descending) or
filters field allows you to filter on indexed event parameters.
0 and the default
var data = await contract.events.Get<MyEvent>("eventName", new EventQueryOptions()
fromBlock = 0,
toBlock = 1000000,
order = "desc",