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

ParameterType
chainIdFuelChainId
contractTContract | undefined
contractAddressstring
contractNamestring
timestampDate
transactionFuelTransaction | null
blockFuelBlock | null

Returns

FuelContractContext<TContract>

Overrides

FuelContext.constructor

Properties

PropertyModifierTypeInherited from
baseLabelspublicLabelsFuelContext.baseLabels
blockreadonlyFuelBlock | nullFuelContext.block
chainIdreadonlyFuelChainIdFuelContext.chainId
contractreadonlyTContract | undefined-
contractAddressreadonlystringFuelContext.contractAddress
contractNamereadonlystringFuelContext.contractName
eventLoggerpublicEventLoggerBindingFuelContext.eventLogger
meterpublicMeterFuelContext.meter
timestampreadonlyDateFuelContext.timestamp
transactionreadonlyFuelTransaction | nullFuelContext.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

FuelContext.cache


provider

Get Signature

get provider(): Provider | undefined;
Returns

Provider | undefined


store

Get Signature

get store(): Store;
Returns

Store

Inherited from

FuelContext.store

Methods

getChainId()

getChainId(): FuelChainId;

Returns

FuelChainId

Inherited from

FuelContext.getChainId


getMetaData()

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

Parameters

ParameterType
namestring
labelsLabels

Returns

RecordMetaData

Inherited from

FuelContext.getMetaData


initStore()

initStore(): void;

Returns

void

Inherited from

FuelContext.initStore


sendTemplateInstance()

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

Parameters

ParameterTypeDefault value
instanceTemplateInstanceundefined
unbindbooleanfalse

Returns

void

Inherited from

FuelContext.sendTemplateInstance


setLogIndex()

setLogIndex(logIndex: number): void;

Parameters

ParameterType
logIndexnumber

Returns

void

Inherited from

FuelContext.setLogIndex


stopAndGetResult()

stopAndGetResult(): ProcessResult;

Returns

ProcessResult

Inherited from

FuelContext.stopAndGetResult


update()

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

Parameters

ParameterType
resMessageInit<ProcessResult>

Returns

void

Inherited from

FuelContext.update

On this page