Draft PR to add a new /address/:address/utxo/recent REST API endpoint, which returns the most recent utxos_limit confirmed utxos for the given address, plus all unconfirmed utxos, sorted in descending order of confirmation status & block height.
Motivation
Unlike the existing /address/:address/utxo endpoint, this new API retrieves UTXOs by scanning address history in reverse chronological order, which means it can return early with useful data once it hits one of the resource limits, rather than throwing errors on addresses with excessive activity.
This makes it more suitable for e.g. utxo charts and visualizations.
Implementation
The PR also adds a new config parameter utxos_history_limit, which defines the maximum number of transaction history entries to process while looking up utxos. If an address's utxos are buried beneath more than this number of history entries, the API may return early with fewer than utxos_limit confirmed utxos.
Results are cached under a new cache_db key prefix b'R'.
Draft PR to add a new
/address/:address/utxo/recent
REST API endpoint, which returns the most recentutxos_limit
confirmed utxos for the given address, plus all unconfirmed utxos, sorted in descending order of confirmation status & block height.Motivation
Unlike the existing
/address/:address/utxo
endpoint, this new API retrieves UTXOs by scanning address history in reverse chronological order, which means it can return early with useful data once it hits one of the resource limits, rather than throwing errors on addresses with excessive activity.This makes it more suitable for e.g. utxo charts and visualizations.
Implementation
The PR also adds a new config parameter
utxos_history_limit
, which defines the maximum number of transaction history entries to process while looking up utxos. If an address's utxos are buried beneath more than this number of history entries, the API may return early with fewer thanutxos_limit
confirmed utxos.Results are cached under a new cache_db key prefix
b'R'
.Todo