Context Object

A function is defined with a list of triggers. When a function is invoked, it receives two objects: a context object and a data object.

The context object contains metadata concerning your function and the occurrence that matched your trigger. It includes the following fields:

FieldTypeDescription
chainIdnumberThe number of the chain id that caused the function to be called.
triggertriggerThe trigger object that caused the function to be called.
triggerTypestringThe value of the type field of the trigger object.
funcIdstringThe ID of the function that was triggered.
dataTypestringThe data object's type. Can be one of DATA_TYPE_TRACE, DATA_TYPE_LOG, DATA_TYPE_BLOCK, DATA_TYPE_BYTECODE, DATA_TYPE_STORAGE_ACCESS.
blockNumberstringThe block number the occurrence occurred in.
blockTimestampDateThe timestamp of the block the occurrence occurred in.
txHashstringThe hash of the transaction that triggered the occurrence (if applicable).
txIndexnumberThe index of the transaction in the block (if applicable).
innerPathstringThe path to the data in the transaction. This is only relevant for internal transactions.
isTriggeredByReplaybooleanTrue if the function was triggered by replaying functions.