GenericProcessor
Class in @sentio/sdk/eth
Defined in @sentio/sdk/eth
Extends
BaseProcessor<BaseContract,BoundContractView<BaseContract,ContractView<BaseContract>>>
Constructors
Constructor
new GenericProcessor(eventABI: string[], options: BindOptions): GenericProcessor;Parameters
| Parameter | Type |
|---|---|
eventABI | string[] |
options | BindOptions |
Returns
GenericProcessor
Overrides
Properties
| Property | Type | Inherited from |
|---|---|---|
blockHandlers | BlockHandler[] | BaseProcessor.blockHandlers |
config | BindInternalOptions | BaseProcessor.config |
eventABI | string[] | - |
eventHandlers | EventsHandler[] | BaseProcessor.eventHandlers |
traceHandlers | TraceHandler[] | BaseProcessor.traceHandlers |
Methods
getChainId()
getChainId(): EthChainId;Returns
EthChainId
Inherited from
onBlockInterval()
onBlockInterval(
handler: (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid,
blockInterval?: number,
backfillBlockInterval?: number,
handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,
preprocessHandler?: (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult>
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid | undefined |
blockInterval | number | 250 |
backfillBlockInterval | number | 1000 |
handlerOptions? | HandlerOptions<EthFetchConfig, RichBlock> | undefined |
preprocessHandler? | (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
Returns
this
Inherited from
onEvent()
onEvent<T extends TypedEvent<any, any> = TypedEvent<any, any>>(
handler: (event: T, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid,
handlerOptions?: HandlerOptions<EthFetchConfig, T>,
preprocessHandler?: (event: T, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, 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<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid | undefined |
handlerOptions? | HandlerOptions<EthFetchConfig, T> | undefined |
preprocessHandler? | (event: T, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
Returns
this
Inherited from
onInterval()
onInterval(
handler: (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid,
timeInterval:
| HandleInterval
| undefined,
blockInterval:
| HandleInterval
| undefined,
handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,
preprocessHandler?: (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult>,
handlerName?: string
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid | undefined |
timeInterval | | HandleInterval | undefined | undefined |
blockInterval | | HandleInterval | undefined | undefined |
handlerOptions? | HandlerOptions<EthFetchConfig, RichBlock> | undefined |
preprocessHandler? | (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
handlerName? | string | ... |
Returns
this
Inherited from
onTimeInterval()
onTimeInterval(
handler: (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid,
timeIntervalInMinutes?: number,
backfillTimeIntervalInMinutes?: number,
handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,
preprocessHandler?: (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult>
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid | undefined |
timeIntervalInMinutes | number | 60 |
backfillTimeIntervalInMinutes | number | 240 |
handlerOptions? | HandlerOptions<EthFetchConfig, RichBlock> | undefined |
preprocessHandler? | (block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
Returns
this
Inherited from
onTrace()
onTrace(
handler: (event: TypedCallTrace, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid,
handlerOptions?: HandlerOptions<EthFetchConfig, TypedCallTrace<any, any>>,
preprocessHandler?: (trace: TypedCallTrace, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult>
): this;Parameters
| Parameter | Type | Default value |
|---|---|---|
handler | (event: TypedCallTrace, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoid | undefined |
handlerOptions? | HandlerOptions<EthFetchConfig, TypedCallTrace<any, any>> | undefined |
preprocessHandler? | (trace: TypedCallTrace, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult> | defaultPreprocessHandler |
Returns
this
Inherited from
bind()
static bind(eventABI: string | string[], options: BindOptions): GenericProcessor;For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters.
Parameters
| Parameter | Type |
|---|---|
eventABI | string | string[] |
options | BindOptions |
Returns
GenericProcessor