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 listed below.
Key | Type | Description | Required | Example Value |
|---|---|---|---|---|
address | String | Contract address where the event to monitor is defined. | true | 0xdAC17F958D2ee523a2206206994597C13D831ec7 |
topics[4] | Array of String | Topic array object for the event log to monitor. Can contain up to 4 strings. | true | ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", |
When entering data of the Address type in an event signature, the value must be provided in Hex Format, not decoded format.
The Topic field for the event you want to monitor is used to filter data associated with smart contract events. Each topic contains the event signature and indexed parameter information for the event.
topics[0]: Event Signature
- topics[0] is always the Keccak256 hash of the event signature.
For example, for theTransfer(address indexed from, address indexed to, uint256 value)event, the event signature can be obtained by running the following:
Keccak256("Transfer(address,address,uint256)")
= 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
topics[1], topics[2], topics[3]: Indexed Parameters
- Starting from topics[1], each entry corresponds to an indexed parameter value of the event. Only event parameters declared with the
indexedkeyword in the smart contract are included in the topics. For the Transfer event above, the from address corresponds to topics[1] and the to address corresponds to topics[2]. To filter only events where a specific address appears as the from address, enter that address value in topics[1]. The remaining non-indexed parameters can be found in thedatafield of the retrieved log.
How to find Topic values
- From the smart contract code: Identify the event definition in the Solidity code, locate the indexed parameters and event signature, then compute the topic value using Keccak256 hashing.
- Using a block explorer: Select a sample transaction to trace, navigate to the transaction detail, and find the topic values in the "Logs" section. Below is an example screen from Etherscan (https://etherscan.io) showing the log for a USDC (ERC20) Transfer event.
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"
}
]
}