API Blockbook
Présentation générale
Blockbook is a blockchain indexer that provides a unified API for querying address balances, transaction history, UTXOs, and block data. Quicknode exposes the Blockbook API as a product, supporting both REST and JSON-RPC interfaces for Zcash.
Comment accéder à Blockbook
To enable Blockbook on your Quicknode endpoint:
- Accédez à votre Quicknode
- Select your Zcash endpoint (or create a new one)
- Accédez à l'onglet « Extensions »
- Open Blockbook in the Quicknode dashboard and enable it
Once enabled, the Blockbook API is accessible via your endpoint URL using this endpoint path: /addon/1149/api/v2/
Interfaces prises en charge
API REST
L'API REST offre une interface HTTP familière, avec des paramètres de chemin et de requête, permettant d'interroger les données de la blockchain.
Base : /addon/1149/api/v2/
Exemple :
curl -X GET \
"https://YOUR_QUICKNODE_ENDPOINT_HERE.com/addon/1149/api/v2/address/t1Hsc1LR8yKnbbe3twRp88p6vFfC5t7DLbs?details=txids"
API JSON-RPC
L'API JSON-RPC encapsule les méthodes de Blockbook sous forme d'appels JSON-RPC standard (par exemple, bb_getAddress, bb_getTx). Cela s'avère utile si votre application utilise déjà JSON-RPC pour d'autres interactions avec la blockchain.
Exemple :
curl -X POST \
"https://YOUR_QUICKNODE_ENDPOINT_HERE.com" \
-H "Content-Type: application/json" \
--data '{"method":"bb_getAddress","params":["t1Hsc1LR8yKnbbe3twRp88p6vFfC5t7DLbs",{"page":1,"size":1000,"details":"txids"}],"id":1,"jsonrpc":"2.0"}'
Mappage des méthodes REST vers RPC
| Endpoint REST | Méthode JSON-RPC |
|---|---|
GET /api/v2/address/{address} | bb_getAddress |
GET /api/v2/balancehistory/{address} | bb_getBalanceHistory |
GET /api/v2/block-index/{blockHeight} | bb_getBlockHash |
GET /api/v2/block/{blockHash} | bb_getBlock |
GET /api/v2/tx/{txid} | bb_getTx |
GET /api/v2/tx-specific/{txid} | bb_getTxSpecific |
GET /api/v2/xpub/{xpub} | bb_getXpub |
GET /api/v2/utxo/{addressOrXpub} | bb_getUTXOs |
GET /api/v2/tickers-list/ | bb_getTickersList |
GET /api/v2/tickers/ | bb_getTickers |
POST /api/v2/sendtx/ | bb_sendTransaction |