Skip to content

Instantly share code, notes, and snippets.

@Yuripetusko
Last active November 19, 2024 16:18
Show Gist options
  • Select an option

  • Save Yuripetusko/f40aaca340179d9fd9d4e3dcde35d931 to your computer and use it in GitHub Desktop.

Select an option

Save Yuripetusko/f40aaca340179d9fd9d4e3dcde35d931 to your computer and use it in GitHub Desktop.
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