BaseContext

Class in @sentio/sdk

Defined in @sentio/sdk

Extended by

Properties

PropertyType
baseLabelsLabels
eventLoggerEventLoggerBinding
meterMeter

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


store

Get Signature

get store(): Store;
Returns

Store

Methods

getChainId()

abstract getChainId(): ChainId;

Returns

ChainId


getMetaData()

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

Parameters

ParameterType
namestring
labelsLabels

Returns

RecordMetaData


initStore()

initStore(): void;

Returns

void


sendTemplateInstance()

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

Parameters

ParameterTypeDefault value
instanceTemplateInstanceundefined
unbindbooleanfalse

Returns

void


stopAndGetResult()

stopAndGetResult(): ProcessResult;

Returns

ProcessResult


update()

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

Parameters

ParameterType
resMessageInit<ProcessResult>

Returns

void

On this page