WoC REST¶
WoCREST implements the WhatsOnChain REST API as a Protocol subclass.
External docs: WhatsOnChain API documentation
Commands¶
| Command | Method | Path | Response | Escape hatch |
|---|---|---|---|---|
current_height | GET | /chain/info | lambda | |
get_chain_info | GET | /chain/info | :json | |
get_block_header | GET | /block/{height}/header | :json | |
get_block_headers | GET | /block/headers | :json_array | |
get_circulating_supply | GET | /circulatingsupply | :raw | |
get_chain_tips | GET | /chain/tips | :json_array | |
get_peer_info | GET | /peer/info | :json_array | |
get_tx | GET | /tx/{txid}/hex | :raw | |
get_tx_details | GET | /tx/hash/{txid} | :json | |
get_output_script | GET | /tx/{txid}/out/{index}/hex | :raw | |
get_opreturn | GET | /tx/{txid}/opreturn | :json | |
get_merkle_path | GET | /tx/{txid}/proof/tsc | :json | |
broadcast | POST | /tx/raw | :raw | yes |
decode_tx | POST | /tx/decode | :json | yes |
get_tx_status | POST | /txs/status | :json | yes |
get_tx_hex_bulk | POST | /txs/hex | :json | yes |
get_tx_binary | GET | /tx/{txid}/bin | :raw | |
get_tx_by_block_index | GET | /block/height/{height}/txindex/{txindex} | :json | |
get_tx_propagation | GET | /tx/hash/{txid}/propagation | :json | |
get_bulk_tx_details | POST | /txs | :json | yes |
get_bulk_output_scripts | POST | /txs/vouts/hex | :json | yes |
get_utxos | GET | /address/{address}/confirmed/unspent | :json_array | |
get_utxos_all | GET | /address/{address}/unspent/all | :json_array | |
is_utxo | GET | /tx/{txid}/{vout}/spent | :json | yes |
is_utxo_bulk | POST | /utxos/spent | :json_array | yes |
valid_root | GET | /block/{height}/header | :json | yes |
get_unconfirmed_utxos | GET | /address/{address}/unconfirmed/unspent | :json_array | |
get_confirmed_spent | GET | /tx/{txid}/{vout}/confirmed/spent | :json | |
get_unconfirmed_spent | GET | /tx/{txid}/{vout}/unconfirmed/spent | :json | |
get_bulk_address_utxos | POST | /addresses/confirmed/unspent | :json | yes |
get_bulk_address_unconfirmed_utxos | POST | /addresses/unconfirmed/unspent | :json | yes |
get_script_unspent | GET | /script/{script_hash}/confirmed/unspent | :json_array | |
get_script_history | GET | /script/{script_hash}/confirmed/history | :json_array | |
get_script_all_unspent | GET | /script/{script_hash}/unspent/all | :json_array | |
get_script_unspent_bulk | POST | /scripts/confirmed/unspent | :json | yes |
get_script_unconfirmed_unspent | GET | /script/{script_hash}/unconfirmed/unspent | :json_array | |
get_bulk_script_unconfirmed_unspent | POST | /scripts/unconfirmed/unspent | :json | yes |
get_balance | GET | /address/{address}/confirmed/balance | :json | |
get_unconfirmed_balance | GET | /address/{address}/unconfirmed/balance | :json | |
get_history | GET | /address/{address}/confirmed/history | :json_array | |
is_address_used | GET | /address/{address}/used | :json | |
get_exchange_rate | GET | /exchangerate | :json | |
get_fee_recommendation | GET | /feerecommendation | :json | |
get_mempool_info | GET | /mempool/info | :json | |
get_exchange_rate_historical | GET | /exchangerate/historical | :json_array | |
get_mempool_raw | GET | /mempool/raw | :json_array | |
search_links | POST | /search/links | :json | yes |
get_block_stats | GET | /block/height/{height}/stats | :json | |
get_block_stats_by_hash | GET | /block/hash/{hash}/stats | :json | |
get_miner_block_stats | GET | /miner/blocks/stats | :json | |
get_miner_fees | GET | /miner/fees | :json | |
get_miner_summary | GET | /miner/summary/stats | :json | |
get_block_tag_count | GET | /block/tagcount/height/{height}/stats | :json | |
health | GET | /woc | :raw |
Escape Hatches¶
These commands use custom dispatch logic rather than the default HTTP template.
is_utxo¶
Checks whether a specific output is unspent by querying the WoC spent-status endpoint.
is_utxo_bulk¶
Bulk-checks whether a set of outputs are unspent.
broadcast¶
Broadcasts a raw transaction to WhatsOnChain.
decode_tx¶
Decodes a raw transaction hex by posting to the WoC decode endpoint.
get_tx_hex_bulk¶
Fetches raw hex for multiple transactions in a single request.
get_script_unspent_bulk¶
Fetches confirmed UTXOs for multiple script hashes in a single request.
get_bulk_tx_details¶
Fetches full transaction details for multiple transactions.
get_bulk_output_scripts¶
Fetches output scripts for specific vouts across multiple transactions.
get_bulk_address_utxos¶
Fetches confirmed UTXOs for multiple addresses in a single request.
get_bulk_address_unconfirmed_utxos¶
Fetches unconfirmed UTXOs for multiple addresses in a single request.
get_bulk_script_unconfirmed_unspent¶
Fetches unconfirmed UTXOs for multiple script hashes in a single request.
search_links¶
Searches WhatsOnChain for links matching a query.
get_tx_status¶
Fetches status for multiple transactions.
valid_root¶
Verifies that a merkle root matches the one recorded for a given block height. Uses the get_block_header endpoint internally.