FuelContractContext
Class in @sentio/sdk/fuel
Defined in @sentio/sdk/fuel
Extends
Type Parameters
| Type Parameter |
|---|
TContract extends Contract |
Constructors
Constructor
new FuelContractContext<TContract extends Contract>(
chainId: FuelChainId,
contract: TContract | undefined,
contractAddress: string,
contractName: string,
timestamp: Date,
transaction: FuelTransaction | null,
block: FuelBlock | null
): FuelContractContext<TContract>;Parameters
| Parameter | Type |
|---|---|
chainId | FuelChainId |
contract | TContract | undefined |
contractAddress | string |
contractName | string |
timestamp | Date |
transaction | FuelTransaction | null |
block | FuelBlock | null |
Returns
FuelContractContext<TContract>
Overrides
Properties
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
baseLabels | public | Labels | FuelContext.baseLabels |
block | readonly | FuelBlock | null | FuelContext.block |
chainId | readonly | FuelChainId | FuelContext.chainId |
contract | readonly | TContract | undefined | - |
contractAddress | readonly | string | FuelContext.contractAddress |
contractName | readonly | string | FuelContext.contractName |
eventLogger | public | EventLoggerBinding | FuelContext.eventLogger |
meter | public | Meter | FuelContext.meter |
timestamp | readonly | Date | FuelContext.timestamp |
transaction | readonly | FuelTransaction | null | FuelContext.transaction |
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
provider
Get Signature
get provider(): Provider | undefined;Returns
Provider | undefined
store
Get Signature
get store(): Store;Returns
Store
Inherited from
Methods
getChainId()
getChainId(): FuelChainId;Returns
FuelChainId
Inherited from
getMetaData()
getMetaData(name: string, labels: Labels): RecordMetaData;Parameters
| Parameter | Type |
|---|---|
name | string |
labels | Labels |
Returns
Inherited from
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
FuelContext.sendTemplateInstance
setLogIndex()
setLogIndex(logIndex: number): void;Parameters
| Parameter | Type |
|---|---|
logIndex | number |
Returns
void
Inherited from
stopAndGetResult()
stopAndGetResult(): ProcessResult;Returns
Inherited from
update()
update(res: MessageInit<ProcessResult>): void;Parameters
| Parameter | Type |
|---|---|
res | MessageInit<ProcessResult> |
Returns
void