Table of Contents

starknet.events index

This index allows processing events emitted by Starknet smart contracts. You can define a handler for each contract/name pair. Only necessary events are processed.

Below is a basic indexer for USDt token contract transfers.

To create a project based on this template, run dipdup new -t demo_starknet_events.

dipdup.yaml
spec_version: 3.0
package: demo_starknet_events

datasources:
  subsquid:
    kind: starknet.subsquid
    url: ${SUBSQUID_URL:-https://v2.archive.subsquid.io/network/starknet-mainnet}
  node:
    kind: starknet.node
    url: ${NODE_URL:-https://starknet-mainnet.g.alchemy.com/v2}/${NODE_API_KEY:-''}

contracts:
  stark_usdt:
    kind: starknet
    address: '0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8'
    typename: stark_usdt

indexes:
  starknet_usdt_events:
    kind: starknet.events
    datasources:
      - subsquid
      - node
    handlers:
      - callback: on_transfer
        contract: stark_usdt
        name: Transfer

Datasources

DipDup indexes for Starknet use Subsquid Network as a main source of historical data. Starknet nodes are not required for DipDup to operate, but in future updates, it will be possible to use them to get the latest data (not yet in Subsquid Network) and realtime updates. See starknet.subsquid page for more info on how to configure the datasource.

Help and tips -> Join our Discord
Ideas or suggestions -> Issue Tracker
GraphQL IDE -> Open Playground
Table of Contents