Skip to main content

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. This field is entered in the format "module_address::module_name::event_name".

"0x1::account::CoinRegisterEvent"

eventAccountAddress

String

true

The address that emits the event to monitor

"0x84e6da2230d45f8e6e1e607fa304f92a2c0691cd85caa43c4920727547c5b07f"

eventData

Object

false

An object that specifies filtering conditions for event data. By using this field, you can specify particular keys and values to filter only the events you want. Filtering is only supported for events that include data in JSON object format, and you can enter values up to 3 levels of nesting. Filtering only applies when the entered key and value exactly match the event data.

{"sender": "0xcafe", "receiver": "0xface"}

How can I use the eventData Condition?

The "eventData" Condition can be used as a filtering option for the data area that can be customized inside the Event object, enabling more granular business logic implementation.

For example, when implementing a feature such as a prize draw by executing a random function, you can apply "eventType" filtering to the Event object generated during execution to know whether the prize draw event has been triggered. However, if you only want to receive Events for users who have won, you would need to implement separate filtering logic, which can result in unnecessary CU consumption and implementation overhead. In such cases, by including the winning result in the data area when defining and implementing the Event object, and then additionally setting an "eventData" filter for the relevant key, you can effectively receive only Webhook messages for users who have won.

Can 0x1::transaction\_fee::FeeStatement be used in eventType?

No, this event is included in every user transaction that consumes gas fees.
Therefore, there is no need to subscribe to it as a separate event, and it is recommended to subscribe to Transaction events instead.

When it is a Module Event, do I have to enter eventAccountAddress as 0x0?

Yes. When the eventType is a "Module Event", you must enter "0x0" for eventAccountAddress. If it is defined as an "Event-Handler Event", you can enter the account address that emitted the event. For more details about event types, please 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"
}