Class: EthereumIndexer<ABI, ProcessResultType>
Constructors
new EthereumIndexer
new EthereumIndexer<
ABI
,ProcessResultType
>(provider
,processor
,source
,config
={}
):EthereumIndexer
<ABI
,ProcessResultType
>
Type parameters
Parameter | Default |
---|---|
ABI extends readonly (AbiEvent | AbiConstructor | AbiError | AbiFallback | AbiFunction | AbiReceive )[] | - |
ProcessResultType | void |
Parameters
Parameter | Type |
---|---|
provider | EIP1193ProviderWithoutEvents < EIP1193Request > |
processor | EventProcessor < ABI , ProcessResultType > |
source | IndexingSource < ABI > |
config | ProvidedIndexerConfig < 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
Parameter Type args
object
args.lastSyncFetched
LastSync
<ABI
>args.newEvents
LogEvent
<ABI
,undefined
>[]Returns
Promise
<LastSync
<ABI
> >
\_feed.next
next: (
args
) =>Promise
<LastSync
<ABI
> >Parameters
Parameter Type args
object
args.lastSyncFetched
LastSync
<ABI
>args.newEvents
LogEvent
<ABI
,undefined
>[]Returns
Promise
<LastSync
<ABI
> >
\_feed.now
now: (
args
) =>Promise
<LastSync
<ABI
> >Parameters
Parameter Type args
object
args.lastSyncFetched
LastSync
<ABI
>args.newEvents
LogEvent
<ABI
,undefined
>[]Returns
Promise
<LastSync
<ABI
> >
\_feed.once
once: (
args
) =>Promise
<LastSync
<ABI
> >Parameters
Parameter Type args
object
args.lastSyncFetched
LastSync
<ABI
>args.newEvents
LogEvent
<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
Parameter Type args
object
args.eventStream
LogEvent
<ABI
,undefined
>[]args.lastSync
LastSync
<ABI
>args.source
IndexingSource
<ABI
>Returns
Promise
<void
>
\_save.next
next: (
args
) =>Promise
<void
>Parameters
Parameter Type args
object
args.eventStream
LogEvent
<ABI
,undefined
>[]args.lastSync
LastSync
<ABI
>args.source
IndexingSource
<ABI
>Returns
Promise
<void
>
\_save.now
now: (
args
) =>Promise
<void
>Parameters
Parameter Type args
object
args.eventStream
LogEvent
<ABI
,undefined
>[]args.lastSync
LastSync
<ABI
>args.source
IndexingSource
<ABI
>Returns
Promise
<void
>
\_save.once
once: (
args
) =>Promise
<void
>Parameters
Parameter Type args
object
args.eventStream
LogEvent
<ABI
,undefined
>[]args.lastSync
LastSync
<ABI
>args.source
IndexingSource
<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
Parameter | Type |
---|---|
state | LoadingState |
Returns
Promise
< void
>
Defined In
packages/ethereum-indexer/src/indexer.ts:674
_onStateUpdated
protected
_onStateUpdated(outcome
):void
Parameters
Parameter | Type |
---|---|
outcome | ProcessResultType |
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
Parameter | Type |
---|---|
eventStream | LogEvent < 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
Parameter | Type |
---|---|
lastSync | LastSync < 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
Parameter | Type |
---|---|
processorHash | string |
Returns
LastSync
< ABI
>
Defined In
packages/ethereum-indexer/src/indexer.ts:645
getBlocks
protected
getBlocks(blockHashes
,unlessCancelled
):Promise
< {timestamp
:number
;}[] >
Parameters
Parameter | Type |
---|---|
blockHashes | string [] |
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
Parameter | Type |
---|---|
transactionHashes | string [] |
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
Parameter | Type |
---|---|
lastToBlock | number |
context | ContextIdentifier |
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
Parameter | Type |
---|---|
params | object |
params.lastSyncFetched | LastSync < ABI > |
params.newEvents | LogEvent < ABI , undefined >[] |
__namedParameters | CancelOperations |
Returns
Promise
< LastSync
< ABI
> >
Defined In
packages/ethereum-indexer/src/indexer.ts:372
promiseToIndex
protected
promiseToIndex(__namedParameters
):Promise
<LastSync
<ABI
> >
Parameters
Parameter | Type |
---|---|
__namedParameters | CancelOperations |
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
Parameter | Type |
---|---|
params | object |
params.eventStream | LogEvent < ABI , undefined >[] |
params.lastSync | LastSync < ABI > |
params.source | IndexingSource < 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
Parameter | Type |
---|---|
provider | EIP1193ProviderWithoutEvents < EIP1193Request > |
source | IndexingSource < ABI > |
config | ProvidedIndexerConfig < ABI > |
Returns
void
Defined In
packages/ethereum-indexer/src/indexer.ts:118
save
protected
save(source
,eventStream
,lastSync
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
source | IndexingSource < ABI > |
eventStream | LogEvent < ABI , undefined >[] |
lastSync | LastSync < ABI > |
Returns
Promise
< void
>
Defined In
packages/ethereum-indexer/src/indexer.ts:288
updateIndexer
updateIndexer(
update
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
update | object |
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
Parameter | Type |
---|---|
newProcessor | EventProcessor < ABI , ProcessResultType > |
Returns
Promise
< void
>
Defined In
packages/ethereum-indexer/src/indexer.ts:267
Generated using TypeDoc and typedoc-plugin-markdown