API Reference

Token Activity Webhook

Get real-time updates when an ERC20 token is transferred.

ChainMainnet
Ethereum

Introduction

The Token Activity webhook allows you to track ERC20 token contracts. This provides your app with real-time state changes when a token is transferred between addresses.

Example Response

When a token (ERC20) from the token contracts that you are tracking gets transferred, you receive a response from the webhook that looks like this:

{
    "id": "22bd25c3707b47f080779769db051f51",
    "webhookId": "f0e0cedb-3d41-481d-ad1d-688f5856563b",
    "type": "TOKEN",
    "createdAt": "2023-09-10T13:36:39Z",
    "event": {
        "network": "eth-mainnet",
        "activity": [
            {
                "category": "erc20",
                "fromAddress": "0xfc20411184af8888b353b5ae7a214e0f2df13256",
                "toAddress": "0x24b6b95dd1aea292903fbe88c7e1cb863e18b84a",
                "amount": "147797700",
                "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                "log": {
                    "blockNumber": 18106314,
                    "blockHash": "0x0e0f53cc93b92048cc52df57f775ccd9a86c74a264a76cc94707342a16e99520",
                    "transactionHash": "0x4ba02061e536ce80e20c6c42de25dad8b9a775571707a58bffa5862ce310c684",
                    "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                    "data": "0x0000000000000000000000000000000000000000000000000000000008cf36c4",
                    "logIndex": "0xec",
                    "remove": false,
                    "topics": [
                        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                        "0x000000000000000000000000fc20411184af8888b353b5ae7a214e0f2df13256",
                        "0x00000000000000000000000024b6b95dd1aea292903fbe88c7e1cb863e18b84a"
                    ],
                    "timestamp": 1694352995
                }
            }
        ]
    }
}

Field Definitions

Below you can find descriptions for each field of the response.

FieldDescriptionValue
idID of the event.22bd25c3707b47f080779769db051f51
webhookIdUnique ID of the webhook destination.f0e0cedb-3d41-481d-ad1d-688f5856563b
typeWebhook event type.TOKEN
createdAtTimestamp when the event notification was created.2023-09-10T13:36:39Z
eventActivity object.N/A
networkThe default network for the webhook.eth-mainnet
activityList of transfer events whose from or to address matches the address configured in the Token Activity webhook.N/A
categoryThe erc-20 data standard.erc20
fromAddressTransfer from address.0xfc20411184af8888b353b5ae7a214e0f2df13256
toAddressTransfer to address.0x24b6b95dd1aea292903fbe88c7e1cb863e18b84a
amountTransferred value amount.147797700
tokenAddressThe erc20 contract address.0xdac17f958d2ee523a2206206994597c13d831ec7
logReturned log of the Token Activity event.N/A
blockNumberThe number of the block including this transaction.18106314
blockHashA hash of the block including this transaction.0x4887f8bfbba48b7bff0362c34149d76783feae32f29bff3d98c841bc2ba1902f
transactionHashTransaction block number.0x4ba02061e536ce80e20c6c42de25dad8b9a775571707a58bffa5862ce310c684
addressLog origination address.0xdac17f958d2ee523a2206206994597c13d831ec7
dataNon-indexed arguments of the log.0x0000000000000000000000000000000000000000000000000000000008cf36c4...
logIndexID of the event.0xec
removedTransaction is in a chain re-org tag.false
topicsAn array of zero to four 32 bytes of indexed log arguments.["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000fc20411184af8888b353b5ae7a214e0f2df13256", "0x00000000000000000000000024b6b95dd1aea292903fbe88c7e1cb863e18b84a"]
timestampBlock time.1694352995

How to Set Up Token Activity Webhooks

  1. Navigate to the Webhook tab in your ZAN Dashboard.
  2. Click the Create New button.
  3. Set a name of the webhook. Then Token template in the dropdown.
  4. Select your Chain in the dropdown. Then choose your Network.
  5. Paste your token contract address into the Contract Address field.
  6. Paste your unique webhook URL into the WEBHOOK URL field.
  7. Select all address events that you need to get notifications in Event dropdown.
  8. Test your webhook by clicking the TEST button.
  9. After the test is successful, click Confirm. Your webhook appears in the list.
  10. Check your endpoint to see the responses.

📘

Note:

For more detailed steps on how to set up token activity webhooks, please refer to Create a New Webhook.