Balances and UTXOs of many addresses

POST/esplora/api/wallet/addresses

Wallet API v1.0.0 · Wallet batch

Not part of Esplora. One entry per requested address, in request order (duplicates included). An entry has either the data or an error, never neither, so a missing result is never mistaken for a zero balance. The data is exactly what GET /address/{address} and GET /address/{address}/utxo return; tx_count tells used-but-empty addresses apart, for gap-limit discovery. The whole request answers from one view: send view back on the next call of the same sync, to the same host, and every batch describes the same moment. Limits: 1 to 500 addresses, at most 20 000 UTXOs in the reply, body up to 128 KB, 2 requests per second per IP (burst 30).

Example

curl -X POST 'https://api.tensorcash.org/esplora/api/wallet/addresses' \
  -H 'Content-Type: application/json' \
  --data '{"addresses":["tc1qmvalge7mnhct9qj5uua8rn0dmjcyh6fmvrr46j"]}'

Parameters

No parameters.

Request body

Responses

StatusDescriptionBody
200One entry per requested address
400Bad body, more than 500 addresses, or more than 20 000 UTXOs in the reply
  • text/plain string
410view expired: restart the sync without view
  • text/plain string
413Body over 128 KB
  • text/plain string
503Index syncing: n/m
  • text/plain string

Schemas

WalletAddressesRequest

FieldTypeRequiredDescription
addressesstring[]Yes1 to 500 addresses.
viewstring—Optional: the view of an earlier response from the same host, to answer from that state.

WalletAddressesResponse

FieldTypeRequiredDescription
tipTipYes
viewstringYesOpaque id of the state this answer comes from. Send it back to pin later calls to it.
addressesWalletAddressEntry | AddressError[]YesOne entry per requested address, in request order.

Tip

FieldTypeRequiredDescription
heightintegerYes
hashstringYes

WalletAddressEntry

FieldTypeRequiredDescription
addressstringYes
chain_statsChainStatsYes
mempool_statsChainStatsYes
utxoUtxo[]Yes

ChainStats

FieldTypeRequiredDescription
funded_txo_countintegerYesOutputs received.
funded_txo_sumintegerYesSatoshis received.
spent_txo_countintegerYesOutputs spent.
spent_txo_sumintegerYesSatoshis spent.
tx_countintegerYesTransactions touching the address.

Utxo

FieldTypeRequiredDescription
txidstringYes
voutintegerYes
statusTxStatusYes
valueintegerYesSatoshis.

TxStatus

FieldTypeRequiredDescription
confirmedbooleanYesFalse while the transaction is in the mempool.
block_heightinteger—Confirmed only.
block_hashstring—Confirmed only.
block_timeinteger—Block timestamp, Unix seconds. Confirmed only.

AddressError

FieldTypeRequiredDescription
addressstringYes
errorstringYesInvalid address, or Too many unspent transaction outputs (>5000).
Source
tensorcash-wallet-api (tensorcash-api) v1.0.0 (772799e) · bobponey · MIT