Hanzo
Hanzo Skills Reference

Hanzo Web3 - Blockchain API for 100+ Chains

Hanzo Web3 is the blockchain infrastructure layer of the Hanzo ecosystem.

Overview

Hanzo Web3 is the blockchain infrastructure layer of the Hanzo ecosystem. It provides unified API access to 100+ EVM and non-EVM chains including Ethereum, Solana, Base, Arbitrum, Polygon, Lux, and more. Node RPC, structured data, webhooks, smart wallets, and Solana-specific APIs are all available through a single API key.

Why Hanzo Web3?

  • One key, 100+ chains: No per-chain configuration or separate providers
  • Structured data: Token balances, NFT metadata, portfolio views without indexing
  • Push notifications: Managed webhooks for onchain events
  • Account abstraction: ERC-4337 smart wallets with gas sponsorship
  • Solana native: Yellowstone gRPC, DAS, and WebSocket support
  • Part of Hanzo ecosystem: Integrates with Hanzo Chat, Commerce, Console, and MCP

When to use

Use this skill when:

  • The user wants to read or write blockchain data
  • The user needs token balances, NFT metadata, or transaction history
  • The user wants to deploy or interact with smart contracts
  • The user needs real-time onchain event notifications via webhooks
  • The user wants to set up smart wallets or account abstraction

Hard requirements

  1. API Key required. If HANZO_WEB3_API_KEY is not set, tell the user to get one free at https://web3.hanzo.ai/dashboard, or switch to the hanzo-web3-gateway skill for keyless access.
  2. Never expose the API key in user-visible output, logs, or screenshots.
  3. Rate limits apply. Free tier: 25 req/s, PAYG: 300 req/s. Respect 429 responses with exponential backoff.

Preflight checks

Before making any request, silently verify:

  • HANZO_WEB3_API_KEY environment variable is set and non-empty
  • If unset, suggest: export HANZO_WEB3_API_KEY=<your-key>

Quick reference

ItemValue
Base URLhttps://api.web3.hanzo.ai/v1
Auth headerX-API-Key: ${HANZO_WEB3_API_KEY}
Alt authURL path: https://api.web3.hanzo.ai/v1/${HANZO_WEB3_API_KEY}/eth/mainnet
WebSocketwss://ws.web3.hanzo.ai/v1/${HANZO_WEB3_API_KEY}
Statushttps://status.web3.hanzo.ai
Docshttps://web3.hanzo.ai/docs
Dashboardhttps://web3.hanzo.ai/dashboard

Network names

ChainNetwork IDMainnetTestnet
Ethereumetheth/mainneteth/sepolia, eth/holesky
Basebasebase/mainnetbase/sepolia
Arbitrumarbarb/mainnetarb/sepolia
Polygonpolygonpolygon/mainnetpolygon/amoy
Optimismoptopt/mainnetopt/sepolia
Solanasolsol/mainnetsol/devnet
Luxluxlux/mainnetlux/testnet
Avalancheavaxavax/mainnetavax/fuji
BNB Chainbscbsc/mainnetbsc/testnet
90+ more...See docsSee docs

One-file quickstart

Get latest block number (Ethereum)

curl -X POST https://api.web3.hanzo.ai/v1/eth/mainnet \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ${HANZO_WEB3_API_KEY}" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Get token balances

curl "https://api.web3.hanzo.ai/v1/data/tokens/balances?address=0x...&network=eth/mainnet" \
  -H "X-API-Key: ${HANZO_WEB3_API_KEY}"

Get NFT metadata

curl "https://api.web3.hanzo.ai/v1/data/nfts?owner=0x...&network=eth/mainnet" \
  -H "X-API-Key: ${HANZO_WEB3_API_KEY}"

Create webhook

curl -X POST https://api.web3.hanzo.ai/v1/webhooks \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ${HANZO_WEB3_API_KEY}" \
  -d '{
    "url": "https://your-server.com/webhook",
    "network": "eth/mainnet",
    "event_type": "address_activity",
    "addresses": ["0x..."]
  }'

Python (with Hanzo SDK)

from hanzo import Hanzo

client = Hanzo()  # uses HANZO_WEB3_API_KEY from env

# JSON-RPC
block = client.web3.rpc("eth/mainnet", method="eth_blockNumber")

# Structured data
balances = client.web3.tokens.balances(
    address="0x...",
    network="eth/mainnet"
)

# Webhooks
hook = client.web3.webhooks.create(
    url="https://your-server.com/webhook",
    network="eth/mainnet",
    event_type="address_activity",
    addresses=["0x..."]
)

Endpoint selector

TaskEndpointMethod
JSON-RPC callPOST /v1/{network}POST
Get token balancesGET /v1/data/tokens/balancesGET
Get token pricesGET /v1/data/tokens/pricesGET
Get token metadataGET /v1/data/tokens/metadataGET
Get NFTs by ownerGET /v1/data/nftsGET
Get NFT metadataGET /v1/data/nfts/metadataGET
Get transfersGET /v1/data/transfersGET
Get transaction historyGET /v1/data/transactionsGET
Get portfolioGET /v1/data/portfolioGET
Create webhookPOST /v1/webhooksPOST
List webhooksGET /v1/webhooksGET
Delete webhookDELETE /v1/webhooks/{id}DELETE
WebSocket subscribeWS /v1/{api_key}WS
Smart wallet createPOST /v1/wallets/createPOST
Smart wallet executePOST /v1/wallets/executePOST
Gas estimatePOST /v1/gas/estimatePOST
Simulate transactionPOST /v1/simulatePOST

Skill map

Node APIs

Core JSON-RPC access for 100+ chains with load balancing and automatic failover.

EndpointDescription
POST /v1/{network}Standard JSON-RPC proxy (eth_call, eth_sendRawTransaction, etc.)
POST /v1/{network}/debugDebug namespace (debug_traceTransaction, debug_traceCall)
POST /v1/{network}/traceTrace namespace (trace_block, trace_transaction)
WS /v1/{api_key}WebSocket for subscriptions (newHeads, logs, pendingTransactions)

Data APIs

Structured onchain data across tokens, NFTs, transfers, and portfolio views.

EndpointDescription
GET /v1/data/tokens/balancesERC-20 balances for any address
GET /v1/data/tokens/pricesReal-time token prices (USD, ETH, BTC)
GET /v1/data/tokens/metadataToken name, symbol, decimals, logo
GET /v1/data/nftsNFTs owned by address
GET /v1/data/nfts/metadataNFT metadata, media, traits
GET /v1/data/transfersToken and NFT transfer history
GET /v1/data/transactionsFull transaction history
GET /v1/data/portfolioAggregated portfolio across chains

Solana APIs

High-throughput Solana access with Yellowstone gRPC and DAS.

EndpointDescription
POST /v1/sol/mainnetSolana JSON-RPC
gRPC /v1/sol/yellowstoneYellowstone gRPC streams (accounts, transactions, blocks)
POST /v1/sol/dasDigital Asset Standard API (compressed NFTs, Metaplex)
WS /v1/sol/wsSolana WebSocket subscriptions

Webhooks

Push-based notifications for onchain events with managed delivery.

EndpointDescription
POST /v1/webhooksCreate webhook subscription
GET /v1/webhooksList active webhooks
GET /v1/webhooks/{id}Get webhook details
DELETE /v1/webhooks/{id}Delete webhook
POST /v1/webhooks/{id}/testSend test event

Supported event types: address_activity, token_transfer, nft_transfer, new_block, contract_event, pending_transaction.

Smart Wallets

ERC-4337 account abstraction with gas sponsorship and social login.

EndpointDescription
POST /v1/wallets/createCreate smart wallet
POST /v1/wallets/executeExecute user operation
POST /v1/wallets/batchBatch multiple operations
POST /v1/gas/estimateEstimate gas for user operation
POST /v1/gas/sponsorSponsor gas for user

Recipes

Practical integration patterns.

RecipeDescription
Token swap monitoringWatch DEX swaps and notify on price impact
NFT mint trackerAlert when new NFTs are minted in a collection
Wallet portfolioBuild multi-chain portfolio dashboard
Transaction relaySubmit and track transactions with retry logic
Airdrop checkerCheck eligibility across protocols

MCP Integration

Expose Hanzo Web3 as MCP tools for agentic workflows:

import { MCPServer, Tool } from '@hanzo/mcp'

const web3Tools: Tool[] = [
  {
    name: 'web3_rpc',
    description: 'Execute JSON-RPC call on any supported chain',
    parameters: {
      network: { type: 'string', required: true },
      method: { type: 'string', required: true },
      params: { type: 'array', default: [] }
    },
    async execute({ network, method, params }) {
      const res = await fetch(`https://api.web3.hanzo.ai/v1/${network}`, {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'X-API-Key': process.env.HANZO_WEB3_API_KEY
        },
        body: JSON.stringify({ jsonrpc: '2.0', method, params, id: 1 })
      })
      return await res.json()
    }
  },
  {
    name: 'web3_token_balances',
    description: 'Get token balances for an address',
    parameters: {
      address: { type: 'string', required: true },
      network: { type: 'string', default: 'eth/mainnet' }
    },
    async execute({ address, network }) {
      const res = await fetch(
        `https://api.web3.hanzo.ai/v1/data/tokens/balances?address=${address}&network=${network}`,
        { headers: { 'X-API-Key': process.env.HANZO_WEB3_API_KEY } }
      )
      return await res.json()
    }
  }
]

Error handling

CodeMeaningAction
200SuccessProcess response
400Bad requestCheck parameters
401UnauthorizedCheck API key
429Rate limitedExponential backoff (1s, 2s, 4s, 8s, max 30s)
500Server errorRetry up to 3 times
502/503Upstream errorRetry with different endpoint

How is this guide?

Last updated on

On this page