getEventsAtBlockHeightRange
A builder function that returns all instances of a particular event (by name) within a height range.
The block range provided must be from the current spork.
The block range provided must be 250 blocks or lower per request.
Event type is a string that follow a standard format: A.{AccountAddress}.{ContractName}.{EventName}
Please read more about events in the documentation.
Block height range expresses the height of the start and end block in the chain.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.getEventsAtBlockHeightRange(eventType, startHeight, endHeight)
Or import directly the specific function:
_10import { getEventsAtBlockHeightRange } from "@onflow/sdk"_10_10getEventsAtBlockHeightRange(eventType, startHeight, endHeight)
Usage
_12import * as fcl from "@onflow/fcl";_12_12// Get events at block height range_12await fcl_12 .send([_12 fcl.getEventsAtBlockHeightRange(_12 "A.7e60df042a9c0868.FlowToken.TokensWithdrawn", // event name_12 35580624, // block to start looking for events at_12 35580624 // block to stop looking for events at_12 ),_12 ])_12 .then(fcl.decode);
Parameters
eventType
- Type:
string
- Description: The type of event to get
startHeight
- Type:
number
- Description: The height of the block to start looking for events (inclusive)
endHeight
- Type:
number
- Description: The height of the block to stop looking for events (inclusive)
Returns
InteractionBuilderFn
_10export type InteractionBuilderFn = (_10 ix: Interaction_10) => Interaction | Promise<Interaction>