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 (AbiConstructor | AbiError | AbiEvent | AbiFallback | AbiFunction | AbiReceive)[]-
ProcessResultTypevoid

Parameters

ParameterType
providerEIP1193ProviderWithoutEvents< EIP1193Request >
processorEventProcessor< ABI, ProcessResultType >
sourceIndexingSource< ABI >
config?ProvidedIndexerConfig< ABI >

Returns

EthereumIndexer< ABI, ProcessResultType >

Defined In

packages/ethereum-indexer/dist/index.d.ts:353

Properties

_feed

protected _feed: object

Type declaration

\_feed.executing

readonly executing: undefined | Promise< LastSync< ABI > >

\_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.block

block

\_feed.cancel

cancel

\_feed.getContext

getContext

\_feed.reset

reset

\_feed.setContext

setContext

\_feed.unblock

unblock

Defined In

packages/ethereum-indexer/dist/index.d.ts:286


_index

protected _index: object

Type declaration

\_index.executing

readonly executing: undefined | Promise< LastSync< ABI > >

\_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.block

block

\_index.cancel

cancel

\_index.getContext

getContext

\_index.reset

reset

\_index.setContext

setContext

\_index.unblock

unblock

Defined In

packages/ethereum-indexer/dist/index.d.ts:273


_load

protected _load: object

Type declaration

\_load.executing

readonly executing: undefined | Promise< LastSync< ABI > >

\_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.block

block

\_load.cancel

cancel

\_load.getContext

getContext

\_load.reset

reset

\_load.setContext

setContext

\_load.unblock

unblock

Defined In

packages/ethereum-indexer/dist/index.d.ts:311


_save

protected _save: object

Type declaration

\_save.executing

readonly executing: undefined | Promise< void >

\_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.block

block

\_save.cancel

cancel

\_save.getContext

getContext

\_save.reset

reset

\_save.setContext

setContext

\_save.unblock

unblock

Defined In

packages/ethereum-indexer/dist/index.d.ts:324


config

protected config: UsedIndexerConfig< ABI >

Defined In

packages/ethereum-indexer/dist/index.d.ts:264


defaultFromBlock

readonly defaultFromBlock: number

Defined In

packages/ethereum-indexer/dist/index.d.ts:258


finality

protected finality: number

Defined In

packages/ethereum-indexer/dist/index.d.ts:265


lastSync

protected lastSync: undefined | LastSync< ABI >

Defined In

packages/ethereum-indexer/dist/index.d.ts:272


logEventFetcher

protected logEventFetcher: LogEventFetcher< ABI >

Defined In

packages/ethereum-indexer/dist/index.d.ts:271


onLastSyncUpdated

onLastSyncUpdated: undefined | (lastSync) => void

Defined In

packages/ethereum-indexer/dist/index.d.ts:261


onLoad

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

Defined In

packages/ethereum-indexer/dist/index.d.ts:259


onStateUpdated

onStateUpdated: undefined | (state) => void

Defined In

packages/ethereum-indexer/dist/index.d.ts:260


processor

protected processor: EventProcessor< ABI, ProcessResultType >

Defined In

packages/ethereum-indexer/dist/index.d.ts:257


provider

protected provider: EIP1193ProviderWithoutEvents< EIP1193Request >

Defined In

packages/ethereum-indexer/dist/index.d.ts:262


source

protected source: IndexingSource< ABI >

Defined In

packages/ethereum-indexer/dist/index.d.ts:263


sourceHashes

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

Defined In

packages/ethereum-indexer/dist/index.d.ts:266


streamConfigHash

protected streamConfigHash: string

Defined In

packages/ethereum-indexer/dist/index.d.ts:270

Methods

_onLastSyncUpdated

protected _onLastSyncUpdated(): void

Returns

void

Defined In

packages/ethereum-indexer/dist/index.d.ts:389


_onLoad

protected _onLoad(state): Promise< void >

Parameters

ParameterType
stateLoadingState

Returns

Promise< void >

Defined In

packages/ethereum-indexer/dist/index.d.ts:390


_onStateUpdated

protected _onStateUpdated(outcome): void

Parameters

ParameterType
outcomeProcessResultType

Returns

void

Defined In

packages/ethereum-indexer/dist/index.d.ts:388


disableProcessing

disableProcessing(): void

Returns

void

Defined In

packages/ethereum-indexer/dist/index.d.ts:358


feed

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

Parameters

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

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/dist/index.d.ts:356


fetchLogsFromProvider

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

Type parameters

Parameter
ABI extends readonly (AbiConstructor | AbiError | AbiEvent | 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/dist/index.d.ts:378


freshLastSync

protected freshLastSync(processorHash): LastSync< ABI >

Parameters

ParameterType
processorHashstring

Returns

LastSync< ABI >

Defined In

packages/ethereum-indexer/dist/index.d.ts:387


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/dist/index.d.ts:382


getTransactions

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

Parameters

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

Returns

Promise< LogTransactionData[] >

Defined In

packages/ethereum-indexer/dist/index.d.ts:385


indexMore

indexMore(): Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/dist/index.d.ts:357


indexerMatches

protected indexerMatches(lastToBlock, context): boolean

Parameters

ParameterType
lastToBlocknumber
contextContextIdentifier

Returns

boolean

Defined In

packages/ethereum-indexer/dist/index.d.ts:386


load

load(): Promise< LastSync< ABI > >

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/dist/index.d.ts:355


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/dist/index.d.ts:368


promiseToIndex

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

Parameters

ParameterType
__namedParametersCancelOperations

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/dist/index.d.ts:377


promiseToLoad

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

Returns

Promise< LastSync< ABI > >

Defined In

packages/ethereum-indexer/dist/index.d.ts:367


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/dist/index.d.ts:372


reenableProcessing

reenableProcessing(): void

Returns

void

Defined In

packages/ethereum-indexer/dist/index.d.ts:359


reinit

reinit( provider, source, config): void

Parameters

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

Returns

void

Defined In

packages/ethereum-indexer/dist/index.d.ts:354


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/dist/index.d.ts:366


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/dist/index.d.ts:360


updateProcessor

updateProcessor(newProcessor): Promise< void >

Parameters

ParameterType
newProcessorEventProcessor< ABI, ProcessResultType >

Returns

Promise< void >

Defined In

packages/ethereum-indexer/dist/index.d.ts:365


Generated using TypeDoc and typedoc-plugin-markdown