Skip to main content
Version: Firesquid

Gear support

Available since @subsquid/substrate-processor@1.6.0

info

Use lookupArchive("gear-testnet", { release: "FireSquid" }) to connect to an Archive for Gear testnet. An Archive for the Gear mainnet will be added in due course when the network is launched.

Indexing Gear Network programs is supported with the following specialized processor handlers:

SubstrateBatchProcessor.addGearMessageEnqueued(programId: string, options?: BlockRangeOption & MayBeDataSelection<EventDataRequest>)

and

SubstrateBatchProcessor.addGearUserMessageSent(programId: string, options?: BlockRangeOption & MayBeDataSelection<EventDataRequest>)

The methods above subscribe to the events Gear.MessageEnqueued and Gear.UserMessageSent emitted by the specified Gear program. The data selections options are the same as for the addEvent() processor method.

The processor can as well subscribe to any other event with addEvent() and filter by the program ID in the handler, if so necessary.

An example of a squid indexing a Gear program (an NFT contract) can be found in this repo