Last active
November 19, 2024 16:18
-
-
Save Yuripetusko/f40aaca340179d9fd9d4e3dcde35d931 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| EvmBatchProcessor, | |
| type EvmBatchProcessorFields, | |
| type Transaction as _Transaction, | |
| } from '@subsquid/evm-processor'; | |
| export const processor = new EvmBatchProcessor() | |
| // .setGateway(archive[config.NETWORK]) | |
| .setRpcEndpoint({ | |
| capacity: 2, | |
| // set RPC endpoint in .env | |
| url: config.RPC_URL, | |
| rateLimit: config.RPC_RATE_LIMIT, | |
| maxBatchCallSize: config.RPC_MAX_BATCH_SIZE, | |
| }) | |
| .setFinalityConfirmation(75) // 15 mins to finality | |
| .addTransaction({ | |
| type: [4], | |
| // related data retrieval | |
| logs: true, | |
| stateDiffs: false, | |
| traces: false, | |
| }) | |
| .setBlockRange({ | |
| from: config.BLOCK_RANGE_FROM, | |
| }) | |
| .setFields({ | |
| transaction: { | |
| // transactionHash: true, | |
| to: true, | |
| authorizationList: true, | |
| from: true, | |
| value: true, | |
| hash: true, | |
| type: true, | |
| input: true, | |
| chainId: true, | |
| sighash: true, | |
| yParity: true, | |
| }, | |
| }); | |
| export type Fields = EvmBatchProcessorFields<typeof processor>; | |
| export type Transaction = _Transaction<Fields>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment