Skip to main content

Event schema file

Create an event schema file to decode smart contract event logs specified using the event streaming filter options:

Decode events to view them in a more readable format.

The event schema file is a yaml file that uses the following syntax:

Example
eventSchemas:
# Cash contract events
- id: cashBalanceUpdate
contractAddress: "0xcb4f3cA3777fE16FBF4595Ba48d0eBFAEfEaBEBc"
eventSpecification:
eventName: CashBalanceUpdate
indexedParameterDefinitions:
- position: 0
type: BYTES32
- position: 1
type: ADDRESS
- position: 2
type: ADDRESS
nonIndexedParameterDefinitions:
- position: 3
type: STRING
- position: 4
type: STRING
- position: 5
type: STRING
- position: 6
type: INT256

Specify the following parameters to decode the event stream.

NameTypeRequiredDescription
idStringnoUnique identifier for the event.
contractAddressStringyesAddress of the smart contract emitting the event.
eventSpecificationJSONyesThe event details.

eventSpecification

NameTypeRequiredDescription
eventNameStringyesEvent name within the smart contract.
indexedParameterDefinitionsString arrayyesArray of indexed parameter types for the event.
nonIndexedParameterDefinitionsString arrayyesArray of non-indexed parameter types for the event.

indexedParameterDefinitions / nonIndexedParameterDefinitions

NameTypeRequiredDescription
positionNumberyesZero-indexed position of the parameter within the event specification.
typeStringyesType of the event parameter.

Currently supported parameter types: UINT8-256, INT8-256, ADDRESS, BYTES1-32, STRING, BOOL.

Dynamically sized arrays are also supported by suffixing the type with square brackets []. For example, UINT256[].