getEventsAtBlockIds
A builder function that returns all instances of a particular event (by name) within a set of blocks, specified by block ids.
The block range provided must be from the current spork.
Event type is a string that follow a standard format: A.{AccountAddress}.{ContractName}.{EventName}
Please read more about events in the documentation.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.getEventsAtBlockIds(eventType, blockIds)
Or import directly the specific function:
_10import { getEventsAtBlockIds } from "@onflow/sdk"_10_10getEventsAtBlockIds(eventType, blockIds)
Usage
_10import * as fcl from "@onflow/fcl";_10_10const events = await fcl.send([_10 fcl.getEventsAtBlockIds("A.7e60df042a9c0868.FlowToken.TokensWithdrawn", [_10 "c4f239d49e96d1e5fbcf1f31027a6e582e8c03fcd9954177b7723fdb03d938c7",_10 "5dbaa85922eb194a3dc463c946cc01c866f2ff2b88f3e59e21c0d8d00113273f"_10 ])_10]).then(fcl.decode);
Parameters
eventType
- Type:
string
- Description: The type of event to get
blockIds
- Type:
string[]
- Description: The ids of the blocks to scan for events
Returns
InteractionBuilderFn
_10export type InteractionBuilderFn = (_10 ix: Interaction_10) => Interaction | Promise<Interaction>