diff --git a/.snippets/code/tutorials/subsquid/main-with-logging.ts b/.snippets/code/tutorials/subsquid/main-with-logging.ts index 8977c750..23c65876 100644 --- a/.snippets/code/tutorials/subsquid/main-with-logging.ts +++ b/.snippets/code/tutorials/subsquid/main-with-logging.ts @@ -3,7 +3,7 @@ import {assertNotNull} from '@subsquid/evm-processor' import {TypeormDatabase} from '@subsquid/typeorm-store' import * as erc20 from './abi/erc20' import {Account, Transfer} from './model' -import {Block, CONTRACT_ADDRESS, Log, Transaction, ProcessorContext, processor} from './processor' +import {Block, CONTRACT_ADDRESS, Log, Transaction, processor} from './processor' processor.run(new TypeormDatabase({supportHotBlocks: true}), async (ctx) => { ctx.log.info('Processor started'); diff --git a/.snippets/code/tutorials/subsquid/main.ts b/.snippets/code/tutorials/subsquid/main.ts index 4179953d..b7fa1554 100644 --- a/.snippets/code/tutorials/subsquid/main.ts +++ b/.snippets/code/tutorials/subsquid/main.ts @@ -3,7 +3,7 @@ import {assertNotNull} from '@subsquid/evm-processor' import {TypeormDatabase} from '@subsquid/typeorm-store' import * as erc20 from './abi/erc20' import {Account, Transfer} from './model' -import {Block, CONTRACT_ADDRESS, Log, Transaction, ProcessorContext, processor} from './processor' +import {Block, CONTRACT_ADDRESS, Log, Transaction, processor} from './processor' processor.run(new TypeormDatabase({supportHotBlocks: true}), async (ctx) => { let transfers: TransferEvent[] = [] diff --git a/.snippets/code/tutorials/subsquid/processor.ts b/.snippets/code/tutorials/subsquid/processor.ts index 0ba4fb5c..b37512ff 100644 --- a/.snippets/code/tutorials/subsquid/processor.ts +++ b/.snippets/code/tutorials/subsquid/processor.ts @@ -1,5 +1,4 @@ import {assertNotNull} from '@subsquid/util-internal' -import {lookupArchive} from '@subsquid/archive-registry' import { BlockHeader, DataHandlerContext, @@ -12,7 +11,7 @@ import {Store} from '@subsquid/typeorm-store' import * as erc20 from './abi/erc20' // Here you'll need to import the contract -export const CONTRACT_ADDRESS = 'INSERT_CONTRACT_ADDRESS'.toLowerCase(); +export const contractAddress = 'INSERT_CONTRACT_ADDRESS'.toLowerCase(); export const processor = new EvmBatchProcessor() .setDataSource({ @@ -32,7 +31,7 @@ export const processor = new EvmBatchProcessor() }, }) .addLog({ - address: [CONTRACT_ADDRESS], + address: [contractAddress], topic0: [erc20.events.Transfer.topic], transaction: true, }) @@ -43,5 +42,4 @@ export const processor = new EvmBatchProcessor() export type Fields = EvmBatchProcessorFields export type Block = BlockHeader export type Log = _Log -export type Transaction = _Transaction -export type ProcessorContext = DataHandlerContext \ No newline at end of file +export type Transaction = _Transaction \ No newline at end of file diff --git a/builders/tutorials/subsquid.md b/builders/tutorials/subsquid.md index b4b98c07..50881f2f 100644 --- a/builders/tutorials/subsquid.md +++ b/builders/tutorials/subsquid.md @@ -208,7 +208,7 @@ As mentioned, we'll first need to define the database schema for the transfer da ``` -Now we can generate the entity classes from the schema, which we'll use when we process the transfer data: +Now we can generate the entity classes from the schema, which we'll use when we process the transfer data. This will create new classes for each entity in the `src/model/generated` directory. ```bash sqd codegen