TRANSACTION(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 eventType is set to TRANSACTION, the available condition object fields are as follows.
Key | Type | Required | Description | Example Value |
|---|---|---|---|---|
payloadFunction | String | conditional true | The function to monitor. Use the format "module_address::module_name::function_name". | "0x1::aptos_account::transfer" |
eventType | String | conditional true | The event type to monitor. This is the name of the event struct defined in the module. Use the format "module_address::module_name::event_name". | "0x8afb046f44dd0cb9c445458f9c2e424759cd11f4a270fe6739dcffc16a4db8e::slime_revolution_game::RandomEvent" |
eventAccountAddress | String | conditional true | The address that emits the events you want to monitor. | "0x0" |
eventData | Object | false | Object that specifies filter conditions on event data. You can filter events by key-value pairs. Supported only for events whose data is a JSON object; up to 3 levels of nesting. Only events that exactly match the keys and values are returned. | {"sender": "0xcafe", "receiver": "0xface"} |
The "eventData" condition lets you filter on the custom data inside Event objects, so you can implement finer-grained logic.
For example, for a feature that runs a random function (e.g. a prize draw), you can use "eventType" to know when the prize event ran. If you only want webhooks for the winning user, you could add custom filtering in your app, but that can waste CU and add complexity. Instead, include the result in the event's data when you define and emit the Event, then set an "eventData" filter on that key so you only receive webhooks for the winning user.
- When payloadFunction is set
- You may set eventType and eventAccountAddress both together, or omit both. You cannot set only one of them.
- When payloadFunction is not set
- You must set both eventType and eventAccountAddress.
- You cannot set only one of them.
Request Example
curl --location 'https://web3.nodit.io/v1/aptos/mainnet/webhooks' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: ••••••' \
--data '{
"eventType": "TRANSACTION",
"description": "{WEBHOOK_DESCRIPTION}",
"notification": {
"webhookUrl": "{WEBHOOK_LISTENER_ENDPOINT}"
},
"condition": {
"eventType": "0x8afb046f44dd0cb9c445458f9c2e424759cd11f4a270fe6739dcffc16a4db8e::slime_revolution_game::RandomEvent",
"eventAccountAddress": "0x0"
}
}'
Response Example
{
"subscriptionId": "5022",
"sequenceNumber": "1",
"description": "{WEBHOOK_DESCRIPTION}",
"protocol": "APTOS",
"network": "MAINNET",
"subscriptionType": "WEBHOOK",
"notification": {
"webhookUrl": "{WEBHOOK_LISTENER_ENDPOINT}"
},
"eventType": "TRANSACTION",
"event": {
"eventType": "0x8afb046f44dd0cb9c445458f9c2e424759cd11f4a270fe6739dcffc16a4db8e::slime_revolution_game::RandomEvent",
"eventAccountAddress": "0x0",
"payloadFunction": null,
"messages": [
{
"version": "2107923123",
"hash": "0x031eb21cc010f612fcb37f5da2b5c1b95dbf9073d7fcae767e1e597105468a61",
"state_change_hash": "0xb6400de9395a8694af27027893336428a0eb78da6f7efe5d56d76e608b4a060e",
"event_root_hash": "0xfe78206fa7fce56cf879843b53003379cef2c4e7b48f0c84a092001d7bcbd04f",
"state_checkpoint_hash": null,
"gas_used": "4",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x01714c68e180ce6ea95279791a07cee4ce5bc2eecee6e046b01f1f8b7cdbc7f7",
"timestamp": "1735290278305653",
"type": "user_transaction",
"events": [
{
"guid": {
"creation_number": "0",
"account_address": "0x0"
},
"sequence_number": "0",
"type": "0x8afb046f44dd0cb9c445458f9c2e424759cd11f4a270fe6739dcffc16a4db8e::slime_revolution_game::RandomEvent",
"data": {
"random_number": "5653"
}
},
{
"guid": {
"creation_number": "0",
"account_address": "0x0"
},
"sequence_number": "0",
"type": "0x1::transaction_fee::FeeStatement",
"data": {
"execution_gas_units": "3",
"io_gas_units": "1",
"storage_fee_octas": "0",
"storage_fee_refund_octas": "0",
"total_charge_gas_units": "4"
}
}
],
"sender": "0x5f09bb76b55ad9f0c680eb42912565bbea6825d873f1403d1d3eddbbeb1e6ed8",
"sequence_number": "454",
"max_gas_amount": "10",
"gas_unit_price": "100",
"expiration_timestamp_secs": "1735290296",
"payload": {
"type": "entry_function_payload",
"function": "0x8afb046f44dd0cb9c445458f9c2e424759cd11f4a270fe6739dcffc16a4db8e::slime_revolution_game::slime_revolution_spin",
"type_arguments": [],
"arguments": []
},
"signature": {
"public_key": "0x1f2d3845bfd979ce4209a27f7c02a25927417cf9737e4fbff750b9e5888ae4f0",
"signature": "0xd6fcdc6d64f3663e39a44cf316f0269fbf690f8e77a1e2d5c3a94c4961c169bc18a99b7be753e645799420d631c8ff27884a2523fc2344f5005a6a6e0cfbbd0d",
"type": "ed25519_signature"
}
}
]
},
"createdAt": "2024-12-27T09:11:20.200452151Z"
}