Track any smart contract with its events, and monitor any transaction events when on-chain interaction occurs.
Chain | Mainnet |
---|---|
Ethereum | ✅ |
Introduction
ZAN's Custom Contract Webhooks allow you to track any smart contract with its events, and monitor any transaction events when on-chain interaction occurs. This provides you with unlimited data access and quick insight into the self-defined activity you require. Developers can understand any contract-based event, and focus on some activities based on the ABI of the smart contract so that Web3 developers can get a quick insight into the blockchain data they need.
Example Response
While we cannot provide an exact example for each potential notification, here is one potential response that highlights the nested structure of each notification generated from on-chain events.
{
"id": "b1039dc23f5c470a8c78dc901d3d6c23",
"webhookId": "8cb7a0dd-4181-4484-81fe-5d4315b19a04",
"type": "CONTRACT",
"createdAt": "2023-09-02T01:10:39Z",
"event": {
"network": "eth-mainnet",
"activity": [
{
"category": "custom_contract",
"contractAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"transactionHash": "0xa63d915009f5d8de69aadbcae7287ebb268875cb91f390f44e16fa2528e74e0b",
"blockHash": "0x361282a1a7ce3d54bd9ca10880bf805f0d3e866d8b601b07c51fa533f5e9c3c8",
"blockNumber": 18045476,
"log": {
"blockNumber": 18045476,
"blockHash": "0x361282a1a7ce3d54bd9ca10880bf805f0d3e866d8b601b07c51fa533f5e9c3c8",
"transactionHash": "0xa63d915009f5d8de69aadbcae7287ebb268875cb91f390f44e16fa2528e74e0b",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"data": "0x00000000000000000000000000000000000000000000000000470de4df820000",
"logIndex": "0xea",
"remove": false,
"topics": [
"0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c",
"0x0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad"
],
"timestamp": 1693617035
}
}
]
}
Field Definitions
Below you can find descriptions for each field of the response.
Field | Description | Value |
---|---|---|
id | ID of the event. | b1039dc23f5c470a8c78dc901d3d6c23 |
webhookId | Unique ID of the webhook destination. | 8cb7a0dd-4181-4484-81fe-5d4315b19a04 |
type | Webhook event type. | CONTRACT |
createdAt | Timestamp when the event notification was created. | 2023-09-02T01:10:39Z |
event | Activity object. | N/A |
network | The default network for the webhook. | eth-mainnet |
activity | List of transfer events whose from or to address matches the address configured in the Custom Contract Activity webhook. | N/A |
category | The data standard. | custom_contract |
contractAddress | The contract address. | 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 |
transactionHash | Transaction hash. | 0xa63d915009f5d8de69aadbcae7287ebb268875cb91f390f44e16fa2528e74e0b |
blockHash | The hash of the block that contains the transaction. | 0x361282a1a7ce3d54bd9ca10880bf805f0d3e866d8b601b07c51fa533f5e9c3c8 |
blockNumber | The number of the block that contains the transaction. | 18045476 |
log | Returned log of the custom contract Activity event. | N/A |
blockNumber | The number of the block including this transaction. | 18045476 |
blockHash | A hash of the block including this transaction. | 0x361282a1a7ce3d54bd9ca10880bf805f0d3e866d8b601b07c51fa533f5e9c3c8 |
transactionHash | Transaction hash. | 0xa63d915009f5d8de69aadbcae7287ebb268875cb91f390f44e16fa2528e74e0b |
address | Original address of the log. | 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 |
data | Non-indexed arguments of the log. | 0x00000000000000000000000000000000000000000000000000470de4df820000 |
logIndex | ID of the event. | 0xea |
removed | Transaction is in a chain re-org tag. | false |
topics | An array of zero to four 32 bytes of indexed log arguments. | ["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", "0x0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad"] |
timestamp | Block time. | 1693617035 |
How to Set Up Custom Contract Webhooks
- Navigate to the Webhook tab in your ZAN Dashboard.
- Click the Create New button.
- Set a name of the webhook. Then Contract template in the dropdown.
- Select your Chain in the dropdown. Then choose your Network.
- Paste your contract address into the Contract Address field. Then upload ABI or get ABI of the contract.
- Paste your unique webhook URL into the WEBHOOK URL field.
- Select all contract 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 custom contract webhooks, please refer to Create a New Webhook.