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
| Parameter | Type |
|---|---|
moduleName | string |
network | AptosChainId |
address | string |
version | bigint |
transaction | UserTransactionResponse | null |
eventIndex | number |
baseLabels | Labels | undefined |
Returns
AptosContext
Inherited from
AptosTransactionContext<UserTransactionResponse>.constructorProperties
| Property | Type | Inherited from |
|---|---|---|
address | string | AptosTransactionContext.address |
baseLabels | Labels | AptosTransactionContext.baseLabels |
coder | MoveCoder | AptosTransactionContext.coder |
eventIndex | number | AptosTransactionContext.eventIndex |
eventLogger | EventLoggerBinding | AptosTransactionContext.eventLogger |
meter | Meter | AptosTransactionContext.meter |
moduleName | string | AptosTransactionContext.moduleName |
network | AptosChainId | AptosTransactionContext.network |
transaction | UserTransactionResponse | AptosTransactionContext.transaction |
version | bigint | AptosTransactionContext.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.cachestore
Get Signature
get store(): Store;Returns
Store
Inherited from
AptosTransactionContext.storeMethods
getChainId()
getChainId(): AptosChainId;Returns
AptosChainId
Inherited from
AptosTransactionContext.getChainIdgetClient()
getClient(): RichAptosClientWithContext;Returns
Inherited from
AptosTransactionContext.getClientgetMetaData()
getMetaData(name: string, labels: Labels): RecordMetaData;Parameters
| Parameter | Type |
|---|---|
name | string |
labels | Labels |
Returns
Inherited from
AptosTransactionContext.getMetaDatagetMetaDataInternal()
getMetaDataInternal(name: string, labels: Labels): RecordMetaData;Parameters
| Parameter | Type |
|---|---|
name | string |
labels | Labels |
Returns
Inherited from
AptosTransactionContext.getMetaDataInternalgetTimestamp()
getTimestamp(): number;Returns
number
Inherited from
AptosTransactionContext.getTimestampinitStore()
initStore(): void;Returns
void
Inherited from
AptosTransactionContext.initStoresendTemplateInstance()
sendTemplateInstance(instance: TemplateInstance, unbind?: boolean): void;Parameters
| Parameter | Type | Default value |
|---|---|---|
instance | TemplateInstance | undefined |
unbind | boolean | false |
Returns
void
Inherited from
AptosTransactionContext.sendTemplateInstancestopAndGetResult()
stopAndGetResult(): ProcessResult;Returns
Inherited from
AptosTransactionContext.stopAndGetResultupdate()
update(res: MessageInit<ProcessResult>): void;Parameters
| Parameter | Type |
|---|---|
res | MessageInit<ProcessResult> |
Returns
void
Inherited from
AptosTransactionContext.update