Closed
Description
As discussed here, Leather would benefit from an estimated_balance
property in addition to the balance
as returned by the balances
endpoint for a given Stacks address.
This estimated balance would subtract the total of all outbound transfers from its confirmed balance for a given address.
Leather currently calculates such a balance through two separate queries and a final calculation:
- fetch balance from
api.hiro.so/extended/v1/address/<address>/balances
- fetch pending txs from
api.hiro.so/extended/v1/tx/mempool?address=<address>&limit=50
- do calculation:
availableBalance = balance - sum of all outbound transaction amounts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment