Skip to main content

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 setting the eventType value to TRANSACTION, the available condition object fields are as follows.

Key

Type

Required

Description

Example Value

payloadFunction

String

conditional true

The function to monitor. Enter this field in the format "module_address::module_name::function_name".

"0x1::aptos_account::transfer"

eventType

String

conditional 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".

"0x8afb046f44dd0cb9c445458f9c2e424759cd11f4a270fe6739dcffc16a4db8e::slime_revolution_game::RandomEvent"

eventAccountAddress

String

conditional true

The address that triggers the event you want to monitor.

"0x0"

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"}

:::success 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 data area 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. :::

How to use the condition object fields
  1. When entering payloadFunction:
    • You may enter both eventType and eventAccountAddress simultaneously, or enter neither.
    • Entering only one of eventType or eventAccountAddress is not allowed.
  2. When not entering payloadFunction:
    • You must enter both eventType and eventAccountAddress.
    • Entering only one of eventType or eventAccountAddress is not allowed.

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"
}