Skip to content
On this page

Class: EthereumIndexer<ABI, ProcessResultType>

Constructors

new EthereumIndexer

new EthereumIndexer<ABI, ProcessResultType>( provider, processor, source, config = {}): EthereumIndexer< ABI, ProcessResultType >

Type parameters

ParameterDefault
ABI extends readonly (AbiEvent | AbiConstructor | AbiError | AbiFallback | AbiFunction | AbiReceive)[]-
ProcessResultTypevoid

Parameters

ParameterType
providerEIP1193ProviderWithoutEvents< EIP1193Request >
processorEventProcessor< ABI, ProcessResultType >
sourceIndexingSource< ABI >
configProvidedIndexerConfig< ABI >

Returns

EthereumIndexer< ABI, ProcessResultType >

Defined In

packages/ethereum-indexer/src/indexer.ts:109

Properties

_feed

protected _feed: object

Type declaration

\_feed.ifNotExecuting

ifNotExecuting: (args) => Promise< LastSync< ABI > >

Parameters
ParameterType
argsobject
args.lastSyncFetchedLastSync< ABI >
args.newEventsLogEvent< ABI, undefined >[]
Returns

Promise< LastSync< ABI > >

\_feed.next

next: (args) => Promise< LastSync< ABI > >

Parameters
ParameterType
argsobject
args.lastSyncFetchedLastSync< ABI >
args.newEventsLogEvent< ABI, undefined >[]
Returns

Promise< LastSync< ABI > >

\_feed.now

now: (args) => Promise< LastSync< ABI > >

Parameters
ParameterType
argsobject
args.lastSyncFetchedLastSync< ABI >
args.newEventsLogEvent< ABI, undefined >[]
Returns

Promise< LastSync< ABI > >

\_feed.once

once: (args) => Promise< LastSync< ABI > >

Parameters
ParameterType
argsobject
args.lastSyncFetchedLastSync< ABI >
args.newEventsLogEvent< ABI, undefined >[]
Returns

Promise< LastSync< ABI > >

\_feed.executing

get executing(): undefined | Promise< T >

\_feed.block

block

\_feed.cancel

cancel

\_feed.getContext

getContext

\_feed.reset

reset

\_feed.setContext

setContext

\_feed.unblock

unblock

Defined In

packages/ethereum-indexer/src/indexer.ts:95


_index

protected _index: object

Type declaration

\_index.ifNotExecuting

ifNotExecuting: () => Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

\_index.next

next: () => Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

\_index.now

now: () => Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

\_index.once

once: () => Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

\_index.executing

get executing(): undefined | Promise< T >

\_index.block

block

\_index.cancel

cancel

\_index.getContext

getContext

\_index.reset

reset

\_index.setContext

setContext

\_index.unblock

unblock

Defined In

packages/ethereum-indexer/src/indexer.ts:94


_load

protected _load: object

Type declaration

\_load.ifNotExecuting

ifNotExecuting: () => Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

\_load.next

next: () => Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

\_load.now

now: () => Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

\_load.once

once: () => Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

\_load.executing

get executing(): undefined | Promise< T >

\_load.block

block

\_load.cancel

cancel

\_load.getContext

getContext

\_load.reset

reset

\_load.setContext

setContext

\_load.unblock

unblock

Defined In

packages/ethereum-indexer/src/indexer.ts:98


_save

protected _save: object

Type declaration

\_save.ifNotExecuting

ifNotExecuting: (args) => Promise< void >

Parameters
ParameterType
argsobject
args.eventStreamLogEvent< ABI, undefined >[]
args.lastSyncLastSync< ABI >
args.sourceIndexingSource< ABI >
Returns

Promise< void >

\_save.next

next: (args) => Promise< void >

Parameters
ParameterType
argsobject
args.eventStreamLogEvent< ABI, undefined >[]
args.lastSyncLastSync< ABI >
args.sourceIndexingSource< ABI >
Returns

Promise< void >

\_save.now

now: (args) => Promise< void >

Parameters
ParameterType
argsobject
args.eventStreamLogEvent< ABI, undefined >[]
args.lastSyncLastSync< ABI >
args.sourceIndexingSource< ABI >
Returns

Promise< void >

\_save.once

once: (args) => Promise< void >

Parameters
ParameterType
argsobject
args.eventStreamLogEvent< ABI, undefined >[]
args.lastSyncLastSync< ABI >
args.sourceIndexingSource< ABI >
Returns

Promise< void >

\_save.executing

get executing(): undefined | Promise< T >

\_save.block

block

\_save.cancel

cancel

\_save.getContext

getContext

\_save.reset

reset

\_save.setContext

setContext

\_save.unblock

unblock

Defined In

packages/ethereum-indexer/src/indexer.ts:99


config

protected config: UsedIndexerConfig< ABI >

Defined In

packages/ethereum-indexer/src/indexer.ts:81


defaultFromBlock

readonly defaultFromBlock: number

Defined In

packages/ethereum-indexer/src/indexer.ts:70


finality

protected finality: number

Defined In

packages/ethereum-indexer/src/indexer.ts:82


lastSync

protected lastSync: undefined | LastSync< ABI >

Defined In

packages/ethereum-indexer/src/indexer.ts:89


logEventFetcher

protected logEventFetcher: LogEventFetcher< ABI >

Defined In

packages/ethereum-indexer/src/indexer.ts:87


onLastSyncUpdated

onLastSyncUpdated: undefined | (lastSync) => void

Defined In

packages/ethereum-indexer/src/indexer.ts:73


onLoad

onLoad: undefined | (state) => Promise< void >

Defined In

packages/ethereum-indexer/src/indexer.ts:71


onStateUpdated

onStateUpdated: undefined | (state) => void

Defined In

packages/ethereum-indexer/src/indexer.ts:72


processor

protected processor: EventProcessor< ABI, ProcessResultType >

Defined In

packages/ethereum-indexer/src/indexer.ts:111


provider

protected provider: EIP1193ProviderWithoutEvents< EIP1193Request >

Defined In

packages/ethereum-indexer/src/indexer.ts:78


source

protected source: IndexingSource< ABI >

Defined In

packages/ethereum-indexer/src/indexer.ts:79


sourceHashes

protected sourceHashes: {hash: string; startBlock: number;}[]

Defined In

packages/ethereum-indexer/src/indexer.ts:84


streamConfigHash

protected streamConfigHash: string

Defined In

packages/ethereum-indexer/src/indexer.ts:85

Methods

_onLastSyncUpdated

protected _onLastSyncUpdated(): void

Returns

void

Defined In

packages/ethereum-indexer/src/indexer.ts:666


_onLoad

protected _onLoad(state): Promise< void >

Parameters

ParameterType
stateLoadingState

Returns

Promise< void >

Defined In

packages/ethereum-indexer/src/indexer.ts:674


_onStateUpdated

protected _onStateUpdated(outcome): void

Parameters

ParameterType
outcomeProcessResultType

Returns

void

Defined In

packages/ethereum-indexer/src/indexer.ts:658


disableProcessing

disableProcessing(): void

Returns

void

Defined In

packages/ethereum-indexer/src/indexer.ts:199


feed

feed(eventStream, lastSyncFetched?): Promise< LastSync< ABI > >

Parameters

ParameterType
eventStreamLogEvent< ABI, undefined >[]
lastSyncFetched?LastSync< ABI >

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/src/indexer.ts:166


fetchLogsFromProvider

fetchLogsFromProvider<ABI>(lastSync, unlessCancelled): Promise< {eventStream: LogEvent< ABI, undefined >[]; lastSync: LastSync< ABI >;} >

Type parameters

Parameter
ABI extends readonly (AbiEvent | AbiConstructor | AbiError | AbiFallback | AbiFunction | AbiReceive)[]

Parameters

ParameterType
lastSyncLastSync< ABI >
unlessCancelled<T>(p) => Promise< T >

Returns

Promise< {eventStream: LogEvent< ABI, undefined >[]; lastSync: LastSync< ABI >;} >

Defined In

packages/ethereum-indexer/src/indexer.ts:494


freshLastSync

protected freshLastSync(processorHash): LastSync< ABI >

Parameters

ParameterType
processorHashstring

Returns

LastSync< ABI >

Defined In

packages/ethereum-indexer/src/indexer.ts:645


getBlocks

protected getBlocks(blockHashes, unlessCancelled): Promise< {timestamp: number;}[] >

Parameters

ParameterType
blockHashesstring[]
unlessCancelled<T>(p) => Promise< T >

Returns

Promise< {timestamp: number;}[] >

Defined In

packages/ethereum-indexer/src/indexer.ts:606


getTransactions

protected getTransactions(transactionHashes, unlessCancelled): Promise< LogTransactionData[] >

Parameters

ParameterType
transactionHashesstring[]
unlessCancelled<T>(p) => Promise< T >

Returns

Promise< LogTransactionData[] >

Defined In

packages/ethereum-indexer/src/indexer.ts:623


indexMore

indexMore(): Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/src/indexer.ts:184


indexerMatches

protected indexerMatches(lastToBlock, context): boolean

Parameters

ParameterType
lastToBlocknumber
contextContextIdentifier

Returns

boolean

Defined In

packages/ethereum-indexer/src/indexer.ts:641


load

load(): Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/src/indexer.ts:153


promiseToFeed

protected promiseToFeed(params, __namedParameters): Promise< LastSync< ABI > >

Parameters

ParameterType
paramsobject
params.lastSyncFetchedLastSync< ABI >
params.newEventsLogEvent< ABI, undefined >[]
__namedParametersCancelOperations

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/src/indexer.ts:372


promiseToIndex

protected promiseToIndex(__namedParameters): Promise< LastSync< ABI > >

Parameters

ParameterType
__namedParametersCancelOperations

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/src/indexer.ts:448


promiseToLoad

protected promiseToLoad(): Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/src/indexer.ts:292


promiseToSave

protected promiseToSave(params): Promise< void >

Parameters

ParameterType
paramsobject
params.eventStreamLogEvent< ABI, undefined >[]
params.lastSyncLastSync< ABI >
params.sourceIndexingSource< ABI >

Returns

Promise< void >

Defined In

packages/ethereum-indexer/src/indexer.ts:422


reenableProcessing

reenableProcessing(): void

Returns

void

Defined In

packages/ethereum-indexer/src/indexer.ts:207


reinit

reinit( provider, source, config): void

Parameters

ParameterType
providerEIP1193ProviderWithoutEvents< EIP1193Request >
sourceIndexingSource< ABI >
configProvidedIndexerConfig< ABI >

Returns

void

Defined In

packages/ethereum-indexer/src/indexer.ts:118


save

protected save( source, eventStream, lastSync): Promise< void >

Parameters

ParameterType
sourceIndexingSource< ABI >
eventStreamLogEvent< ABI, undefined >[]
lastSyncLastSync< ABI >

Returns

Promise< void >

Defined In

packages/ethereum-indexer/src/indexer.ts:288


updateIndexer

updateIndexer(update): Promise< void >

Parameters

ParameterType
updateobject
update.provider?EIP1193ProviderWithoutEvents< EIP1193Request >
update.source?IndexingSource< ABI >
update.streamConfig?ProvidedStreamConfig

Returns

Promise< void >

Defined In

packages/ethereum-indexer/src/indexer.ts:211


updateProcessor

updateProcessor(newProcessor): Promise< void >

Parameters

ParameterType
newProcessorEventProcessor< ABI, ProcessResultType >

Returns

Promise< void >

Defined In

packages/ethereum-indexer/src/indexer.ts:267


Generated using TypeDoc and typedoc-plugin-markdown