Introduction to Hiro tools

Learn more about our tools and how to use them together.


Overview

Core tools for building and testing smart contracts:

API services

Query blockchain data without running infrastructure:

Platform services

Cloud-based tools for teams and production:

Integrations

How our tools connect and complement each other:

ToolIntegrates WithHow They Work Together
ClarinetStacks.jsDeploy contracts locally, connect frontend
ClarinetChainhookTest event handling in development
Stacks.jsStacks APISubmit transactions, query results

Development workflows

Smart contract DApp

Building user-facing applications with smart contracts:

Terminal
$
clarinet new my-project && cd my-project
$
clarinet contract new token
$
clarinet test
$
clarinet devnet start
$
clarinet deployments apply --devnet
import { request } from '@stacks/connect';
const response = await request('stx_callContract', {
contract: 'SP2MF04VAGYHGAZWGTEDW5VYCPDWWSY08Z1QFNDSN.counters',
functionName: 'count',
functionArgs: [Cl.int(3)],
network: 'mainnet',
});
const balance = await fetch(
'https://api.hiro.so/v2/accounts/ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM'
);

Tool flow: Clarinet → Stacks.js → Stacks API

Event-driven backend

React to blockchain events in real-time:

// 1. Create Chainhook predicate
{
"chain": "stacks",
"uuid": "my-hook",
"networks": {
"mainnet": {
"if_this": {
"scope": "contract_call",
"method": "transfer"
},
"then_that": {
"http_post": {
"url": "https://my-api.com/webhook"
}
}
}
}
}
// 2. Handle webhook in your backend
app.post('/webhook', (req, res) => {
const { apply } = req.body;
const transactions = apply[0].transactions;
// Process event, update database
db.save(transactions);
});

Tool flow: Chainhook → Your backend

Bitcoin applications

Build on Bitcoin L1 protocols:

# 1. Query existing data
curl https://api.hiro.so/ordinals/v1/inscriptions
# 2. Or create custom indexes
bitcoin-indexer --config my-protocol.json
// 3. Display in frontend
const inscriptions = await fetch(
'https://api.hiro.so/ordinals/v1/inscriptions'
);

Tool flow: Ordinals / Runes APIs / Bitcoin Indexer → Your backend

Decision matrix

If You're BuildingUse These ToolsWhy
Smart contract appClarinet + Stacks.js + APIComplete dev-to-production flow
NFT marketplaceClarinet + Stacks.js + API + Token Metadata APIAutomatic metadata handling
Bitcoin explorerOrdinals/Runes APIsPre-indexed Bitcoin data
Analytics dashboardAPIs + ChainhookHistorical + real-time data
Custom protocolChainhook + Bitcoin IndexerBuild your own indexes

Next steps