BaseProcessorTemplate

Class in @sentio/sdk/eth

Defined in @sentio/sdk/eth

Extended by

Type Parameters

Type ParameterDefault type
TContract extends BaseContract-
TBoundContractView extends BoundContractView<TContract, ContractView<TContract>>-
TProcessor extends BaseProcessor<TContract, TBoundContractView>BaseProcessor<TContract, TBoundContractView>

Constructors

Constructor

new BaseProcessorTemplate<TContract extends BaseContract, TBoundContractView extends BoundContractView<TContract, ContractView<TContract>>, TProcessor extends BaseProcessor<TContract, TBoundContractView> = BaseProcessor<TContract, TBoundContractView>>(): BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>;

Returns

BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>

Properties

PropertyTypeDefault value
blockHandlersobject[][]
eventHandlersobject[][]
idnumberundefined
instancesSet<string>undefined
traceHandlersobject[][]

Methods

bind()

bind(options: Omit<BindOptions, "network">, ctx: EthContext): void;

Bind template using options, using ctx's network value if not provided in the option

Parameters

ParameterTypeDescription
optionsOmit<BindOptions, "network">-
ctxEthContext-

Returns

void


configureHandlerFactory()

configureHandlerFactory(factory: (instance: TProcessor, baseLabels: 
  | {
[key: string]: string;
}
  | undefined) => void): void;

Parameters

ParameterType
factory(instance: TProcessor, baseLabels: | { [key: string]: string; } | undefined) => void

Returns

void


onBlockInterval()

onBlockInterval(
   handler: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid, 
   blockInterval?: number, 
   backfillBlockInterval?: number, 
   fetchConfig?: EthFetchConfig, 
   preprocessHandler?: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>
): BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>;

Parameters

ParameterTypeDefault value
handler(block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoidundefined
blockIntervalnumber1000
backfillBlockIntervalnumber4000
fetchConfig?EthFetchConfigundefined
preprocessHandler?(block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>defaultPreprocessHandler

Returns

BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>


onInterval()

onInterval(
   handler: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid, 
   timeInterval: 
  | HandleInterval
  | undefined, 
   blockInterval: 
  | HandleInterval
  | undefined, 
   fetchConfig: 
  | EthFetchConfig
  | undefined, 
   preprocessHandler?: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>
): BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>;

Parameters

ParameterTypeDefault value
handler(block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoidundefined
timeInterval| HandleInterval | undefinedundefined
blockInterval| HandleInterval | undefinedundefined
fetchConfig| EthFetchConfig | undefinedundefined
preprocessHandler(block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>defaultPreprocessHandler

Returns

BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>


onTimeInterval()

onTimeInterval(
   handler: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid, 
   timeIntervalInMinutes?: number, 
   backfillTimeIntervalInMinutes?: number, 
   fetchConfig?: EthFetchConfig, 
   preprocessHandler?: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>
): BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>;

Parameters

ParameterTypeDefault value
handler(block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoidundefined
timeIntervalInMinutesnumber60
backfillTimeIntervalInMinutesnumber240
fetchConfig?EthFetchConfigundefined
preprocessHandler?(block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>defaultPreprocessHandler

Returns

BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>


onTrace()

onTrace(
   signature: string, 
   handler: (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid, 
   fetchConfig?: Omit<Partial<EthFetchConfig>, "$typeName" | "$unknown">, 
   preprocessHandler?: (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>
): BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>;

Parameters

ParameterTypeDefault value
signaturestringundefined
handler(trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoidundefined
fetchConfig?Omit<Partial<EthFetchConfig>, "$typeName" | "$unknown">undefined
preprocessHandler?(trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>, preprocessStore: object) => Promise<PreprocessResult>defaultPreprocessHandler

Returns

BaseProcessorTemplate<TContract, TBoundContractView, TProcessor>


startInstance()

startInstance(options: Omit<BindOptions, "network">, ctx: EthContext): void;

Parameters

ParameterType
optionsOmit<BindOptions, "network">
ctxEthContext

Returns

void

On this page