Event Data Reference
Event Structure​
Events received via Webhook, after being verified by the SDK, are available as objects with the following structure:
type EventPayload = {
/**
* ID of the event record
*/
id: string;
/**
* Decoded event log
*/
event: object;
/**
* Transaction hash
*/
transactionHash: string;
/**
* Block number
*/
blockNumber: number;
/**
* Transaction index
*/
transactionIndex: number;
/**
* Log index
*/
logIndex: number;
/**
* Block timestamp
*/
blockTimestamp: number;
};
Example Event Data​
For example, when receiving a Transfer event, the data would look like this:
{
"id": "evt_1234567890",
"event": {
"name": "Transfer",
"args": {
"from": "0x1234567890123456789012345678901234567890",
"to": "0x0987654321098765432109876543210987654321",
"value": "1000000000000000000"
}
},
"transactionHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"blockNumber": 12345678,
"transactionIndex": 42,
"logIndex": 7,
"blockTimestamp": 1621234567
}
Subscription Structure​
When you create or retrieve subscriptions, they have the following structure:
interface EventNotifierSubscription {
/** Subscription ID */
id: string;
/** Project ID */
projectId: number;
/** Subscription name */
subscriptionName: string;
/** Network ID */
networkId: number;
/** Contract address */
address: string;
/**
* Formatted ABI event definition using abitype's formatAbiItem() format.
* Example: 'event Transfer(address indexed from, address indexed to, uint256 value)'
*/
formattedAbiEvent: string;
/** Scan enabled status */
scanEnabled: boolean;
/** Initial block number */
initialBlockNumber: number;
/** Scan interval in seconds */
scanInterval: number;
/** Webhook enabled status */
webhookEnabled: boolean;
/** Webhook URL */
webhookURL: string;
/** Maximum webhook retries */
webhookMaxRetries: number;
/** Webhook secret */
webhookSecret: string;
/** Current scan status */
scanStatus: 'idle' | 'scanning' | 'failed';
/** Last scanned block */
lastScannedBlock: number;
/** Last scanned timestamp */
lastScannedAt: string;
/** Next scan timestamp */
nextScanAt: string;
}
Next Steps​
- Implement webhook receiver to handle these events
- Manage subscriptions to configure your event monitoring