Skip to main content

LOG


Supported Network

Network

Supporting

Ethereum Mainnet

Ethereum Testnet (sepolia)

Ethereum Testnet (holesky)

Polygon Mainnet

Polygon Testnet (amoy)

Arbitrum Mainnet

Arbitrum Testnet (sepolia)

Optimism Mainnet

Optimism Testnet (sepolia)

Kaia Mainnet

Kaia Testnet (kairos)

Aptos Mainnet

Aptos Testnet



Conditions

When eventType is set to LOG, the available condition object fields are as follows.

Key

Type

Description

Required

Example Value

address

String

Contract address where the events you want to monitor are defined

true

0xdAC17F958D2ee523a2206206994597C13D831ec7

topics[4]

Array of String

Array of topics for the event logs to monitor. You can include up to 4 strings.

true

["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000b7aa2d3c833a6827c4f39bef9622d7cddf66b7e7",
"0x0000000000000000000000003264039cfaa37a70a0e8ccfbf4b7e60bedce5c9f"]

When using the topics field

For address-type data in event signatures, use hex format, not decoded format.

I want to monitor specific event logs. What should I put in the topic field?

The topic field filters data associated with smart contract events. Each topic contains the event signature and indexed parameter information.

topics[0]: Event signature

  • topics[0] is always the Keccak256 hash of the event signature.
    For example, for Transfer(address indexed from, address indexed to, uint256 value), the signature can be obtained with:
    Keccak256("Transfer(address,address,uint256)")
    = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef

topics[1], topics[2], topics[3]: Indexed parameters

  • topics[1] onward correspond to the event’s indexed parameter values. Only parameters declared with the indexed keyword in the contract are included. In the Transfer example, the from address is topics[1] and the to address is topics[2]. To filter only events where from is a specific address, set topics[1] to that address. Non-indexed parameters are in the log’s data field.

How to find topic values

  • From contract code: Check the event definition in Solidity, identify indexed parameters and the event signature, then use Keccak256 hashing to get the topic values.
  • From a block explorer: Pick a sample transaction you want to track, open its details, and check the "Logs" (or similar) section for topic values. The image below shows an example of viewing USDC (ERC20) Transfer logs on Etherscan.

Response Example

subscription_connected The user(8350954814192461336) is connected. 
registered messageId: 123,
subscriptionId: 5096
subscription Event : subscriptionId: 5096,
eventType: LOG,
event: {
"targetAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
],
"messages": [
{
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000009696f59e4d72e237be84ffd425dcad154bf96976",
"0x000000000000000000000000586197da4971fadf8604b8fd81f2a576032402d2"
],
"data": "0x0000000000000000000000000000000000000000000000000000009e52bdc040",
"block_number": 21570934,
"transaction_hash": "0x905de51ac1f611942343d1a4b9b913bd392b5b3bcb100f22167ef2670a36df18",
"transaction_index": 10,
"log_index": 22,
"block_hash": "0xc3f7d16da3dd3649e20dfec4346b2a967f9ff369b770d1e1f979fbe58e77e8ce",
"block_timestamp": 1736232887,
"removed": false,
"type": "log"
}
]
}