Skip to content

feat: add get_address_utxos method#134

Merged
oleonardolima merged 2 commits intobitcoindevkit:masterfrom
luisschwab:feat/address-addr-utxo-endpoint
Aug 22, 2025
Merged

feat: add get_address_utxos method#134
oleonardolima merged 2 commits intobitcoindevkit:masterfrom
luisschwab:feat/address-addr-utxo-endpoint

Conversation

@luisschwab
Copy link
Copy Markdown
Member

Closes #133.

This PR adds the get_address_utxos method, which hits the /address/{addr}/utxo endpoint, returning a Vec<Utxo>.

Changelog

  • Create UtxoStatus.
  • Create Utxo.
  • Create get_address_utxos for both blocking and async clients.
  • Add a functional test for it.

`get_address_utxos` hits the `/address/{address}/utxo` endpoint
and returns a `Vec<Utxo>`
@luisschwab luisschwab added the enhancement New feature or request label Aug 7, 2025
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 16817757977

Details

  • 27 of 27 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 87.216%

Totals Coverage Status
Change from base Build 16626978737: 0.3%
Covered Lines: 1037
Relevant Lines: 1189

💛 - Coveralls

Copy link
Copy Markdown
Collaborator

@oleonardolima oleonardolima left a comment

Choose a reason for hiding this comment

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

tACK 86d3d44

I've tested it with blocking client, and it worked just fine on both happy path, too many histories error and when it's unconfirmed.

Comment on lines +126 to +129
/// Information about an UTXO's status: confirmation status,
/// confirmation height, confirmation block hash and confirmation block time.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize)]
pub struct UtxoStatus {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding docs here. Question: isn't this the same as the TxStatus type?

Copy link
Copy Markdown
Member Author

@luisschwab luisschwab Aug 19, 2025

Choose a reason for hiding this comment

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

Indeed, structurally they are the same. But I preferred to create another struct with a name that matches what it models. We could change the name of TxStatus to something generic, but I don't think that's very elegant, since these types are ad-hoc to what the API returns.

Copy link
Copy Markdown
Collaborator

@oleonardolima oleonardolima left a comment

Choose a reason for hiding this comment

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

ACK 86d3d44

@oleonardolima oleonardolima merged commit 0cef6a9 into bitcoindevkit:master Aug 22, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Done in BDK Chain Aug 22, 2025
chrono-raven6i90 added a commit to chrono-raven6i90/rust-esplora-client that referenced this pull request Oct 28, 2025
…txos` method

86d3d4473eef0f401f9d5cf840ba15bd1d1090c7 feat(client): add `get_address_utxos()` (Luis Schwab)
3c8b6e3976c0d8b410a4806b47fa3c37c6d0a812 feat(api): create `UtxoStatus` and `Utxo` structs (Luis Schwab)

Pull request description:

  Closes #133.

  This PR adds the `get_address_utxos` method, which hits the `/address/{addr}/utxo` endpoint, returning a `Vec<Utxo>`.

  # Changelog
  - Create `UtxoStatus`.
  - Create `Utxo`.
  - Create `get_address_utxos` for both blocking and async clients.
  - Add a functional test for it.

ACKs for top commit:
  oleonardolima:
    ACK 86d3d4473eef0f401f9d5cf840ba15bd1d1090c7

Tree-SHA512: 9fa3e210be06d47e350d1afe01ab6b5c9173a2504ae769c6af364a1badbeb93034e3d053ebc95a8605030ba87dac264772c0c1a277561671a7a84b9d6a3f628d
@luisschwab luisschwab deleted the feat/address-addr-utxo-endpoint branch November 18, 2025 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat: /address/:address/utxo

4 participants