Introduction to Hiro tools
Learn more about our tools and how to use them together.
Overview
Core tools for building and testing smart contracts:
- Clarinet - Local blockchain development environment
- Clarinet JS SDK - JavaScript testing framework
- Stacks.js - Frontend integration library
- Chainhook - Event-driven blockchain applications
API services
Query blockchain data without running infrastructure:
- Stacks Blockchain API - RESTful blockchain queries
- Token Metadata API - NFT and token metadata
- Ordinals API - Bitcoin inscriptions data
- Runes API - Bitcoin fungible tokens
Platform services
Cloud-based tools for teams and production:
- Hiro Platform - Cloud development environment
- Contract Monitoring - Real-time alerts and metrics
- Hosted Devnets - Isolated test environments
Integrations
How our tools connect and complement each other:
Tool | Integrates With | How They Work Together |
---|---|---|
Clarinet | Stacks.js | Deploy contracts locally, connect frontend |
Clarinet | Chainhook | Test event handling in development |
Stacks.js | Stacks API | Submit 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 backendapp.post('/webhook', (req, res) => {const { apply } = req.body;const transactions = apply[0].transactions;// Process event, update databasedb.save(transactions);});
Tool flow: Chainhook → Your backend
Bitcoin applications
Build on Bitcoin L1 protocols:
# 1. Query existing datacurl https://api.hiro.so/ordinals/v1/inscriptions# 2. Or create custom indexesbitcoin-indexer --config my-protocol.json
// 3. Display in frontendconst inscriptions = await fetch('https://api.hiro.so/ordinals/v1/inscriptions');
Tool flow: Ordinals / Runes APIs / Bitcoin Indexer → Your backend
Decision matrix
If You're Building | Use These Tools | Why |
---|---|---|
Smart contract app | Clarinet + Stacks.js + API | Complete dev-to-production flow |
NFT marketplace | Clarinet + Stacks.js + API + Token Metadata API | Automatic metadata handling |
Bitcoin explorer | Ordinals/Runes APIs | Pre-indexed Bitcoin data |
Analytics dashboard | APIs + Chainhook | Historical + real-time data |
Custom protocol | Chainhook + Bitcoin Indexer | Build your own indexes |
Next steps
- Install Clarinet to start building
- Explore API references for integration details
- View example projects on GitHub