Contract activity monitor example
Stream real-time smart contract activity (event emissions and function calls) to your app database
Last updated
Stream real-time smart contract activity (event emissions and function calls) to your app database
Last updated
Getting specific, relevant smart contract activity to power your apps and dApps is easy and fast using the Dispatch UI.
In this example, we'll walk through creating a Patch that will send new EventClaim
events & associated event data from the Galxe Space Station 3 smart contract on Polygon to a webhook URL.
Trigger: Smart contract event emissions
Action: Send a JSON payload to a webhook URL
From anywhere in Dispatch, click the "Create" button in the top navigation bar:
This takes you to the Patch Creator.
From the "Choose a Trigger event" dropdown, select the "Smart contract events emitted" Trigger.
Click the "Set Trigger conditions" button.
This step will vary depending on which Trigger you selected.
For the smart contract event monitor Trigger, start by selecting the network your smart contract is on.
Time saving tip
Dispatch comes loaded with some contracts for popular tokens, NFTs, and projects.
Depending on your use case, you might be able to save some time by searching for the contract you want to monitor and see if it's already in Dispatch.
Click "Add a smart contract" to add the smart contract you want to get activity from.
In the Contract address field, paste the address of the contract you want to monitor.
Add a nickname for the contract.
Sometimes contracts have names that aren't easy to distinguish from others, like "TransparentProxy" or "ERC1155", so it's helpful to add a descriptive name to make your life easier later.
Press the "Find events" button:
Select the events and/or functions you want to get alerts & data for or use to trigger workflows with by checking the boxes next to the event names.
Press the "Continue" button.
Click the Application dropdown to select where you want the smart contract events, functions & related data to go.
We'll search for "webhook":
Choose the webhook you want to receive the selected smart contract events, functions & associated data.
Optionally, you can send a test JSON payload to your selected webhook by selecting the "Send a test JSON payload" button.
Note: You can test all Actions except for Dispatch Monitor, which logs events directly in Dispatch.
Customizing the Patch name is optional; Dispatch adds a default Patch name for you to save time.
Here's you chance to double check your Trigger and Action details. If all looks right...
Press the "Turn Patch on" button.
At this point, you can either create another Patch, or press the "View Patches" button to see your newly created Patch in the Patches Overview page, and wait for events to come in 🚀