SuiContext
Class in @sentio/sdk/sui
Defined in @sentio/sdk/sui
Extends
Constructors
Constructor
new SuiContext(
moduleName: string,
network: SuiChainId,
address: string,
timestamp: Date,
checkpoint: bigint,
transaction: ExecutedTransaction,
eventIndex: number,
baseLabels: Labels | undefined
): SuiContext;Parameters
| Parameter | Type |
|---|---|
moduleName | string |
network | SuiChainId |
address | string |
timestamp | Date |
checkpoint | bigint |
transaction | ExecutedTransaction |
eventIndex | number |
baseLabels | Labels | undefined |
Returns
SuiContext
Overrides
MoveContext<SuiNetwork, ModuleWithAddress, SuiEventInput | SuiMoveObjectInput>.constructorProperties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
address | string | - | MoveContext.address |
baseLabels | Labels | - | MoveContext.baseLabels |
checkpoint | bigint | - | - |
coder | MoveCoder | MoveContext.coder | - |
eventIndex | number | - | - |
eventLogger | EventLoggerBinding | - | MoveContext.eventLogger |
meter | Meter | - | MoveContext.meter |
moduleName | string | - | - |
network | SuiChainId | - | MoveContext.network |
timestamp | Date | - | - |
transaction | ExecutedTransaction | - | - |
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
client
Get Signature
get client(): SuiGrpcClient;Returns
SuiGrpcClient
store
Get Signature
get store(): Store;Returns
Store
Inherited from
Methods
getChainId()
getChainId(): SuiChainId;Returns
SuiChainId
Overrides
getMetaData()
getMetaData(name: string, labels: Labels): RecordMetaData;Parameters
| Parameter | Type |
|---|---|
name | string |
labels | Labels |
Returns
Inherited from
getMetaDataInternal()
getMetaDataInternal(name: string, labels: Labels): RecordMetaData;Parameters
| Parameter | Type |
|---|---|
name | string |
labels | Labels |
Returns
Overrides
MoveContext.getMetaDataInternalgetTimestamp()
getTimestamp(): number;Returns
number
Overrides
initStore()
initStore(): void;Returns
void
Inherited from
sendTemplateInstance()
sendTemplateInstance(instance: TemplateInstance, unbind?: boolean): void;Parameters
| Parameter | Type | Default value |
|---|---|---|
instance | TemplateInstance | undefined |
unbind | boolean | false |
Returns
void
Inherited from
MoveContext.sendTemplateInstance
stopAndGetResult()
stopAndGetResult(): ProcessResult;Returns
Inherited from
update()
update(res: MessageInit<ProcessResult>): void;Parameters
| Parameter | Type |
|---|---|
res | MessageInit<ProcessResult> |
Returns
void