BaseProcessor

Class in @sentio/sdk/eth

Defined in @sentio/sdk/eth

Extended by

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

ParameterType
configBindOptions

Returns

BaseProcessor<TContract, TBoundContractView>

Properties

PropertyType
blockHandlersBlockHandler[]
configBindInternalOptions
eventHandlersEventsHandler[]
traceHandlersTraceHandler[]

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

ParameterTypeDefault value
handler(block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoidundefined
blockIntervalnumber250
backfillBlockIntervalnumber1000
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 ParameterDefault type
T extends TypedEvent<any, any>TypedEvent<any, any>

Parameters

ParameterTypeDefault value
handler(event: T, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoidundefined
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

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

ParameterTypeDefault value
handler(block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoidundefined
timeIntervalInMinutesnumber60
backfillTimeIntervalInMinutesnumber240
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

ParameterTypeDefault value
handler(event: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoidundefined
handlerOptions?HandlerOptions<EthFetchConfig, TypedCallTrace<any, any>>undefined
preprocessHandler?(trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>defaultPreprocessHandler

Returns

this

On this page