Merged history of many addresses

POST/esplora/api/wallet/history

Wallet API v1.0.0 · Wallet batch

Not part of Esplora. One list, newest first (block height, then position in the block); a transaction touching several of the addresses appears once. Each entry is the Esplora transaction object. The first page (cursor: null) also returns the unconfirmed transactions of these addresses, up to 200; while mempool_complete is true it is the whole unconfirmed set, so a refresh replaces the wallet's unconfirmed list. Later pages, requested with next_cursor and the same address set, read the chain only up to snapshot, so new blocks never shift entries between pages. If a reorganization removed the snapshot block the cursor expires (409). Limits: 1 to 500 addresses, limit 1 to 100, a page also ends early past 2 MB of JSON, 2 requests per second per IP (burst 30).

Example

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

Parameters

No parameters.

Request body

Responses

StatusDescriptionBody
200One page of merged history
400Bad body, limit or cursor; a cursor made for another address set or view; more than 500 addresses
  • text/plain string
409Cursor expired: the chain reorganized; start again without a cursor
  • text/plain string
410view expired
  • text/plain string
413Body over 128 KB
  • text/plain string
502A node lookup failed
  • text/plain string
503Index syncing: n/m
  • text/plain string

Schemas

WalletHistoryRequest

FieldTypeRequiredDescription
addressesstring[]Yes1 to 500 addresses.
limitinteger—Confirmed transactions per page.
cursorstring | null—null for the first page, else the previous next_cursor.
viewstring—Optional: the view of an earlier response from the same host.

WalletHistoryResponse

FieldTypeRequiredDescription
tipTipYes
viewstringYes
snapshotTipYes
errorsAddressError[]YesOne entry per invalid address; the rest of the request is still served.
mempoolTransaction[]—First page only: unconfirmed transactions, newest first, up to 200.
mempool_completeboolean—First page only: false when mempool was cut.
txsTransaction[]YesConfirmed, newest first.
next_cursorstring | nullYesnull when there is no older history.

Tip

FieldTypeRequiredDescription
heightintegerYes
hashstringYes

AddressError

FieldTypeRequiredDescription
addressstringYes
errorstringYesInvalid address, or Too many unspent transaction outputs (>5000).

Transaction

FieldTypeRequiredDescription
txidstringYes
versionintegerYes
locktimeintegerYes
vinTxIn[]Yes
voutTxOut[]Yes
sizeintegerYesBytes.
weightintegerYesWeight units.
feeintegerYesSatoshis.
statusTxStatusYes

TxIn

FieldTypeRequiredDescription
txidstringYesSpent transaction; 64 zeros for a coinbase input.
voutintegerYesSpent output index; 4294967295 for a coinbase input.
prevoutTxOut | nullYesThe output this input spends; null for a coinbase input.
scriptsigstringYesInput script, hex (the coinbase data for a coinbase input).
scriptsig_asmstringYes
is_coinbasebooleanYes
witnessstring[]—Witness stack, hex items. Present when not empty.
sequenceintegerYes

TxOut

FieldTypeRequiredDescription
scriptpubkeystringYesOutput script, hex.
scriptpubkey_asmstringYesOutput script in bcore's asm format (not Esplora's OP_PUSHBYTES_n form).
scriptpubkey_type"p2pkh" | "p2sh" | "v0_p2wpkh" | "v0_p2wsh" | "v1_p2tr" | "op_return" | "p2pk" | "multisig" | "anchor" | "unknown"Yes
scriptpubkey_addressstring—Present when the script has an address.
valueintegerYesAmount in satoshis.

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.
Source
tensorcash-wallet-api (tensorcash-api) v1.0.0 (772799e) · bobponey · MIT