Skip to main content

API v2 Migration Guide

The main differences between the new v2 API and the deprecated v1 API are:

  • The new API is RESTful instead of RPC-based.
  • All requests use the GET method and so may be made easily from any browser.
  • The new API has fewer filters, but is optimized for the new log-structure database architecture.

The v2 API also has HTTP Basic Authentication disabled by default.

The following is a table of equivalent endpoints to help you easily migrate to the new version:

Table of Equivalences between API v1 and v2

Get Ledger State

API v1API v2
get_assets/assets
/assets/<asset>
/events/ASSET_CREATION
/blocks/<int:block_index>/events/ASSET_CREATION
get_balances/assets/<asset>/balances
/addresses/<address>/balances
/addresses/<address>/balances/<asset>
/assets/<asset>/balances/<address>
get_credits/blocks/<int:block_index>/credits
/addresses/<address>/credits
/assets/<asset>/credits
/events/CREDIT
/blocks/<int:block_index>/events/CREDIT
get_debits/blocks/<int:block_index>/debits
/addresses/<address>/debits
/assets/<asset>/debits
/events/DEBIT
/blocks/<int:block_index>/events/DEBIT
get_bets/addresses/<feed_address>/bets
/bets/<tx_hash>
/events/OPEN_BET
/blocks/<int:block_index>/events/OPEN_BET
get_bet_matches/bets/<tx_hash>/matches
/events/BET_MATCH
/blocks/<int:block_index>/events/BET_MATCH
get_broadcasts/addresses/<feed_address>/broadcasts
/events/BROADCAST
/blocks/<int:block_index>/events/BROADCAST
get_btcpays/orders/<tx_hash>/btcpays
/events/BTC_PAY
/blocks/<int:block_index>/events/BTC_PAY
get_burns/addresses/<address>/burns
/burns
/events/BURN
/blocks/<int:block_index>/events/BURN
get_cancels/blocks/<int:block_index>/cancels
/events/CANCEL_BET
/blocks/<int:block_index>/events/CANCEL_BET
/events/CANCEL_ORDER
/blocks/<int:block_index>/events/CANCEL_ORDER
/events/CANCEL_RPS
/blocks/<int:block_index>/events/CANCEL_RPS
get_destructions/blocks/<int:block_index>/destructions
/events/ASSET_DESTRUCTION
/blocks/<int:block_index>/events/ASSET_DESTRUCTION
get_dividends/assets/<asset>/dividends
/events/ASSET_DIVIDEND
/blocks/<int:block_index>/events/ASSET_DIVIDEND
get_issuances/blocks/<int:block_index>/issuances
/assets/<asset>/issuances
/events/ASSET_ISSUANCE
/blocks/<int:block_index>/events/ASSET_ISSUANCE
get_orders/assets/<asset>/orders
/orders/<tx_hash>
/events/OPEN_ORDER
/blocks/<int:block_index>/events/OPEN_ORDER
get_order_matches/orders/<tx_hash>/matches
/events/ORDER_MATCH
/blocks/<int:block_index>/events/ORDER_MATCH
get_sends/blocks/<int:block_index>/sends
/assets/<asset>/sends
/addresses/<address>/sends
/addresses/<address>/receives
/addresses/<address>/sends/<asset>
/addresses/<address>/receives/<asset>
/events/SEND
/blocks/<int:block_index>/events/SEND
/events/MPMA_SEND
/blocks/<int:block_index>/events/MPMA_SEND
/events/ENHANCED_SEND
/blocks/<int:block_index>/events/ENHANCED_SEND
get_bet_expirations/blocks/<int:block_index>/expirations
/events/BET_EXPIRATION
/blocks/<int:block_index>/events/BET_EXPIRATION
get_order_expirations/blocks/<int:block_index>/expirations
/events/ORDER_EXPIRATION
/blocks/<int:block_index>/events/ORDER_EXPIRATION
get_bet_match_expirations/blocks/<int:block_index>/expirations
/events/BET_MATCH_EXPIRATION
/blocks/<int:block_index>/events/BET_MATCH_EXPIRATION
get_order_match_expirations/blocks/<int:block_index>/expirations
/events/ORDER_MATCH_EXPIRATION
/blocks/<int:block_index>/events/ORDER_MATCH_EXPIRATION
get_bet_match_resolutions/bets/<tx_hash>/resolutions
/events/BET_MATCH_RESOLUTON
/blocks/<int:block_index>/events/BET_MATCH_RESOLUTON
get_rps/events/OPEN_RPS
/blocks/<int:block_index>/events/OPEN_RPS
get_rpsresolves/events/RPS_RESOLVE
/blocks/<int:block_index>/events/RPS_RESOLVE
get_rps_matches/events/RPS_MATCH
/blocks/<int:block_index>/events/RPS_MATCH
get_rps_expirations/blocks/<int:block_index>/expirations
/events/RPS_EXPIRATION
/blocks/<int:block_index>/events/RPS_EXPIRATION
get_rps_match_expirations/blocks/<int:block_index>/expirations
/events/RPS_MATCH_EXPIRATION
/blocks/<int:block_index>/events/RPS_MATCH_EXPIRATION
get_sweeps/addresses/<address>/sweeps
/blocks/<int:block_index>/sweeps
/events/SWEEP
/blocks/<int:block_index>/events/SWEEP
get_dispensers/assets/<asset>/dispensers
/asset/<asset>/dispensers/<address>
/addresses/<address>/dispensers
/addresses/<address>/dispensers/<asset>
/dispensers/<tx_hash>
/events/OPEN_DISPENSER
/blocks/<int:block_index>/events/OPEN_DISPENSER
get_dispenses/blocks/<int:block_index>/dispenses
/dispensers/<tx_hash>/dispenses
/events/DISPENSE
/blocks/<int:block_index>/events/DISPENSE
get_transactions/blocks/<int:block_index>/transactions
/transactions/<tx_hash>
/events/NEW_TRANSACTION
/blocks/<int:block_index>/events/NEW_TRANSACTION
get_messages/blocks/<int:block_index>/events
/blocks/<int:block_index>/events/<event>
/events/<event>
get_messages_by_index/events/<int:event_index>
get_supply/assets/<asset>
get_xcp_supply/assets/XCP
get_asset_info/assets/<asset>
get_block_info/blocks/<int:block_index>
/blocks/<int:block_index>/events
get_blocks/blocks
get_asset_names/assets
get_asset_longnames/assets
get_holder_count/assets/<asset>
get_holders/assets/<asset>/holders
get_dispenser_info/dispensers/<tx_hash>
get_mempool/mempool/events
/mempool/events/<event>
get_element_counts/blocks/<int:block_index>/events/counts
/events/counts
sqlNA

Compose and Parse Transactions

API v1API v2
create_bet/addresses/<address>/compose/bet
create_broadcast/addresses/<address>/compose/broadcast
create_btcpay/addresses/<address>/compose/btcpay
create_burn/addresses/<address>/compose/burn
create_cancel/addresses/<address>/compose/cancel
create_destroy/addresses/<address>/compose/destroy
create_dividend/addresses/<address>/compose/dividend
create_issuance/addresses/<address>/compose/issuance
create_order/addresses/<address>/compose/order
create_send/addresses/<address>/compose/send
create_rpsN/A
create_rpsresolveN/A
create_sweep/addresses/<address>/compose/sweep
create_dispenser/addresses/<address>/compose/dispenser
get_tx_info/transactions/info
unpack/transactions/unpack

Get Server State

API v1API v2
get_running_info/
/healthz/healthz

Backend Proxy

API v1API v2
search_raw_transactions/backend/addresses/<address>/transactions
get_oldest_tx/backend/addresses/<address>/transactions/oldest
get_unspent_txouts/backend/addresses/<address>/utxos
getrawtransaction/backend/transactions/<tx_hash>
getrawtransaction_batch/backend/transactions
search_pubkey/backend/addresses/<address>/pubkey
fee_per_kb/backend/estimatesmartfee