Get real-time state changes when an address sends/receives ETH or tokens that you track using the Address Activity webhook.
| Chain | Mainnet | 
|---|---|
| Ethereum | ✅ | 
Introduction
The Address Activity webhook allows you to track any address like EOA or smart contracts. This provides your app with real-time state changes when a token is transferred between addresses, like ETH, ERC20, ERC721 or ERC1155 transfers.
Types of transfers
There are four main types of transfers that occur on the chain between addresses.
| Transfer type | Description | 
|---|---|
| external native coin(ETH) | Top-level transaction transfers. | 
| internal native coin(ETH) | Internal Transfers between addresses. | 
| token | Event logs for ERC20. | 
| erc721 or erc1155 | Event logs for ERC721 and ERC1155 transfers. | 
Example Response
When a provided address (EOA or smart contracts) exists in a transaction, and you may get its assert transfers or relatived transaction, you receive a response from the webhook that looks like this:
{
    "id": "64a636ed247148b19b4ac1d4937b19ba",
    "webhookId": "804ad91e-3400-4462-b9f5-afe8b78ea706",
    "type": "ADDRESS",
    "createdAt": "2023-08-30T11:57:50Z",
    "event": {
        "network": "eth-mainnet",
        "activity": [
            {
                "category": "internal",
                "fromAddress": "0xb67cb505324830dd181498b5b1c8ff7ffe6a49c44f1f02eda1a5214dce56f538",
                "toAddress": "0x1635d18f20c9a6e302931faf61643fed57fbcce3",
                "internalTransaction": {
                    "blockNumber": 18027262,
                    "blockHash": "0x8ab7fa9f37fb3cb19bc6fe43cbc288d64430543fac0325788f3f9638a4982049",
                    "hash": "0xb67cb505324830dd181498b5b1c8ff7ffe6a49c44f1f02eda1a5214dce56f538",
                    "from": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
                    "to": "0x1635d18f20c9a6e302931faf61643fed57fbcce3",
                    "input": "0x0902f1ac",
                    "output": "0x0000000000000000000000000000000000000000011b0698ff86e0cecbd5f79100000000000000000000000000000000000000000000000ab82aa8fdac122db10000000000000000000000000000000000000000000000000000000064ef2e07",
                    "gas": "0x1cfb2",
                    "gasUsed": "0x9c8",
                    "type": "STATICCALL",
                    "value": null,
                    "error": null,
                    "revertReason": null,
                    "callLayer": 6,
                    "callStack": 2,
                    "success": true,
                    "revert": false
                }
            },
            {
                "category": "internal",
                "fromAddress": "0xb67cb505324830dd181498b5b1c8ff7ffe6a49c44f1f02eda1a5214dce56f538",
                "toAddress": "0x1635d18f20c9a6e302931faf61643fed57fbcce3",
                "internalTransaction": {
                    "blockNumber": 18027262,
                    "blockHash": "0x8ab7fa9f37fb3cb19bc6fe43cbc288d64430543fac0325788f3f9638a4982049",
                    "hash": "0xb67cb505324830dd181498b5b1c8ff7ffe6a49c44f1f02eda1a5214dce56f538",
                    "from": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
                    "to": "0x1635d18f20c9a6e302931faf61643fed57fbcce3",
                    "input": "0x022c0d9f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cca430ef8fb80b0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000",
                    "output": null,
                    "gas": "0x1bb3b",
                    "gasUsed": "0xece2",
                    "type": "CALL",
                    "value": "0x0",
                    "error": null,
                    "revertReason": null,
                    "callLayer": 9,
                    "callStack": 2,
                    "success": true,
                    "revert": false
                }
            }
        ]
    }
}
Field Definitions
Below you can find descriptions for each field of the response.
| Field | Description | Value | 
|---|---|---|
| id | ID of the event. | 64a636ed247148b19b4ac1d4937b19ba | 
| webhookId | Unique ID of the webhook destination. | 804ad91e-3400-4462-b9f5-afe8b78ea706 | 
| type | Webhook event type. | ADDRESS | 
| createdAt | Timestamp when the event notification was created. | 2023-08-30T11:57:50Z | 
| event | Activity object. | N/A | 
| network | The default network for the webhook. | eth-mainnet | 
| activity | List of transfer events whose fromortoaddress matches the address configured in the Address Activity webhook. | N/A | 
| category | The data standard. | internal | 
| fromAddress | Transfer from address. | 0xb67cb505324830dd181498b5b1c8ff7ffe6a49c44f1f02eda1a5214dce56f538 | 
| toAddress | Transfer to address. | 0x1635d18f20c9a6e302931faf61643fed57fbcce3 | 
| internalTransaction | Internal Transactions that coin transfers between addresses. | N/A | 
| blockNumber | The number of the block including this transaction. | 18027262 | 
| blockHash | A hash of the block including this transaction. | 0x8ab7fa9f37fb3cb19bc6fe43cbc288d64430543fac0325788f3f9638a4982049 | 
| hash | Transaction hash. | 0xb67cb505324830dd181498b5b1c8ff7ffe6a49c44f1f02eda1a5214dce56f538 | 
| from | The address of the sender. | 0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad | 
| to | The address of the receiver. | 0x1635d18f20c9a6e302931faf61643fed57fbcce3 | 
| input | The data is sent along with the transaction. | 0x022c0d9f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cca430ef8fb80b0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000 | 
| output | The transaction output. | null | 
| gas | Gas provided by the sender. | 0x1bb3b | 
| gasUsed | The amount of gas used by this specific transaction alone. | 0xece2 | 
| type | Call type of the transaction. | CALL | 
| value | Asset transfer value. | 0x0 | 
| error | Error message. | null | 
| revertReason | The revert reason | null | 
| callLayer | The layer of this internal tx(start from 1). | 9 | 
| callStack | The stack of this internal tx(start from 1). | 2 | 
| success | Either true (success) or false (failure) | true | 
| rever | Either true (revet) or false (not revert) | false | 
How to Set Up Address Activity Webhook
- Navigate to the Webhook tab in your ZAN Dashboard.
- Click the Create New button.
- Set a name of the webhook. Then Address template in the dropdown.
- Select your Chain in the dropdown. Then choose your Network.
- Paste your unique webhook URL into the WEBHOOK URL field.
- Add your Address,both single addition and batch addition are supported.
- Select all address events that you need to get notifications in Event dropdown.
- Test your webhook by clicking the TEST button.
- After the test is successful, click Confirm. Your webhook appears in the list.
- Check your endpoint to see the responses.
Note:
For more detailed steps on how to set up address activity webhooks, please refer to Create a New Webhook.
