Skip to main content

Transaction Manager via Webhooks

Maestro’s Transaction Manager is a state of the art tool that abstracts away the complexity of managing Cardano transaction states. It provides a transaction monitoring dashboard and webhook notification system to track all transactions submitted with Maestro's API.

This guide discusses how to create a webhook, submit a transaction using the Maestro Transaction Manager, and monitor the submitted transaction using the webhook functionality. Use Ngrok as a local proxy to receive webhook events.

note

This guide will use with the Pre-Production network.


Prerequisites

Use Ngrok as a local proxy to receive webhook events. You will also need a hexdump tool, such as xxd, to convert the transaction CBOR hex into a binary stream.

Prepare wallets

info

This step assumes that there is no signed transaction available to use. If there is one, feel free to skip this step.

Install Eternl wallet and switch the network to Pre-Production Testnet (on the bottom-right selector):



Create two separate wallets that will be used to test a transaction. After creating the wallets, disable transaction auto submit:

Send tADA to those wallets using the Cardano Faucet:

Prepare local environment

Start Ngrok proxy:

> ngrok http 8000
...
Session Status online
Account Varderes Barsegyan (Plan: Free)
Update update available (version 3.2.2, Ctrl-U to update)
Version 3.0.6
Region United States (us)
Latency -
Web Interface http://127.0.0.1:4040
Forwarding https://ae50-2605-ef80-80e0-da8-8ccc-f9bb-159b-fde5.ngrok-free.app -> http://localhost:5000

Copy the Ngrok forwarding URL In this example, that will be https://ae50-2605-ef80-80e0-da8-8ccc-f9bb-159b-fde5.ngrok-free.app.

info

Every time Ngrok starts, it will generate a new and unique forwarding URL.

Prepare dashboard

First, create a project. After creating the project, create a webhook.

For the webhook URL, use the Ngrok URL copied above: https://ae50-2605-ef80-80e0-da8-8ccc-f9bb-159b-fde5.ngrok-free.app.

Submit transaction

Create and sign a transaction:

Download the transaction:

Copy the cBorHex from the downloaded transaction file. In this example that will be:

> 84a40081825820f6fb7bf7925cf374449ab9b11074d2e63731358370ead6863e492790ecee57cf010185825839008f88349c1218002591371b341f8f894faf606ae2cca080b95f8ad69ffa675dcf9209a01b15980c440979b54a3a157a8af2c5db463455599d1a0bebc20082583900870865a90ec7c1c68c39c22f0b8794835ae8acb1de3fcc7131c24cd6b559ac2f5feaa867d312ee77188e4bf08a71c934b0ea9e02db4d80331a5476399882583900870865a90ec7c1c68c39c22f0b8794835ae8acb1de3fcc7131c24cd6b559ac2f5feaa867d312ee77188e4bf08a71c934b0ea9e02db4d80331a2a3c764d82583900870865a90ec7c1c68c39c22f0b8794835ae8acb1de3fcc7131c24cd6b559ac2f5feaa867d312ee77188e4bf08a71c934b0ea9e02db4d80331a2a3c764c82583900870865a90ec7c1c68c39c22f0b8794835ae8acb1de3fcc7131c24cd6b559ac2f5feaa867d312ee77188e4bf08a71c934b0ea9e02db4d80331a004c4b40021a0002b301031a0187303fa1008182582012e4ce89e298f3ebc318a8d2c1eba3c3b2d6b755bc5fda0ed75d23dfdc30208158405562e51830177954a1e5e7fe51017207792749fae5c095b4e8b254525a02c06096ab6084538f58b38f8da483ff92f8f777fcbc1de620e0054bc43848e1e5e403f5f6

Create a binary stream of the transaction:

> TRANSACTION=84a40081825820c96c8da5633e260a9bc182355598fea24de458af03617b287691d899ce6624780201858258390048a8e6138dea1ba8e44e6b84f2c02f5afcdcb364c8115a2a826a8197b559ac2f5feaa867d312ee77188e4bf08a71c934b0ea9e02db4d80331a1dcd650082583900765fbfbcbb2e5289af4f17173905f8659eca7c1851830bcb59490723fa675dcf9209a01b15980c440979b54a3a157a8af2c5db463455599d1a14ff868682583900765fbfbcbb2e5289af4f17173905f8659eca7c1851830bcb59490723fa675dcf9209a01b15980c440979b54a3a157a8af2c5db463455599d1a0a811cc482583900765fbfbcbb2e5289af4f17173905f8659eca7c1851830bcb59490723fa675dcf9209a01b15980c440979b54a3a157a8af2c5db463455599d1a0a811cc382583900765fbfbcbb2e5289af4f17173905f8659eca7c1851830bcb59490723fa675dcf9209a01b15980c440979b54a3a157a8af2c5db463455599d1a004c4b40021a0002b301031a0187a2c3a10081825820ff299357a8a7a5a9f0a9df6d39a4148be13974e509fa67d721f80078b30e68e958406b2a86a89f96f4df0cf17588d0fd93026f0107b65370efb0ac388ce9f096da7e6bf75fcad7d85b247deae18d269368e625c67e12eb085ba2b47036002f1b5902f5f6

> xxd -r -p <<< ${TRANSACTION} > tx.signed.cbor.preprod

Using the project API key, submit the transaction:

> curl -X POST -H "Content-Type: application/cbor" -H "api-key: <project_api_key>" --data-binary @tx.signed.cbor.preprod https://preprod.gomaestro-api.org/v1/txmanager
...
"5cbb3356b9d3f762d82a446445614a7f74a4b87e8fd4f0994d309646d4cf2b11"%

Monitor transaction

Check Transaction Monitoring table:

Check webhook notification on Ngrok's dashboard:

info

Ngrok has a readily available dashboard: http://localhost:4040/inspect/http

Conclusion

This guide discussed how a developer can use Maestro's Transaction Manager to receive webhook notifications about their transactions. Never lose sight of your transactions again!

Sign up to get started for free!