Skip to content

feat(wallet): add helper to compute balance with minimum confirmations#303

Closed
LagginTimes wants to merge 1 commit intobitcoindevkit:masterfrom
LagginTimes:confirmation_depth
Closed

feat(wallet): add helper to compute balance with minimum confirmations#303
LagginTimes wants to merge 1 commit intobitcoindevkit:masterfrom
LagginTimes:confirmation_depth

Conversation

@LagginTimes
Copy link
Contributor

Implements bdk#1942.

Description

This PR adds a new convenience method to bdk_wallet::Wallet for computing balances with a configurable minimum confirmation threshold. This allows applications to easily query wallet balances that only include transactions with a specified number of confirmations.

See: bitcoindevkit/bdk#2007 (review)

Changelog notice

  • Added balance_with_confirmation_depth() method to compute balance with a user-defined minimum number of confirmations.

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

@coveralls
Copy link

Pull Request Test Coverage Report for Build 17173539231

Details

  • 18 of 18 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 84.947%

Totals Coverage Status
Change from base Build 17132535147: 0.04%
Covered Lines: 6687
Relevant Lines: 7872

💛 - Coveralls

Copy link
Collaborator

@ValuedMammal ValuedMammal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should tackle #273 before going ahead with this.

@LagginTimes LagginTimes marked this pull request as draft September 1, 2025 06:18
@ValuedMammal
Copy link
Collaborator

bitcoindevkit/bdk#2029 added a min-confs parameter to CanonicalView::balance which should be available in version 0.24.0 of bdk_chain. There's also a version of what this will look like in bdk_wallet#318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants