BaseProcessor
Class in @sentio/sdk/eth
Defined in @sentio/sdk/eth
Extended by
GenericProcessorEACAggregatorProxyProcessorERC1155ProcessorERC20ProcessorERC20BytesProcessorERC721ProcessorWETH9Processor
Type Parameters
| Type Parameter |
|---|
TContract extends BaseContract |
TBoundContractView extends BoundContractView<TContract, ContractView<TContract>> |
Constructors
Constructor
new BaseProcessor<TContract extends BaseContract, TBoundContractView extends BoundContractView<TContract, ContractView<TContract>>>(config: BindOptions): BaseProcessor<TContract, TBoundContractView>;Parameters
| Parameter | Type |
|---|---|
config | BindOptions |
Returns
BaseProcessor<TContract, TBoundContractView>
Properties
| Property | Type |
|---|---|
blockHandlers | BlockHandler[] |
config | BindInternalOptions |
eventHandlers | EventsHandler[] |
traceHandlers | TraceHandler[] |
Methods
getChainId()
getChainId(): EthChainId;Returns
EthChainId
onBlockInterval()
onBlockInterval(
handler: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
blockInterval?: number,
backfillBlockInterval?: number,
handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,
preprocessHandler?: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
blockInterval | number | 250 |
backfillBlockInterval | number | 1000 |
handlerOptions? | HandlerOptions<EthFetchConfig, RichBlock> | undefined |
preprocessHandler? | (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
Returns
this
onEvent()
onEvent<T extends TypedEvent<any, any> = TypedEvent<any, any>>(
handler: (event: T, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
handlerOptions?: HandlerOptions<EthFetchConfig, T>,
preprocessHandler?: (event: T, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>
): this;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends TypedEvent<any, any> | TypedEvent<any, any> |
Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (event: T, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
handlerOptions? | HandlerOptions<EthFetchConfig, T> | undefined |
preprocessHandler? | (event: T, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
Returns
this
onInterval()
onInterval(
handler: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
timeInterval:
| HandleInterval
| undefined,
blockInterval:
| HandleInterval
| undefined,
handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,
preprocessHandler?: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>,
handlerName?: string
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
timeInterval | | HandleInterval | undefined | undefined |
blockInterval | | HandleInterval | undefined | undefined |
handlerOptions? | HandlerOptions<EthFetchConfig, RichBlock> | undefined |
preprocessHandler? | (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
handlerName? | string | ... |
Returns
this
onTimeInterval()
onTimeInterval(
handler: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
timeIntervalInMinutes?: number,
backfillTimeIntervalInMinutes?: number,
handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,
preprocessHandler?: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
timeIntervalInMinutes | number | 60 |
backfillTimeIntervalInMinutes | number | 240 |
handlerOptions? | HandlerOptions<EthFetchConfig, RichBlock> | undefined |
preprocessHandler? | (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
Returns
this
onTrace()
onTrace(
handler: (event: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
handlerOptions?: HandlerOptions<EthFetchConfig, TypedCallTrace<any, any>>,
preprocessHandler?: (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (event: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
handlerOptions? | HandlerOptions<EthFetchConfig, TypedCallTrace<any, any>> | undefined |
preprocessHandler? | (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
Returns
this