# Documentation

Welcome! Here's where you'll find guides, resources, and references for building Web3 projects with Esprezzo.

[**Esprezzo**](https://esprezzo.io) is a multi-chain platform that connects Web3 and Web2 systems to bring next gen experiences to life.

Whether you're a developer, product owner, marketer, or analyst, Esprezzo's tools can save your team time.

Our first product is [**Dispatch**](https://dispatch.esprezzo.io), the easiest way to get real-time data for smart contracts and wallet activity.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FNX8DndamiFNjXBARg25d%2FEsprezzo%20Dispatch%20Patch%20-%20Layer3%20Lootbox%20opens%20to%20Webhook%402x.jpg?alt=media&amp;token=0718da40-94ad-428d-9e8a-3f0184ff4d36" alt=""><figcaption></figcaption></figure>


# What is Dispatch?

Dispatch is the easiest way to get real-time insights into smart contract and wallet activity.

{% hint style="info" %}
**New**: Go beyond real-time alerts with [smart contract activity visualizations](/introduction/smart-contract-visualization) over time
{% endhint %}

Similar to subgraphs, Dispatch makes it easy to set up listening for specific activity and interactions with contracts and wallets on the top EVM chains — without having to write any code.

Whether you want to stream on-chain activity to your apps and dApps through webhooks, get notifications for certain activity, use on-chain activity to trigger automated workflows, or visualize smart contract activity over time, Dispatch can help you do it faster.

No GraphQL or SQL required, thanks to our easy-to-use Dispatch web app.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FqWYlOICHwbOIUsZiOVQr%2FEsprezzo%20Dispatch%20Dec2023%20-%20Dark%20circle.jpg?alt=media&amp;token=f347e49e-6f80-41a8-b0ce-df906fe4fbad" alt="Esprezzo Dispatch diagram showing trigger data sources and potential actions for alerts and automation"><figcaption></figcaption></figure>

**Dispatch can help you...**

* Respond to rapidly changing market conditions
* Investigate potential security issues
* Get insights into how your community and customers are interacting with your contracts and projects
* Visualize trends in smart contract activity
* Automatically keep your team in sync with launch, drop, claim, and redemption activity
* Power internal dashboards and external leaderboards

With a few clicks, you can easily automate monitoring for real-time on-chain crypto, DeFi, NFT, token, transfer, and wallet activity, and send that data wherever you need it; whether it's a messaging program you already use with your team or community, a database for your app, or other destination.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FbDr7MrZSqXo1PmmhfgGs%2FEsprezzo%20Dispatch%20smart%20contract%20data%20visualization%20charts%402x.jpg?alt=media&amp;token=e10bd322-a142-49aa-96e7-8824400c6963" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
➡️  Dispatch no-code web app is free to use and doesn't require a credit card to get started.&#x20;

[**Sign up for free**](https://dispatch.esprezzo.io/signup)
{% endhint %}

🖥  Interested in programmatic access via API? [**Waitlist is open**](https://esprezzo.io/developers)

## Use cases

With an intuitive, easy no-code UI, Dispatch enables data to flow automatically and transparently across your product, team, and communities in just a few clicks — keeping internal and external parties in sync, and your user base engaged.

* **Security**: Automatically notify team members when unexpected permissions changes, proxy upgrades, or other events are initiated in your contracts
* **Gaming**: Power dynamic Web3 game interfaces and leaderboards with the freshest user data
* **Community**: Keep your community engaged by auto-posting to an alert or activity channel in your Discord server for key activity like claims, mints, artwork reveals, quest completions and more
* **Phygital**: Easily connect the physical and digital worlds through real-time tracking of physical goods, NFT redemptions and forges
* **Brands**: Track real-time user engagement across your in-store, next gen IRL experiences & loyalty programs

## Key Concepts

### Triggers

A Trigger is an event you want Dispatch to listen for.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2F4VQDg4TowqpcRe37LvQw%2FEsprezzo%20Dispatch%20Patch%20Trigger%20examples%20-%20Dec2023%402x.jpg?alt=media&amp;token=2a39b6bf-40d5-4bd2-ab8f-ecc52dd41803" alt="Examples of Esprezzo Dispatch Patch Trigger events from smart contracts for Uniswap, Sofa Maker, and friend.tech"><figcaption><p>Dispatch Trigger examples</p></figcaption></figure>

*Some Trigger examples:*

* When specific events are emitted by smart contracts
* When certain smart contract functions are called
* When the balance of a specific token in a wallet changes
* When a token balance goes above or below a certain threshold

### Actions

An Action is what happens (what Dispatch does) when your Trigger conditions are met.

*Some examples of Actions:*

* Send an email
* Send a Telegram message
* Post in a Discord server channel
* Send a JSON payload to a webhook URL
* Log events to [Dispatch Monitor](https://dispatch.esprezzo.io/monitor)

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FisPAqCVOKHeXQCzG9v9M%2FEsprezzo%20Dispatch%20Patch%20Action%20examples%20-%20v1.jpg?alt=media&amp;token=51fe47a2-4481-409b-a306-22d1b5f74679" alt="Examples of Esprezzo Dispatch Patch Actions including sending events to a database via webhook and sending messages to Discord and Telegram"><figcaption><p>Dispatch Action examples</p></figcaption></figure>

### Patches

In Dispatch, data streams, automations and alerts are called **Patches.**

Each Patch, consists of a Trigger and an Action.

Patches "fire" when Trigger conditions are met — meaning Dispatch performs the "Action", sending the Trigger's event data to the channel you've chosen.

*Sample Patches:*

* Send newly registered Ethereum Name Service names to my database via webhook
* Send new Uniswap pool creations to my DEX dashboard via webhook
* Send me an email when the team wallet's ETH balance falls below 2 ETH
* Post in my project's Discord server when NFTs from a new drop are forged or minted

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2Fp6ouDhiZGVUJ6R643PHa%2FWhat%20is%20a%20Patch%20July%202024%402x.jpg?alt=media&amp;token=4dedafb3-6126-4ba8-ba73-814106da7f27" alt=""><figcaption></figcaption></figure>

## Supported networks

Dispatch currently supports event monitoring of verified smart contracts on these networks:

* Arbitrum
* Base
* Ethereum
* Optimism
* Polygon


# Dispatch pricing

## Plans

We currently offer 3 plans:

| Free                        | Starter                 | Pro                    |
| --------------------------- | ----------------------- | ---------------------- |
| $0, no credit card required | $10 / month             | $49 / month            |
| 100 Actions / month         | 250 Actions / month     | 2,500 Actions / month  |
| 7 days of historical data   | 30 days historical data | 1 year historical data |
| Standard support            | Standard support        | Priority support       |

### Pay per Action

If you need more monthly Actions, the Pay per Action add-on may be right for you.

If you do NOT have Pay per Action activated, all your Patches will pause when you hit your monthly Actions limit. You'll be able to create new Patches, but you won't be able to turn them on until your usage/billing cycle restarts.

When you have Pay per Action activated, your Patches will continue running and you'll be able to create new Patches even if you hit your Action limit. You'll pay $0.02 per Action over your monthly limit, automatically charged after your billing cycle ends.

{% hint style="warning" %}
Pay per Action is only available as an add-on for paid plans (Starter or Pro)
{% endhint %}

Ready to get started? [**Sign up for free**](https://dispatch.esprezzo.io/signup)


# Quickstart

There are two ways to get real-time smart contract or wallet activity data with the [Dispatch](https://dispatch.esprezzo.io/) web app:

1. Select apps & alerting methods we natively support (email, Telegram, Discord)
2. Use webhooks — for other apps and services

Both require a Dispatch account and using the UI in a web browser to configure.

## Create your first Patch

All you need to start getting on-chain data from Dispatch is an account and at least one Patch.

{% hint style="info" %}
Don't have a Dispatch account yet? [**Sign up for free**](https://dispatch.esprezzo.io/signup)
{% endhint %}

A Patch consists of a Trigger event and a result Action (what you want to happen once the Trigger event occurs).

Once you have a Dispatch account, you can&#x20;

* Stream on-chain activity data to wherever you need it
* Get data and alerts for smart contract activity
* Get data and alerts for balance changes & balance threshold crossings
* Use balance changes, smart contract event emissions and function calls to trigger emails, Discord or Telegram messages, and custom workflows via webhook

### **Step 1: Log in**

[Log in](https://dispatch.esprezzo.io/login) to your Dispatch account. For the best experience we recommend using a computer rather than a mobile device.

### Step 2: Select a Trigger

Select a Trigger from the dropdown in the [Dashboard](https://dispatch.esprezzo.io/dashboard):

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FBGjRhtrUIPO5Jhuc1Aob%2Fesprezzo-dispatch-choose-smart-contract-event-trigger.gif?alt=media&amp;token=0d1c058e-9273-4f5e-a183-3ac9cf91bf45" alt="Choosing a Patch smart contract event monitor Trigger from Esprezzo dashboard"><figcaption></figcaption></figure>

### Step 3: Select an Action

Select an Action from the dropdown in the Dashboard:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FPCDwnWcB67Vq70UaYx9b%2Fesprezzo-dispatch-choose-webhook-action.gif?alt=media&amp;token=fdbb4c17-b506-4653-904a-10ae518764ef" alt="Choosing a Patch webhook Action from Esprezzo dashboard"><figcaption></figcaption></figure>

### Next: Configure Trigger & Action settings

Add details for your Trigger and Action.

Trigger details might include

* Address and network of the smart contract or wallet you want to analyze or manage
* Specific tokens, or smart contract events or functions&#x20;

Action details might include

* A webhook you want Dispatch to send data to
* The Discord server and channel you want Dispatch to post in
* A Telegram account, group, or channel

### Turn your Patch on and wait for data to start flowing :tada:&#x20;


# Contract activity monitor example

Stream real-time smart contract activity (event emissions and function calls) to your app database

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](https://polygonscan.com/address/0xf6d1b85af155229acd7b523601148585a1ff67c6) 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:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2Fbwj49CIG2wgrMuUNeFzJ%2FEsprezzo%20Dispatch%20navbar.jpg?alt=media&amp;token=348d2f08-e0b4-4a79-898b-5ecb4e7bca19" alt=""><figcaption></figcaption></figure>

This takes you to the Patch Creator.

### Step 1: Select the Trigger

From the "Choose a Trigger event" dropdown, select the "Smart contract events emitted" Trigger.

Click the "Set Trigger conditions" button.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FIL0SagU0Auom3ryxpUkl%2FDispatch-selecting-automation-or-alert-trigger.gif?alt=media&amp;token=45bd4606-2922-4a7a-a741-6b13e36ab1ba" alt="Using Esprezzo Dispatch web app to select an automation or alert trigger event" width="563"><figcaption><p>Selecting a Web3 alert or automation trigger</p></figcaption></figure>

### Step 2: Set the Trigger conditions

This step will vary depending on which Trigger you selected.

#### Choose the network

For the smart contract event monitor Trigger, start by selecting the network your smart contract is on.

{% hint style="info" %}
**Time saving tip**

Dispatch comes loaded with some contracts for popular tokens, NFTs, and projects.&#x20;

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.
{% endhint %}

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FhHcQEcvqJYv6b40cJdWL%2FDispatch-selecting-blockchain-network-to-monitor-activity-on.gif?alt=media&amp;token=2bab1f89-e950-4c8e-9f06-51c16dac1fe2" alt="Using the Esprezzo Dispatch web app to select a blockchain network to monitor smart contract activity on" width="563"><figcaption><p>Selecting the network to monitor smart contract activity on</p></figcaption></figure>

#### Add a new contract

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:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FSc1vD7DCwZMu7ZoVJXwT%2F3%20-%20Add%20Galxe%20Space%20Station%203%20smart%20contract%20on%20Polygon%20to%20Esprezzo%20Dispatch.gif?alt=media&amp;token=39b53f0f-7dd4-4b33-a369-4e9c20d1f026" alt=""><figcaption><p>Adding a smart contract to monitor</p></figcaption></figure>

#### Select events and functions to monitor

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.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FP5lFwQ9hmD3MuTZxhzo1%2FDispatch-selecting-smart-contract-functions-and-events-to-monitor.gif?alt=media&amp;token=250d450b-cf1f-4348-a2fa-2f1af96fc3de" alt="Using the Esprezzo Dispatch web app to select smart contract events and functions to use as triggers for automation or alerts" width="563"><figcaption><p>Selecting smart contract events and functions to use as automation or alert triggers</p></figcaption></figure>

### Step 3: Select the Action

Click the **Application** dropdown to select where you want the smart contract events, functions & related data to go.

We'll search for "webhook":

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FRJFS0dqp3jGJrr2QBdCi%2F5%20-%20Select%20webhook%20as%20destination%20for%20smart%20contract%20alerts%20on%20Esprezzo%20Dispatch%20-%20Galxe%20Space%20Station%203_cropped.gif?alt=media&amp;token=e631e25b-7887-4612-bce9-d3af7cd923fa" alt=""><figcaption></figcaption></figure>

### Step 4: Set the Action details

Choose the webhook you want to receive the selected smart contract events, functions & associated data.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FkeLxAGvjebfQYjyqrXMk%2F6%20-%20Select%20team%20dashboard%20webhook%20for%20smart%20contract%20alerts%20on%20Esprezzo%20Dispatch%20-%20Galxe%20Space%20Station%203.gif?alt=media&amp;token=3001d67f-ebab-43f6-be7b-670500eb44bb" alt=""><figcaption></figcaption></figure>

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](https://dispatch.esprezzo.io/monitor), which logs events directly in Dispatch.

### Step 5 (optional): Confirm Patch name

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.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FAxQffRkBUtLjGakI7o3T%2F8%20-%20Esprezzo%20Dispatch%20webhook%20test%20turn%20on_optimized.gif?alt=media&amp;token=cbb67bcf-1295-4d13-b735-8edaad32f04a" alt=""><figcaption></figcaption></figure>

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 🚀


# Patch templates

Get inspired by what's possible

Need a little inspiration? See what's possible with Dispatch by checking out Patch templates on the [Dashboard](https://dispatch.esprezzo.io/dashboard) or the [Explore page](https://dispatch.esprezzo.io/explore).

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FElJxXa2uE8ZZRYdNAr2P%2FDispatch%20Patch%20samples%20-%2071624%20-%20v1%402x.jpg?alt=media&amp;token=77701a4d-9f78-419e-a6a8-af3c3697ce7c" alt="" width="563"><figcaption></figcaption></figure>

Patch templates make creating Patches even easier, with the Trigger and Action preselected; all you have to do is click a template and add the Trigger and Action details to start receiving data.


# Smart contract visualization

Get insights into smart contract activity over time

{% hint style="info" %}
**New**: Go beyond real-time alerts with data visualization for smart contracts.
{% endhint %}

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FbDr7MrZSqXo1PmmhfgGs%2FEsprezzo%20Dispatch%20smart%20contract%20data%20visualization%20charts%402x.jpg?alt=media&amp;token=e10bd322-a142-49aa-96e7-8824400c6963" alt="" width="563"><figcaption></figcaption></figure>

Dispatch makes it easy to monitor patterns and visualize activity trends in smart contracts, with insights about function calls, event emissions, and active addresses (accounts/wallets) interacting with your contracts.

### Use visualization to identify

* Trending function calls and event emissions
* Top addresses interacting with the contract
* Activity trends over time

### Visualizing smart contract activity is as easy as

1. Adding a smart contract to Dispatch
2. Creating a Patch to monitor select activity (function calls and/or event emissions)
3. Looking at contract activity in Dispatch

We currently support monitoring of smart contracts on Arbitrum, Base, Ethereum, Optimism, and Polygon.

For more details, check out [Visualizing smart contract activity (Data viz)](/smart-contract-activity/visualizing-smart-contract-activity-data-vis)


# Balance monitoring

Track balance changes and threshold activity in wallets and smart contracts

Dispatch makes it easy to get alerts and webhook data streams for balance changes and threshold changes for wallets and smart contracts.

### Balance-tracking Triggers you can choose from:

1. [Balance changes](#balance-changes)
2. [Balance threshold reached](#balance-threshold-reached)

With either Trigger, you can monitor multiple wallet and/or contract addresses with one Patch, as long as all addresses are on the same network. You can currently only monitor one token per Patch.

So, if you want to track USDC balance changes in multiple wallets and contracts on Base, you can create one Patch to do that. However, if you want to track USDC activity in multiple wallets on multiple networks (e.g. Ethereum and Base), you'll need to create one Patch for each network.

## Balance changes

Choose the "Asset balance change" Trigger if you want to monitor wallets and smart contracts for changes to the balance of a specific token.

### Using the token whitelist

Dispatch comes pre-loaded with popular tokens that make it easy to start monitoring balance activity. All you have to do is select the network that the token is on, and type the token symbol in the "Token" search box.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FnzrIu7UvgyYEc5QoUn3O%2Fimage.png?alt=media&amp;token=bd181b9b-cc24-49b8-a5cf-e06e6606b8be" alt="searching for a crypto token in Esprezzo Dispatch to monitor balance activity" width="563"><figcaption><p>Searching for a token to monitor balance changes</p></figcaption></figure>

If you don't see the token you want to monitor, you can add it.

### Adding tokens

After searching the whitelist to make sure the token you want to monitor is not already in Dispatch, here's how to add the token you want to watch.

#### What you will need (Requirements)

1. **Network** - Which network is the asset on?
2. **Token contract address**
3. **Contract ABI** - If the token contract is unverified

From the [Patch Builder](https://dispatch.esprezzo.io/patches/create) in Step 2, "Trigger Conditions", if you don't see the token you want to monitor, select "Add a token" from the Token dropdown:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FsqmykdzeF3vpRgFFgnDM%2Fimage.png?alt=media&amp;token=68210ed2-668f-440d-9c55-b37b8ef2d1f5" alt="Clicking the &#x22;Add a token&#x22; option in the Token dropdown menu to monitor balance activity" width="563"><figcaption><p>Click "Add a token" at the bottom of the dropdown</p></figcaption></figure>

This will launch a modal:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FfkOXRnBtNv4V7MbiITj1%2Fimage.png?alt=media&amp;token=f78bc4fb-5ddf-4217-93dd-1898be4fbd4d" alt="A modal with inputs required to add a token to Dispatch for monitoring. Includes inputs for the token&#x27;s network, contract address, and contract name" width="487"><figcaption><p>Adding a token to Dispatch</p></figcaption></figure>

Once you add the token contract address and a descriptive nickname you'll remember, press the "Add contract" button.

### Unverified token contracts

If the address you entered is for an unverified contract, you'll need to paste in the contract's ABI in JSON format:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2F94ZtqW1x804deFyv4sPi%2Fimage.png?alt=media&amp;token=6450ed1f-6c92-48b4-8dbf-4a28b385c9a1" alt="" width="563"><figcaption><p>Adding the ABI for an unverified token contract</p></figcaption></figure>

Once you've added the contract to Dispatch, you will be able to use it in any [Patch](/introduction/what-is-dispatch#patches) you create.

## Balance threshold reached

The "Balance threshold reached" Trigger is helpful if you need to know when the balance of a specific token goes above or below a certain threshold amount.

For example, if you want to know when a team wallet's ETH balance goes below a certain amount, or when a reward-dispensing contract's ERC-20 reward token goes below a certain threshold.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FIrhrMPlau5HLvWGodmX5%2Fimage.png?alt=media&amp;token=13769444-3cde-43c4-8e2b-58e98a4e2518" alt="" width="563"><figcaption></figcaption></figure>

After selecting the network that the token is on, you'll be able to search for the token and enter addresses.

Don't see the token you want to set a balance threshold alert for? Here's [how to add the token](#adding-tokens).

Once you've selected the token, set

1. **Balance threshold**: The number (threshold)
2. **Above or below threshold**: Do you want to know when the balance goes above the number? Or below it?


# Add smart contracts

Get real-time smart contract activity data

Whether you want to stream data for specific contract events and functions to your apps, or use smart contract event emissions and function calls to trigger alerts and automated workflows, you'll need to add the contracts to Dispatch.

There are 2 ways to add smart contracts to Dispatch:

1. Add contract during Patch creation ([Patch Builder](https://dispatch.esprezzo.io/patches/create))
2. Add contract on the [Contracts](https://dispatch.esprezzo.io/contracts/overview) page

{% hint style="info" %}
Currently Dispatch supports smart contracts on Ethereum, Polygon, Arbitrum One, Base, and Optimism.

Request support for other networks [here](https://info.esprezzo.io/dispatch-network-request).
{% endhint %}

See how to add contracts during Patch creation in the [contract activity monitor example](/introduction/contract-activity-monitor-example#step-2-set-the-trigger-conditions).

## Adding a smart contract from the Contracts page

Navigate to the [Contracts](https://dispatch.esprezzo.io/contracts/overview) page.

Click the "Add contract" button:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FjG0AJNu9rNef8eyQq0le%2FContracts%20-%20add%20a%20smart%20contract%20to%20Esprezzo%20Dispatch.gif?alt=media&amp;token=04e65c24-6f8c-41ce-8afa-dc65c5e7ed79" alt=""><figcaption></figcaption></figure>

In the modal, add the

1. **Network**: the network that the smart contract is on
2. **Contract address**: the address of the smart contract you want alerts/automations from
3. **Contract nickname**: an easy-to-remember, descriptive name for the contract that will distinguish it from other contracts you might add later

Click the "Add contract" button.

### Adding unverified contracts

If the contract you want to monitor is unverified, there are a few extra steps.

Namely, you'll need to provide the [contract ABI](https://dev.to/sadiqful/understanding-smart-contract-abi-31km) in JSON format.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2F94ZtqW1x804deFyv4sPi%2Fimage.png?alt=media&amp;token=6450ed1f-6c92-48b4-8dbf-4a28b385c9a1" alt="How to add an unverified contract to Dispatch so you can get alerts from it" width="563"><figcaption></figcaption></figure>

#### Proxy contracts

If the contract you're adding is a proxy, Dispatch provides the option to add the associated implementation contract at the same time, so you can monitor activity in both the proxy and implementation contracts.

To monitor activity in both the proxy and implementation contracts, you'll need to provide the ABIs for both contracts.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FzUK43g4BG1TFGmljkz8c%2Fimage.png?alt=media&amp;token=678c324b-1e17-415d-ad52-63491060d68f" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %}
At this time Dispatch does not auto-update monitoring of new implementation contracts when proxy contracts are updated with new implementation contract addresses.
{% endhint %}

Once you add a contract, you should see it in the top row of the table in [Contracts Overview](https://dispatch.esprezzo.io/contracts/overview).


# Create Patches from smart contracts

Easily create alerts for smart contract activity and visualize it without code

Once you've added at least one smart contract to Dispatch, you can

1. Get real-time alerts for specific contract events and functions
2. Visualize trends in contract activity
   1. See which events and functions are being emitted or called most over time
   2. Spot spikes in activity
   3. See which addresses are interacting most with contracts

In addition to event emissions, Dispatch currently supports functions that modify a contract's state. In other words, we do NOT support alerting for functions with `stateMutability` types of `pure` or `view`.

To get alerts or visualize smart contract activity, you will need to create at least one Patch that listens for the activity you're interested in.

### 1: Navigate to the [Contracts](https://dispatch.esprezzo.io/contracts/overview) page.

Find the contract you want to get alerts, or see data visualization for.

At the right end of the row for the selected contract, click on the ••• button and select the "+ Create Patch" option.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2F5xkg5Q0JHhqw8R50yd16%2FCreate%20alert%20or%20automation%20from%20a%20smart%20contract%20using%20Esprezzo%20Dispatch.gif?alt=media&amp;token=6d77f2f2-23e4-42d9-b18c-27a2cbfa4372" alt=""><figcaption></figcaption></figure>

This should take you to Patch Builder, step 2: Trigger conditions.

### 2: Select the contract events and/or functions

Select the events and/or functions you want to use to trigger alerts or workflows by clicking the checkboxes next to them:

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2Fz7WrX1YLK2ElnOkP6wrN%2F4%20-%20Select%20EventClaim%20event%20from%20Galxe%20Space%20Station%203%20contract%20on%20Esprezzo%20Dispatch.gif?alt=media&amp;token=8a58be4a-9465-4f08-af7f-5260abb31827" alt=""><figcaption></figcaption></figure>

Click the "Continue" button.

### 3: Select the Action

Select the **Action** (where you want the event & event data to go).

{% hint style="info" %}
If you're not interested in real-time alerts and just want to see charts for contract activity, select **Dispatch Monitor** as the Action in your Patches.
{% endhint %}

### 4: Set the Action details

The details will vary depending on the Action you've selected.

### 5: Test the Action (optional)

All Actions except for Dispatch Monitor provide an option for you to run a test to make sure Dispatch can deliver messages to your selected output.

[Dispatch Monitor](https://dispatch.esprezzo.io/monitor) logs events to Dispatch only.

### 6: Name the Patch (optional)

Customizing the Patch name is optional; Dispatch adds a default Patch name for you to save time.

Now's the perfect opportunity to double check your Trigger and Action details.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FAxQffRkBUtLjGakI7o3T%2F8%20-%20Esprezzo%20Dispatch%20webhook%20test%20turn%20on_optimized.gif?alt=media&amp;token=cbb67bcf-1295-4d13-b735-8edaad32f04a" alt=""><figcaption></figcaption></figure>

If all looks right, press the "Turn Patch on" button.


# Viewing contract functions and events

How to view smart contract function calls and event emissions after you've created Patches (alerts or automated workflows)

Once you have created at least one Patch with the **Smart contract activity** Trigger, you will receive alerts or webhook payloads, depending on the Action you selected in [Patch Builder](https://dispatch.esprezzo.io/patches/create).

If you selected Dispatch Monitor as your Action, you will see events on the [Dispatch Monitor](https://dispatch.esprezzo.io/monitor) page.

### Contracts History

The easiest way to inspect activity for your contracts is to go to [Contracts History](https://dispatch.esprezzo.io/contracts/history).

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FwYYgvUnOLGy5QJiBUuHQ%2Fimage.png?alt=media&amp;token=0edd2fbe-94a0-4d5f-a043-8b344e8b89c9" alt="Smart contract activity history table in Esprezzo Dispatch" width="563"><figcaption><p>Smart contract history: A stream of all the activity in smart contracts you're monitoring</p></figcaption></figure>

The default view displays all event emissions and functions calls in contracts you've added to Dispatch.

Clicking on any row in the table will expand the row to show you all the event details, including the option to see and copy the event log JSON.

To see only activity from certain contract(s), you can

* Search by contract name
* Filter the table to show only contracts on certain networks
* Filter the table to show only certain contract types
* Any combination of the above

Note that if you are monitoring activity from Dispatch "system" contracts (i.e. pre-existing contracts you did not add to Dispatch), those event emissions and function calls are not displayed in Contracts History, but can be found in [Patch History](https://dispatch.esprezzo.io/patches/history).

### Patch History

To view the history of all Patches in your account (i.e. if you are monitoring wallets for balance changes in addition to smart contract activity), go to [Patch History](https://dispatch.esprezzo.io/patches/history).

There you can filter the table to show only contract event emissions by selecting the "Smart contract activity" option from the Trigger filter.


# Visualizing smart contract activity (Data vis)

You can view function, event, and address activity charts for any smart contract you're monitoring with Patches.

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FezG5pDpFXTYPg2M6cOvr%2FEsprezzo%20Dispatch%20smart%20contract%20activity%20widgets.jpg?alt=media&amp;token=c77ded3f-56bc-4799-91fe-682f186c37ba" alt="Data visualization widgets for smart contract activity in Dispatch by Esprezzo"><figcaption></figcaption></figure>

## Accessing visualizations

1. Navigate to [Contracts > Overview](https://dispatch.esprezzo.io/contracts/overview)
2. Click on the name or address of any contract in the table. Or, click the ••• at the end of any contract row and select "View details".

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FmrKvfL2CWFTmDC3AL7uv%2FDispatch-see-your-contract-data-viz.gif?alt=media&amp;token=3f3851ce-48a5-4b0b-98ba-a2c75ee742db" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
At this time, charts don't auto-update; refresh the page to get updates.
{% endhint %}

### Using the time selector

Focus on a specific time range by using the time selector in each chart or table widget.

#### Free accounts can view account activity from...

* Last hour
* Last 24 hours
* Last 7 days


# Rename, delete smart contracts

## How to rename smart contracts

From the [Contracts](https://dispatch.esprezzo.io/contracts/overview) page, find the contract you wish to rename.

At the right end of the row for the selected contract, click on the ••• button and select the "Rename" option.

Type in the new nickname you want for your contract.

## How to delete smart contracts

{% hint style="danger" %}
Deleting smart contracts from Dispatch will also delete the Patches that are using those smart contracts.
{% endhint %}

From the [Contracts](https://dispatch.esprezzo.io/contracts/overview) page, find the contract you wish to rename.

At the right end of the row for the selected contract, click on the ••• button and select the "Delete" option.

Press the "Delete" button.


# Webhooks overview

Automatically send Dispatch events and data to your apps or services with webhooks

Webhooks allow your apps to receive information when events matching your Trigger conditions occur, and respond however you define.

Webhooks deliver data to your apps as they happen; you get the data you want immediately instead of having to poll (look) for changes to data. For example, we can send your app a notification when the balance of any of the wallets you're watching changes.

We don't currently support webhook request authentication via headers, but it's on our roadmap.&#x20;

You should **always verify** that webhook requests originate from the `api.dispatch.esprezzo.io` domain; any other origin is not a legitimate Dispatch webhook request.

{% hint style="danger" %}
**Important**

You should always verify that webhook requests originate from the <mark style="color:purple;">`api.dispatch.esprezzo`</mark> domain.

Any other origin is **not** a legitimate Dispatch webhook request and could pose a security risk.
{% endhint %}

### Event types

Webhooks can be triggered by several types of events (Triggers) in Dispatch:

* **Address activity**: wallet balance of a specific token changed, or went above or below a threshold
* **Smart contract activity**: anytime selected events are emitted by, or functions are called in smart contracts
  * Lots of possibilities:&#x20;
    * Alerts for unexpected AdminChange, Pause, Unpause events that could indicate security vulnerabilities
    * Mint, transfer, upgrade & gameplay events on ERC721, ERC1155, ERC1967, ERC-4337
    * Swap, trade & new pair/pool events on DEX contracts
    * Any verified contract on Ethereum, Polygon, Base & Avalanche, with more networks coming soon

### Webhook format

Every Dispatch webhook uses the same format, regardless of event type. The webhook request is a standard HTTP POST, and the request body will contain a JSON payload with the following top-level keys:

* <mark style="color:purple;">`patch`</mark>: information about the associated Patch (e.g. <mark style="color:purple;">`patch.id`</mark>, <mark style="color:purple;">`patch.name`</mark>, etc). This object also contains information about the Trigger as well (e.g. <mark style="color:purple;">`trigger.template_id`</mark>, <mark style="color:purple;">`trigger.settings`</mark>, etc).
* <mark style="color:purple;">`details`</mark>: information about the actual event that has occurred (e.g. <mark style="color:purple;">`details.token_symbol`</mark>, <mark style="color:purple;">`details.new_balance`</mark>, etc for "address balance change" Triggers).

The <mark style="color:purple;">`details`</mark> object will contain different data based on the Trigger type. See the [Webhook Reference](/webhooks/webhook-reference) for more details.

### What you'll need

1. **Dispatch account** ([log in](https://dispatch.esprezzo.io/login) or [sign up](https://dispatch.esprezzo.io/signup))
2. **A webhook URL**: an endpoint on your server that receives requests from Dispatch alerting you about events that happen

{% hint style="warning" %}
**Important:** Make sure your endpoint is publicly accessible so we can send unauthenticated POST requests.
{% endhint %}

### Example: Sending smart contract or wallet activity to Google Sheets&#x20;

With webhooks, you can use Dispatch with Zapier to send on-chain data to apps in the Zapier ecosystem, or use on-chain activity to automate tasks in apps you and your team already use.

Check out this guide to see an example: [Automatically log on-chain activity to Google Sheets without code](https://blog.esprezzo.io/automatically-log-on-chain-activity-to-google-sheets-without-any-code)


# Create your first webhook

Create a Patch in the Dispatch UI and select "webhook" as the Action

### Steps to create a webhook:

1. [Log in](https://dispatch.esprezzo.io/login) to the Dispatch app
2. From the [Dashboard](https://dispatch-staging.esprezzo.io/dashboard), select a Trigger from the Trigger dropdown (event you want Dispatch to listen for, i.e. when a wallet balance changes or goes above or below a threshold, a smart contract emits certain events, etc.)
3. Select **Webhook** as the Action:<br>

   <figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FuAuoSOCXUeg68if0wpVK%2Fesprezzo-dispatch-dashboard-select-webhook-action.gif?alt=media&amp;token=22604da5-3207-4f9e-8e60-897492ad2216" alt="Selecting webhook as the automated action from Esprezzo Dispatch dashboard"><figcaption></figcaption></figure>
4. Click the **Complete Patch** button, which takes you to the Patch Creator
5. Configure Trigger settings
6. Create a new webhook in step 4, Action details: from the Webhook dropdown menu, select "Click here to add a new webhook" <br>

   <figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FXTLoAfSNZmQpMNGb3tXG%2Fdispatch-patch-creator-webhook-configuration.jpg?alt=media&amp;token=4ffc80e7-0de8-4897-acd2-d82cdd69b6fb" alt=""><figcaption></figcaption></figure>
7. In the "Create webhook" modal, add a descriptive name for your webhook — this is recommended especially if you plan to use multiple webhooks. Provide the webhook endpoint URL — the callback URL your app will use to accept the incoming webhook&#x20;
8. Test to make sure Dispatch is able to send to your URL
9. Click the **Turn Patch On** button :tada:

{% hint style="info" %}
**Tip**: for quick testing, get a unique webhook URL via [webhook.site](https://webhook.site/), paste the URL into Dispatch, and see webhook notifications as they come in.
{% endhint %}

Once you've created a webhook, you can select it as the output for any other Patches you create by selecting the webhook by name in the Patch Creator and repeating the other steps above.

You can see and manage all your webhooks by visiting [Connected Apps](https://dispatch-staging.esprezzo.io/account/connected-apps) under your account settings.


# Webhook reference

JSON reference for Dispatch webhook payloads

When a webhook Patch is fired, Dispatch sends an HTTP POST message to your webhook endpoint URL.

The message (payload) is a JSON object with information about the Trigger event.

Here are the JSON structures for each Trigger type.

## Smart Contract Activity Trigger

Aka "Event monitor" — a trigger that fires when your selected smart contract events are emitted or functions are called.

```json
{
  "details": {
    "block_explorer_block_link": "https://etherscan.io/block/18479837",
    "block_explorer_contract_link": "https://etherscan.io/address/0xd774557b647330C91Bf44cfEAB205095f7E6c367",
    "block_explorer_name": "Etherscan",
    "block_explorer_tx_link": "https://etherscan.io/tx/0x4aea2871a593877974eeff77529b937666d7410a118cbf1a2dd41042e613c01d",
    "block_number": 18479837,
    "contract_address": "0xd774557b647330C91Bf44cfEAB205095f7E6c367",
    "contract_name": "Nakamigos",
    "network": "Ethereum",
    "patch_event_id": "772977e6-f3d0-4916-bb78-6bc4460ee880",
    "patch_event_link": "https://dispatch.esprezzo.io/patches/history/772977e6-f3d0-4916-bb78-6bc4460ee880",
    "patch_id": "22594135-b546-415c-bce4-c43c370e4f0c",
    "patch_name": "Send a JSON payload to a webhook endpoint when Transfer event is emitted by Nakamigos",
    "signature": "Transfer(address,address,uint256)",
    "signature_display": "Transfer(address indexed from, address indexed to, uint256 indexed tokenId)",
    "signature_name": "Transfer",
    "signature_type": "event",
    "timestamp": "1 Nov, 2023 9:07 PM +UTC",
    "tx_hash": "0x4aea2871a593877974eeff77529b937666d7410a118cbf1a2dd41042e613c01d",
    "username": "test1",
    "values": [
      {
        "name": "from",
        "type": "address",
        "value": "0xd8Ac2855F5079671d4C0970c6FA16531eeA3907c"
      },
      {
        "name": "to",
        "type": "address",
        "value": "0x9698024d6Be6807482ec5d582CD73D2f469F5b5C"
      },
      {
        "name": "tokenid",
        "type": "uint",
        "value": "19397"
      }
    ]
  },
  "patch": {
    "action": {
      "deleted_at": null,
      "description": "Send a JSON payload to a webhook endpoint",
      "icon_url": "https://content.esprezzo.io/dispatch/icons/actions/webhook.svg",
      "id": "a422b06d-5904-4d19-95cc-92e8c6f57edd",
      "inserted_at": "2022-08-26T15:29:55Z",
      "name": "Webhook",
      "slug": "webhook",
      "updated_at": "2022-08-26T15:29:55Z"
    },
    "action_count": 0,
    "deleted_at": null,
    "error_count": 0,
    "id": "22594135-b546-415c-bce4-c43c370e4f0c",
    "inserted_at": "2023-11-01T20:32:20Z",
    "is_active": true,
    "name": "Send a JSON payload to a webhook endpoint when Transfer event is emitted by Nakamigos",
    "settings": [
      {
        "id": "41caa2ec-35dc-4aa7-8e13-4eac57d6bd60",
        "inserted_at": "2023-11-01T20:32:20Z",
        "integration_channel_id": null,
        "integration_id": null,
        "patch_id": "22594135-b546-415c-bce4-c43c370e4f0c",
        "setting": {
          "description": "A comma-separated list of implementation event signatures to listen to in order to receive smart contract events.",
          "id": "a2a32f3a-06c0-4f20-8842-d85cd2192c59",
          "inserted_at": "2023-04-04T14:14:03Z",
          "slug": "implementation-event-list",
          "type": "trigger",
          "updated_at": "2023-04-04T14:14:03Z"
        },
        "setting_id": "a2a32f3a-06c0-4f20-8842-d85cd2192c59",
        "updated_at": "2023-11-01T20:32:20Z",
        "value": "Transfer(address indexed from, address indexed to, uint256 indexed tokenId)"
      },
      {
        "id": "24791c6c-0b93-4a7e-80a7-86d93afdca53",
        "inserted_at": "2023-11-01T20:32:20Z",
        "integration_channel_id": "https://webhook.site/842f0c2a-6749-432c-ac8f-d24366059ed9",
        "integration_id": "217a5e9f-1405-4a6b-ac0a-fbf0c0c4c7e0",
        "patch_id": "22594135-b546-415c-bce4-c43c370e4f0c",
        "setting": {
          "description": "The channel to dispatch Telegram messages to.",
          "id": "8d7dfc6d-b443-4860-8a06-5c534935d289",
          "inserted_at": "2022-07-11T14:05:16Z",
          "slug": "integration",
          "type": "action",
          "updated_at": "2022-07-11T14:05:16Z"
        },
        "setting_id": "8d7dfc6d-b443-4860-8a06-5c534935d289",
        "updated_at": "2023-11-01T20:32:20Z",
        "value": "My Cool Webhook"
      }
    ],
    "trigger": {
      "deleted_at": null,
      "description": "When specific functions are called and/or events are emitted",
      "icon_url": "https://content.esprezzo.io/dispatch/icons/triggers/smart-contract-activity.svg",
      "id": "588cbfa7-24fa-4aa7-8e0e-73830b4443b6",
      "inserted_at": "2023-03-02T18:02:36Z",
      "name": "Smart contract activity",
      "slug": "smart-contract-activity",
      "type": "user-contract",
      "updated_at": "2023-03-02T18:02:36Z"
    },
    "updated_at": "2023-11-01T20:32:20Z"
  }
}
```

## Balance Change Trigger

{% code overflow="wrap" %}

```json
{
  "details": {
    "above_or_below": null,
    "address": "0xb5d85CBf7cB3EE0D56b3bB207D5Fc4B82f43F511",
    "block_explorer_address_link": "https://etherscan.io/address/0xb5d85CBf7cB3EE0D56b3bB207D5Fc4B82f43F511",
    "change_amount": "-0.115130931858",
    "network": "Ethereum",
    "new_balance": "1,210.534698218538",
    "patch_name": "Send a JSON payload to a webhook endpoint when ETH balance changes (0xb5d8...F511)",
    "previous_balance": "1,210.649829150396",
    "threshold_amount": null,
    "timestamp": "13 Feb, 2023 6:23 PM +UTC",
    "token_name": "Ether",
    "token_symbol": "ETH",
    "truncated_address": "0xb5d8...F511"
  },
  "patch": {
    "action": {
      "deleted_at": null,
      "description": "Send a JSON payload to a webhook endpoint",
      "icon_url": "https://content.esprezzo.io/dispatch/icons/actions/webhook.svg",
      "id": "a422b06d-5904-4d19-95cc-92e8c6f57edd",
      "inserted_at": "2022-08-26T15:29:55Z",
      "name": "Webhook",
      "slug": "webhook",
      "updated_at": "2022-08-26T15:29:55Z"
    },
    "action_count": 14,
    "deleted_at": null,
    "error_count": 0,
    "id": "7bb1c092-a68a-42a0-b147-63ea9e1dc277",
    "inserted_at": "2023-02-02T19:49:54Z",
    "is_active": true,
    "name": "Send a JSON payload to a webhook endpoint when ETH balance changes (0xb5d8...F511)",
    "settings": [
      {
        "id": "d4da2972-4ba4-4461-a248-90a0ac4f6fc5",
        "inserted_at": "2023-02-02T19:49:54Z",
        "integration_channel_id": null,
        "integration_id": null,
        "patch_id": "7bb1c092-a68a-42a0-b147-63ea9e1dc277",
        "setting": {
          "description": "A comma-separated list of account addresses to listen to in order to receive account balance changes.",
          "id": "cd1aac20-e2d1-4a23-baf6-0da78635e2bc",
          "inserted_at": "2022-07-11T14:05:18Z",
          "slug": "address-list",
          "type": "trigger",
          "updated_at": "2022-07-11T14:05:18Z"
        },
        "setting_id": "cd1aac20-e2d1-4a23-baf6-0da78635e2bc",
        "updated_at": "2023-02-02T19:49:54Z",
        "value": "0xb5d85CBf7cB3EE0D56b3bB207D5Fc4B82f43F511"
      },
      {
        "id": "447c827e-68b9-4f0a-a662-1fbab0a2a899",
        "inserted_at": "2023-02-02T19:49:54Z",
        "integration_channel_id": "https://webhook.site/842f0c2a-6749-432c-ac8f-d24366059ed9",
        "integration_id": "217a5e9f-1405-4a6b-ac0a-fbf0c0c4c7e0",
        "patch_id": "7bb1c092-a68a-42a0-b147-63ea9e1dc277",
        "setting": {
          "description": "The channel to dispatch Telegram messages to.",
          "id": "8d7dfc6d-b443-4860-8a06-5c534935d289",
          "inserted_at": "2022-07-11T14:05:16Z",
          "slug": "integration",
          "type": "action",
          "updated_at": "2022-07-11T14:05:16Z"
        },
        "setting_id": "8d7dfc6d-b443-4860-8a06-5c534935d289",
        "updated_at": "2023-02-02T19:49:54Z",
        "value": "My Cool webhook"
      }
    ],
    "trigger": {
      "deleted_at": null,
      "description": "When the balance of a specific asset in a wallet or smart contract changes",
      "icon_url": "https://content.esprezzo.io/dispatch/icons/triggers/address-balance-change.svg",
      "id": "a858081d-9f46-46f4-8617-e27f6ae1a123",
      "inserted_at": "2022-07-11T14:05:17Z",
      "name": "Address balance change",
      "slug": "address-balance-change",
      "type": "balance-change",
      "updated_at": "2022-07-11T14:05:17Z"
    },
    "updated_at": "2023-02-13T18:17:26Z"
  }
}
```

{% endcode %}

## Balance Threshold Reached Trigger

{% code overflow="wrap" %}

```json
{
  "details": {
    "above_or_below": "below",
    "address": "0xb5d85CBf7cB3EE0D56b3bB207D5Fc4B82f43F511",
    "block_explorer_address_link": "https://etherscan.io/address/0xb5d85CBf7cB3EE0D56b3bB207D5Fc4B82f43F511",
    "change_amount": "-2.250671200561",
    "network": "Ethereum",
    "new_balance": "1,188.834730915411",
    "patch_name": "Send a JSON payload to a webhook endpoint when ETH balance < 1,191 (0xb5d8...F511)",
    "previous_balance": "1,191.085402115972",
    "threshold_amount": "1,191.00",
    "timestamp": "13 Feb, 2023 7:55 PM +UTC",
    "token_name": "Ether",
    "token_symbol": "ETH",
    "truncated_address": "0xb5d8...F511"
  },
  "patch": {
    "action": {
      "deleted_at": null,
      "description": "Send a JSON payload to a webhook endpoint",
      "icon_url": "https://content.esprezzo.io/dispatch/icons/actions/webhook.svg",
      "id": "a422b06d-5904-4d19-95cc-92e8c6f57edd",
      "inserted_at": "2022-08-26T15:29:55Z",
      "name": "Webhook",
      "slug": "webhook",
      "updated_at": "2022-08-26T15:29:55Z"
    },
    "action_count": 0,
    "deleted_at": null,
    "error_count": 0,
    "id": "687a6c3e-7de4-45a5-a221-38f292e0c066",
    "inserted_at": "2023-02-13T19:41:01Z",
    "is_active": true,
    "name": "Send a JSON payload to a webhook endpoint when ETH balance < 1,191 (0xb5d8...F511)",
    "settings": [
      {
        "id": "550e208d-6a75-4a83-8f72-287fea0b9742",
        "inserted_at": "2023-02-13T19:41:01Z",
        "integration_channel_id": "https://webhook.site/842f0c2a-6749-432c-ac8f-d24366059ed9",
        "integration_id": "217a5e9f-1405-4a6b-ac0a-fbf0c0c4c7e0",
        "patch_id": "687a6c3e-7de4-45a5-a221-38f292e0c066",
        "setting": {
          "description": "The channel to dispatch Telegram messages to.",
          "id": "8d7dfc6d-b443-4860-8a06-5c534935d289",
          "inserted_at": "2022-07-11T14:05:16Z",
          "slug": "integration",
          "type": "action",
          "updated_at": "2022-07-11T14:05:16Z"
        },
        "setting_id": "8d7dfc6d-b443-4860-8a06-5c534935d289",
        "updated_at": "2023-02-13T19:41:01Z",
        "value": "My Cool Webhook"
      },
      {
        "id": "799766da-0170-424a-a20e-653d95894875",
        "inserted_at": "2023-02-13T19:41:01Z",
        "integration_channel_id": null,
        "integration_id": null,
        "patch_id": "687a6c3e-7de4-45a5-a221-38f292e0c066",
        "setting": {
          "description": "A lower limit for when the comparison of the previous and new balance crosses this threshold.",
          "id": "d8e48b57-5d44-4b9a-8851-18ac78748d72",
          "inserted_at": "2022-07-11T14:05:18Z",
          "slug": "below-threshold",
          "type": "trigger",
          "updated_at": "2022-07-11T14:05:18Z"
        },
        "setting_id": "d8e48b57-5d44-4b9a-8851-18ac78748d72",
        "updated_at": "2023-02-13T19:41:01Z",
        "value": "1191"
      },
      {
        "id": "e264e7d7-d292-4518-840e-227ef3d21a1a",
        "inserted_at": "2023-02-13T19:41:01Z",
        "integration_channel_id": null,
        "integration_id": null,
        "patch_id": "687a6c3e-7de4-45a5-a221-38f292e0c066",
        "setting": {
          "description": "A comma-separated list of account addresses to listen to in order to receive account balance changes.",
          "id": "cd1aac20-e2d1-4a23-baf6-0da78635e2bc",
          "inserted_at": "2022-07-11T14:05:18Z",
          "slug": "address-list",
          "type": "trigger",
          "updated_at": "2022-07-11T14:05:18Z"
        },
        "setting_id": "cd1aac20-e2d1-4a23-baf6-0da78635e2bc",
        "updated_at": "2023-02-13T19:41:01Z",
        "value": "0xb5d85CBf7cB3EE0D56b3bB207D5Fc4B82f43F511"
      }
    ],
    "trigger": {
      "deleted_at": null,
      "description": "When the balance of an token goes above or below a threshold for one address",
      "icon_url": "https://content.esprezzo.io/dispatch/icons/triggers/balance-threshold-reached.svg",
      "id": "c17e8157-3125-4b68-99d4-c3df6b18cf61",
      "inserted_at": "2022-07-11T14:05:17Z",
      "name": "Balance threshold reached",
      "slug": "balance-threshold-reached",
      "type": "balance-change",
      "updated_at": "2022-07-11T14:05:17Z"
    },
    "updated_at": "2023-02-13T19:41:01Z"
  }
}
```

{% endcode %}


# Help Center

Our [**Help Center**](https://help.esprezzo.io/) is filled with helpful articles for most commonly asked questions.

You can also use the help widget in the lower corner of Dispatch to ask questions or provide feedback; we're here to help.


# Discord integration guide

Looking to create a Discord bot that auto-posts important on-chain activity to your team or community servers? Whether you're wanting to automatically update a channel or get alerts for your eyes only, you're in the right place.

There are several ways you can start getting alerts in Discord:

1. Integrate your Discord account or server during Patch creation
2. Connect your Discord account or server in your account settings, then create a Patch

### Troubleshooting

Having trouble getting Dispatch to post messages in your Discord server or channel?

Discord can get a little confusing with permissions at both the server and channel level, we get it.

### Quick things to check:

1. Are you an admin of the server?
2. Do you have other security or verification tools that might be blocking bot messages?
3. Does the channel allow message posting?

### Setting Discord permissions

1. In your Discord **channel**, navigate to **Settings**
2. In Settings, choose **Permissions**
3. Scroll down to **Advanced Permissions**
4. Make sure that for whichever Roles/Members group you're assigning Dispatch bot to, the green checkmark is checked next to **Send Messages**
5. Make sure to click **Save Changes**!

<figure><img src="https://2361914853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvqfEygZQWRoaDpS8wmp3%2Fuploads%2FpUwHwrCEu5MqLHXUE7xE%2FDiscord_Permissions.gif?alt=media&amp;token=98961c89-fc22-4b18-8c03-e9b034cb9f5d" alt="Choosing the proper permissions so that Dispatch can send messages to your Discord channel"><figcaption></figcaption></figure>

Still having issues? Use the help widget in the lower right corner in Dispatch or shoot us a message in Discord. We're happy to help!


# Requesting other networks

We love that you're interested in using Dispatch for projects on other networks!

Request support for other networks [here](https://info.esprezzo.io/dispatch-network-request).


