BaseProcessorTemplate
Class in @sentio/sdk/eth
Defined in @sentio/sdk/eth
Extended by
EACAggregatorProxyProcessorTemplateERC1155ProcessorTemplateERC20ProcessorTemplateERC20BytesProcessorTemplateERC721ProcessorTemplateWETH9ProcessorTemplate
Type Parameters
| Type Parameter | Default 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
| Property | Type | Default value |
|---|---|---|
blockHandlers | object[] | [] |
eventHandlers | object[] | [] |
id | number | undefined |
instances | Set<string> | undefined |
traceHandlers | object[] | [] |
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
| Parameter | Type | Description |
|---|---|---|
options | Omit<BindOptions, "network"> | - |
ctx | EthContext | - |
Returns
void
configureHandlerFactory()
configureHandlerFactory(factory: (instance: TProcessor, baseLabels:
| {
[key: string]: string;
}
| undefined) => void): void;Parameters
| Parameter | Type |
|---|---|
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
| Parameter | Type | Default value |
|---|---|---|
handler | (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
blockInterval | number | 1000 |
backfillBlockInterval | number | 4000 |
fetchConfig? | EthFetchConfig | undefined |
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
| Parameter | Type | Default value |
|---|---|---|
handler | (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
timeInterval | | HandleInterval | undefined | undefined |
blockInterval | | HandleInterval | undefined | undefined |
fetchConfig | | EthFetchConfig | undefined | undefined |
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
| Parameter | Type | Default value |
|---|---|---|
handler | (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
timeIntervalInMinutes | number | 60 |
backfillTimeIntervalInMinutes | number | 240 |
fetchConfig? | EthFetchConfig | undefined |
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
| Parameter | Type | Default value |
|---|---|---|
signature | string | undefined |
handler | (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid | undefined |
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
| Parameter | Type |
|---|---|
options | Omit<BindOptions, "network"> |
ctx | EthContext |
Returns
void