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.
Name | Type | Required | Description |
---|---|---|---|
id |
String |
no | Unique identifier for the event. |
contractAddress |
String |
yes | Address of the smart contract emitting the event. |
eventSpecification |
JSON |
yes | The event details. |
eventSpecification
Name | Type | Required | Description |
---|---|---|---|
eventName |
String |
yes | Event name within the smart contract. |
indexedParameterDefinitions |
String array |
yes | Array of indexed parameter types for the event. |
nonIndexedParameterDefinitions |
String array |
yes | Array of non-indexed parameter types for the event. |
indexedParameterDefinitions
/ nonIndexedParameterDefinitions
Name | Type | Required | Description |
---|---|---|---|
position |
Number |
yes | Zero-indexed position of the parameter within the event specification. |
type |
String |
yes | Type 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[]
.