Skip to content

Add property for estimated balance to balances endpoint #2035

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:

  1. fetch balance from api.hiro.so/extended/v1/address/<address>/balances
  2. fetch pending txs from api.hiro.so/extended/v1/tx/mempool?address=<address>&limit=50
  3. 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

Metadata

Type

No type

Projects

  • Status

    ✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions