EthContext

Class in @sentio/sdk/eth

Defined in @sentio/sdk/eth

Extends

Extended by

Constructors

Constructor

new EthContext(
   chainId: EthChainId, 
   address: string, 
   timestamp?: Date, 
   block?: BlockParams, 
   log?: LogParams, 
   trace?: Trace, 
   transaction?: TransactionResponseParams, 
   transactionReceipt?: TransactionReceiptParams, 
   baseLabels?: Labels, 
   preparedData?: PreparedData
): EthContext;

Parameters

ParameterType
chainIdEthChainId
addressstring
timestamp?Date
block?BlockParams
log?LogParams
trace?Trace
transaction?TransactionResponseParams
transactionReceipt?TransactionReceiptParams
baseLabels?Labels
preparedData?PreparedData

Returns

EthContext

Overrides

BaseContext.constructor

Properties

PropertyModifierTypeInherited from
addresspublicstring-
baseLabelspublicLabelsBaseContext.baseLabels
block?readonlyBlockParams-
blockNumberreadonlynumber-
chainIdreadonlyEthChainId-
eventLoggerpublicEventLoggerBindingBaseContext.eventLogger
meterpublicMeterBaseContext.meter
preparedData?readonlyPreparedData-
timestampreadonlyDate-
trace?readonlyTrace-
transaction?readonlyTransactionResponseParams-
transactionHash?readonlystring-
transactionReceipt?readonlyTransactionReceiptParams-

Accessors

cache

Get Signature

get cache(): MemoryCache;

Access the in-memory key-value cache.

The cache allows storing and retrieving JSON-serializable values that persist across handler invocations. Useful for caching computed results, tracking cumulative state, or storing intermediate processing data.

Example
// Store and retrieve values
await ctx.cache.set('totalVolume', volume)
const cached = await ctx.cache.get<number>('totalVolume')

// Block-scoped values (isolated per block)
await ctx.cache.setInBlock('blockCount', count)
See

MemoryCache for full API documentation

Returns

MemoryCache

The MemoryCache instance, or undefined if cache is not available

Inherited from

BaseContext.cache


store

Get Signature

get store(): Store;
Returns

Store

Inherited from

BaseContext.store

Methods

getBlockTag()

getBlockTag(overrides?: Overrides): string;

Parameters

ParameterType
overrides?Overrides

Returns

string


getChainId()

getChainId(): EthChainId;

Returns

EthChainId

Overrides

BaseContext.getChainId


getEthCallContext()

getEthCallContext(): EthCallContext;

Returns

EthCallContext


getMetaData()

getMetaData(name: string, labels: Labels): RecordMetaData;

Parameters

ParameterType
namestring
labelsLabels

Returns

RecordMetaData

Inherited from

BaseContext.getMetaData


getMetaDataInternal()

getMetaDataInternal(name: string, labels: Labels): RecordMetaData;

Parameters

ParameterType
namestring
labelsLabels

Returns

RecordMetaData

Overrides

BaseContext.getMetaDataInternal

initStore()

initStore(): void;

Returns

void

Inherited from

BaseContext.initStore


sendTemplateInstance()

sendTemplateInstance(instance: TemplateInstance, unbind?: boolean): void;

Parameters

ParameterTypeDefault value
instanceTemplateInstanceundefined
unbindbooleanfalse

Returns

void

Inherited from

BaseContext.sendTemplateInstance


stopAndGetResult()

stopAndGetResult(): ProcessResult;

Returns

ProcessResult

Inherited from

BaseContext.stopAndGetResult


update()

update(res: MessageInit<ProcessResult>): void;

Parameters

ParameterType
resMessageInit<ProcessResult>

Returns

void

Inherited from

BaseContext.update

On this page