AptosContext

Class in @sentio/sdk/aptos

Defined in @sentio/sdk/aptos

Extends

  • AptosTransactionContext<UserTransactionResponse>

Constructors

Constructor

new AptosContext(
   moduleName: string, 
   network: AptosChainId, 
   address: string, 
   version: bigint, 
   transaction: UserTransactionResponse | null, 
   eventIndex: number, 
   baseLabels: Labels | undefined
): AptosContext;

Parameters

ParameterType
moduleNamestring
networkAptosChainId
addressstring
versionbigint
transactionUserTransactionResponse | null
eventIndexnumber
baseLabelsLabels | undefined

Returns

AptosContext

Inherited from

AptosTransactionContext<UserTransactionResponse>.constructor

Properties

PropertyTypeInherited from
addressstringAptosTransactionContext.address
baseLabelsLabelsAptosTransactionContext.baseLabels
coderMoveCoderAptosTransactionContext.coder
eventIndexnumberAptosTransactionContext.eventIndex
eventLoggerEventLoggerBindingAptosTransactionContext.eventLogger
meterMeterAptosTransactionContext.meter
moduleNamestringAptosTransactionContext.moduleName
networkAptosChainIdAptosTransactionContext.network
transactionUserTransactionResponseAptosTransactionContext.transaction
versionbigintAptosTransactionContext.version

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

AptosTransactionContext.cache

store

Get Signature

get store(): Store;
Returns

Store

Inherited from

AptosTransactionContext.store

Methods

getChainId()

getChainId(): AptosChainId;

Returns

AptosChainId

Inherited from

AptosTransactionContext.getChainId

getClient()

getClient(): RichAptosClientWithContext;

Returns

RichAptosClientWithContext

Inherited from

AptosTransactionContext.getClient

getMetaData()

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

Parameters

ParameterType
namestring
labelsLabels

Returns

RecordMetaData

Inherited from

AptosTransactionContext.getMetaData

getMetaDataInternal()

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

Parameters

ParameterType
namestring
labelsLabels

Returns

RecordMetaData

Inherited from

AptosTransactionContext.getMetaDataInternal

getTimestamp()

getTimestamp(): number;

Returns

number

Inherited from

AptosTransactionContext.getTimestamp

initStore()

initStore(): void;

Returns

void

Inherited from

AptosTransactionContext.initStore

sendTemplateInstance()

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

Parameters

ParameterTypeDefault value
instanceTemplateInstanceundefined
unbindbooleanfalse

Returns

void

Inherited from

AptosTransactionContext.sendTemplateInstance

stopAndGetResult()

stopAndGetResult(): ProcessResult;

Returns

ProcessResult

Inherited from

AptosTransactionContext.stopAndGetResult

update()

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

Parameters

ParameterType
resMessageInit<ProcessResult>

Returns

void

Inherited from

AptosTransactionContext.update

On this page