Quickstart

Learn how to create your first contract monitor and receive webhook notifications.


In this quickstart, you'll set up contract monitoring to track activity on a Stacks smart contract and receive real-time webhook notifications when specific events occur.

Prerequisites

  • A Hiro Platform account (free) - Sign up here
  • A webhook endpoint URL (HTTPS) - You can use webhook.site for testing
  • A Stacks contract address to monitor

Getting started

Contract monitoring is available to all Hiro Platform users. To create your first monitor:

  1. 1Sign in to the Hiro Platform
  2. 2Navigate to the Contract Monitoring section
  3. 3Click "Create Monitor" and enter your contract address
  4. 4Configure your webhook endpoint
  5. 5Select the events you want to monitor

How it works

Contract monitoring uses the Stacks Blockchain API to track on-chain events:

When transactions interact with your monitored contracts, the Platform evaluates them against your configured filters and sends matching events to your webhook endpoint in real-time.

Verify it's working

To test your monitor, interact with the contract you're monitoring. For example, if monitoring a token contract, try transferring tokens:

(contract-call? .monitored-token transfer u100 tx-sender 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE)

You should receive a webhook payload within seconds:

{
"monitor_id": "mon_abc123def456",
"contract_id": "SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR.arkadiko-dao",
"event": {
"type": "contract_call",
"function": "transfer",
"args": {
"amount": "100",
"sender": "SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR",
"recipient": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE"
}
},
"block_height": 98765,
"timestamp": "2024-01-15T10:30:45Z"
}

Next steps