EVENT(Aptos Only)
Supported Network
Network | Supporting |
|---|---|
Aptos Mainnet | ✅ |
Aptos Testnet | ✅ |
Ethereum Mainnet | ❌ |
Ethereum Testnet (sepolia) | ❌ |
Ethereum Testnet (holesky) | ❌ |
Base Mainnet | ❌ |
Base Testnet(sepolia) | ❌ |
Polygon Mainnet | ❌ |
Polygon Testnet (amoy) | ❌ |
Arbitrum Mainnet | ❌ |
Arbitrum Testnet (sepolia) | ❌ |
Optimism Mainnet | ❌ |
Optimism Testnet (sepolia) | ❌ |
Kaia Mainnet | ❌ |
Webhook Creation Request Example
When setting the eventType value to EVENT, the available condition object fields are as follows.
Key | Type | Required | Description | Example Value |
|---|---|---|---|---|
eventType | String | true | The event type to monitor. The event type refers to the name of the event struct defined in the module. Enter this field in the format "module_address::module_name::event_name". | "0x1::account::CoinRegisterEvent" |
eventAccountAddress | String | true | The address that triggers the event you want to monitor. | "0x84e6da2230d45f8e6e1e607fa304f92a2c0691cd85caa43c4920727547c5b07f" |
eventData | Object | false | An object that specifies event data filtering conditions. Use this field to filter for only the events you want by specifying particular keys and values. Filtering is supported only for events whose data is in JSON object format, and values nested up to 3 levels deep can be entered. Filtering applies only when the entered key and value exactly match the event data. | {"sender": "0xcafe", "receiver": "0xface"} |
✅ How can the eventData Condition be used?
The "eventData" Condition serves as a filtering option for the custom data area within an Event object, enabling more fine-grained business logic implementation.
For example, when implementing a feature like a prize drawing that executes a random function, you can apply "eventType" filtering to the Event object generated during execution to determine whether the prize event fired. However, if you only want to receive events for winning users, you would need to implement separate filtering logic — adding unnecessary CU consumption and implementation overhead. In such cases, you can include the prize result in the
dataarea when defining and implementing the Event object, then set an "eventData" filter on the relevant key to receive Webhook messages only for winning users, enabling an efficient implementation.
That is correct. This event is included in all user transactions that consume gas.
Since there is no need to subscribe to it as a separate event, subscribing to the Transaction event type is recommended.
Yes. When the eventType is a "Module Event", always enter "0x0" for eventAccountAddress. If it is defined as an "Event-Handler Event", enter the address of the account that triggered the event. For more information on event types, refer to the Aptos official documentation.
Request Example
curl --location 'https://web3.nodit.io/v1/aptos/mainnet/webhooks' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: ••••••' \
--data '{
"eventType": "EVENT",
"description": "{WEBHOOK_DESCRIPTION}",
"notification": {
"webhookUrl": "{WEBHOOK_LISTENER_ENDPOINT}"
},
"condition": {
"eventType": "0x1::account::CoinRegisterEvent",
"eventAccountAddress": "0x84e6da2230d45f8e6e1e607fa304f92a2c0691cd85caa43c4920727547c5b07f"
}
}
'
Response Example
{
"subscriptionId": "5022",
"sequenceNumber": "1",
"description": "{WEBHOOK_DESCRIPTION}",
"protocol": "APTOS",
"network": "MAINNET",
"subscriptionType": "WEBHOOK",
"notification": {
"webhookUrl": "{WEBHOOK_LISTENER_ENDPOINT}"
},
"eventType": "EVENT",
"event": {
"eventType": "0x1::account::CoinRegisterEvent",
"eventAccountAddress": "0x84e6da2230d45f8e6e1e607fa304f92a2c0691cd85caa43c4920727547c5b07f",
"payloadFunction": null,
"messages": [
{
"guid": {
"creation_number": "0",
"account_address": "0x84e6da2230d45f8e6e1e607fa304f92a2c0691cd85caa43c4920727547c5b07f"
},
"sequence_number": "0",
"type": "0x1::account::CoinRegisterEvent",
"data": {
"type_info": {
"account_address": "0x1",
"module_name": "0x6170746f735f636f696e",
"struct_name": "0x4170746f73436f696e"
}
},
"event_index": 0,
"version": "2107915587"
}
]
},
"createdAt": "2024-12-27T09:07:09.341857113Z"
}