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:
Field | Type | Description |
---|---|---|
chainId | number | The number of the chain id that caused the function to be called. |
trigger | trigger | The trigger object that caused the function to be called. |
triggerType | string | The value of the type field of the trigger object. |
funcId | string | The ID of the function that was triggered. |
dataType | string | The data object's type. Can be one of DATA_TYPE_TRACE , DATA_TYPE_LOG , DATA_TYPE_BLOCK , DATA_TYPE_BYTECODE , DATA_TYPE_STORAGE_ACCESS . |
blockNumber | string | The block number the occurrence occurred in. |
blockTimestamp | Date | The timestamp of the block the occurrence occurred in. |
txHash | string | The hash of the transaction that triggered the occurrence (if applicable). |
txIndex | number | The index of the transaction in the block (if applicable). |
innerPath | string | The path to the data in the transaction. This is only relevant for internal transactions. |
isTriggeredByReplay | boolean | True if the function was triggered by replaying functions. |
Updated 2 months ago