GenericProcessor

Class in @sentio/sdk/eth

Defined in @sentio/sdk/eth

Extends

Constructors

Constructor

new GenericProcessor(eventABI: string[], options: BindOptions): GenericProcessor;

Parameters

ParameterType
eventABIstring[]
optionsBindOptions

Returns

GenericProcessor

Overrides

BaseProcessor.constructor

Properties

PropertyTypeInherited from
blockHandlersBlockHandler[]BaseProcessor.blockHandlers
configBindInternalOptionsBaseProcessor.config
eventABIstring[]-
eventHandlersEventsHandler[]BaseProcessor.eventHandlers
traceHandlersTraceHandler[]BaseProcessor.traceHandlers

Methods

getChainId()

getChainId(): EthChainId;

Returns

EthChainId

Inherited from

BaseProcessor.getChainId


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

ParameterTypeDefault value
handler(block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoidundefined
blockIntervalnumber250
backfillBlockIntervalnumber1000
handlerOptions?HandlerOptions<EthFetchConfig, RichBlock>undefined
preprocessHandler?(block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult>defaultPreprocessHandler

Returns

this

Inherited from

BaseProcessor.onBlockInterval


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 ParameterDefault type
T extends TypedEvent<any, any>TypedEvent<any, any>

Parameters

ParameterTypeDefault value
handler(event: T, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoidundefined
handlerOptions?HandlerOptions<EthFetchConfig, T>undefined
preprocessHandler?(event: T, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult>defaultPreprocessHandler

Returns

this

Inherited from

BaseProcessor.onEvent


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

ParameterTypeDefault value
handler(block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoidundefined
timeInterval| HandleInterval | undefinedundefined
blockInterval| HandleInterval | undefinedundefined
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

BaseProcessor.onInterval


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

ParameterTypeDefault value
handler(block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoidundefined
timeIntervalInMinutesnumber60
backfillTimeIntervalInMinutesnumber240
handlerOptions?HandlerOptions<EthFetchConfig, RichBlock>undefined
preprocessHandler?(block: RichBlock, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>, preprocessStore: object) => Promise<PreprocessResult>defaultPreprocessHandler

Returns

this

Inherited from

BaseProcessor.onTimeInterval


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

ParameterTypeDefault value
handler(event: TypedCallTrace, ctx: ContractContext<BaseContract, BoundContractView<BaseContract, ContractView<BaseContract>>>) => PromiseOrVoidundefined
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

BaseProcessor.onTrace


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

ParameterType
eventABIstring | string[]
optionsBindOptions

Returns

GenericProcessor

On this page