Skip to content

Commit

Permalink
remove : from types
Browse files Browse the repository at this point in the history
  • Loading branch information
fracek committed Jan 6, 2025
1 parent bb17963 commit 7ea7bb2
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions docs/v2/getting-started/indexers/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,27 @@ export default defineIndexer(StarknetStream)({ /* ... */ });

All indexers take the same configuration options.

- **`streamUrl`**<span class="text-muted-foreground">: `string`</span><br/>The URL of the DNA stream to connect to.
- **`filter`**<span class="text-muted-foreground">: `TFilter`</span><br/>The filter to apply to the DNA stream. This argument is specific to the stream definition. You should refer to the chain's filter reference for the available options (see [Beacon Chain](/docs/v2/networks/beaconchain/filter), [EVM (Ethereum)](/docs/v2/networks/evm/filter), [Starknet](/docs/v2/networks/starknet/filter)).
- **`finality`**<span class="text-muted-foreground">: `"finalized" | "accepted" | "pending"`</span><br/>Receive data with the specified finality. Defaults to `accepted`.
- **`startingCursor`**<span class="text-muted-foreground">: `{ orderKey: bigint, uniqueKey?: string }`</span><br/>The cursor to start the indexer from. Defaults to the genesis block. The `orderKey` represents the block number, and the `uniqueKey` represents the block hash (optional).
- **`debug`**<span class="text-muted-foreground">: `boolean`</span><br/>Enable debug mode. This will print debug information to the console.
- **`transform`**<span class="text-muted-foreground">: `({ block, cursor, endCursor, finality, context }) => Promise<void>`</span><br/>The transform function called for each block received from the DNA stream.
- **`factory`**<span class="text-muted-foreground">: `({ block, context }) => Promise<{ filter?: TFilter }>`</span><br/>The factory function used to add data filters at runtime. Useful for creating indexers for smart contracts like Uniswap V2.
- **`hooks`**<span class="text-muted-foreground">: `object`</span><br/>The hooks to register with the indexer. Refer to the [plugins & hooks](/docs/v2/getting-started/plugins) page for more information.
- **`plugins`**<span class="text-muted-foreground">: `array`</span><br/>The plugins to register with the indexer. Refer to the [plugins & hooks](/docs/v2/getting-started/plugins) page for more information.
- **`streamUrl`**<span class="text-muted-foreground">`string`</span><br/>The URL of the DNA stream to connect to.
- **`filter`**<span class="text-muted-foreground">`TFilter`</span><br/>The filter to apply to the DNA stream. This argument is specific to the stream definition. You should refer to the chain's filter reference for the available options (see [Beacon Chain](/docs/v2/networks/beaconchain/filter), [EVM (Ethereum)](/docs/v2/networks/evm/filter), [Starknet](/docs/v2/networks/starknet/filter)).
- **`finality`**<span class="text-muted-foreground">`"finalized" | "accepted" | "pending"`</span><br/>Receive data with the specified finality. Defaults to `accepted`.
- **`startingCursor`**<span class="text-muted-foreground">`{ orderKey: bigint, uniqueKey?: string }`</span><br/>The cursor to start the indexer from. Defaults to the genesis block. The `orderKey` represents the block number, and the `uniqueKey` represents the block hash (optional).
- **`debug`**<span class="text-muted-foreground">`boolean`</span><br/>Enable debug mode. This will print debug information to the console.
- **`transform`**<span class="text-muted-foreground">`({ block, cursor, endCursor, finality, context }) => Promise<void>`</span><br/>The transform function called for each block received from the DNA stream.
- **`factory`**<span class="text-muted-foreground">`({ block, context }) => Promise<{ filter?: TFilter }>`</span><br/>The factory function used to add data filters at runtime. Useful for creating indexers for smart contracts like Uniswap V2.
- **`hooks`**<span class="text-muted-foreground">`object`</span><br/>The hooks to register with the indexer. Refer to the [plugins & hooks](/docs/v2/getting-started/plugins) page for more information.
- **`plugins`**<span class="text-muted-foreground">`array`</span><br/>The plugins to register with the indexer. Refer to the [plugins & hooks](/docs/v2/getting-started/plugins) page for more information.

### The transform function

The `transform` function is invoked for each block received from the DNA stream. This function is where you should implement your business logic.

**Arguments**

- **`block`**<span class="text-muted-foreground">: `TBlock`</span><br/>The block received from the DNA stream. This is chain-specific (see [Beacon Chain](/docs/v2/networks/beaconchain/data), [EVM (Ethereum)](/docs/v2/networks/evm/data), [Starknet](/docs/v2/networks/starknet/data)).
- **`cursor`**<span class="text-muted-foreground">: `{ orderKey: bigint, uniqueKey?: string }`</span><br/>The cursor of the block before the received block.
- **`endCursor`**<span class="text-muted-foreground">: `{ orderKey: bigint, uniqueKey?: string }`</span><br/>The cursor of the current block.
- **`finality`**<span class="text-muted-foreground">: `"finalized" | "accepted" | "pending"`</span><br/>The finality of the block.
- **`context`**<span class="text-muted-foreground">: `object`</span><br/>The context shared between the indexer and the plugins.
- **`block`**<span class="text-muted-foreground">`TBlock`</span><br/>The block received from the DNA stream. This is chain-specific (see [Beacon Chain](/docs/v2/networks/beaconchain/data), [EVM (Ethereum)](/docs/v2/networks/evm/data), [Starknet](/docs/v2/networks/starknet/data)).
- **`cursor`**<span class="text-muted-foreground">`{ orderKey: bigint, uniqueKey?: string }`</span><br/>The cursor of the block before the received block.
- **`endCursor`**<span class="text-muted-foreground">`{ orderKey: bigint, uniqueKey?: string }`</span><br/>The cursor of the current block.
- **`finality`**<span class="text-muted-foreground">`"finalized" | "accepted" | "pending"`</span><br/>The finality of the block.
- **`context`**<span class="text-muted-foreground">`object`</span><br/>The context shared between the indexer and the plugins.

The following example shows a minimal indexer that streams block headers and prints them to the console.

Expand Down

0 comments on commit 7ea7bb2

Please sign in to comment.