AccountContext

Class in @sentio/sdk/eth

Defined in @sentio/sdk/eth

Extends

Constructors

Constructor

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

Parameters

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

Returns

AccountContext

Inherited from

EthContext.constructor

Properties

PropertyModifierTypeInherited from
addresspublicstringEthContext.address
baseLabelspublicLabelsEthContext.baseLabels
block?readonlyBlockParamsEthContext.block
blockNumberreadonlynumberEthContext.blockNumber
chainIdreadonlyEthChainIdEthContext.chainId
eventLoggerpublicEventLoggerBindingEthContext.eventLogger
meterpublicMeterEthContext.meter
preparedData?readonlyPreparedDataEthContext.preparedData
timestampreadonlyDateEthContext.timestamp
trace?readonlyTraceEthContext.trace
transaction?readonlyTransactionResponseParamsEthContext.transaction
transactionHash?readonlystringEthContext.transactionHash
transactionReceipt?readonlyTransactionReceiptParamsEthContext.transactionReceipt

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

EthContext.cache


store

Get Signature

get store(): Store;
Returns

Store

Inherited from

EthContext.store

Methods

getBlockTag()

getBlockTag(overrides?: Overrides): string;

Parameters

ParameterType
overrides?Overrides

Returns

string

Inherited from

EthContext.getBlockTag


getChainId()

getChainId(): EthChainId;

Returns

EthChainId

Inherited from

EthContext.getChainId


getEthCallContext()

getEthCallContext(): EthCallContext;

Returns

EthCallContext

Inherited from

EthContext.getEthCallContext


getMetaData()

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

Parameters

ParameterType
namestring
labelsLabels

Returns

RecordMetaData

Inherited from

EthContext.getMetaData


getMetaDataInternal()

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

Parameters

ParameterType
namestring
labelsLabels

Returns

RecordMetaData

Inherited from

EthContext.getMetaDataInternal


initStore()

initStore(): void;

Returns

void

Inherited from

EthContext.initStore


sendTemplateInstance()

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

Parameters

ParameterTypeDefault value
instanceTemplateInstanceundefined
unbindbooleanfalse

Returns

void

Inherited from

EthContext.sendTemplateInstance


stopAndGetResult()

stopAndGetResult(): ProcessResult;

Returns

ProcessResult

Inherited from

EthContext.stopAndGetResult


update()

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

Parameters

ParameterType
resMessageInit<ProcessResult>

Returns

void

Inherited from

EthContext.update

On this page