Skip to content

Comments

feat(client)!: update broadcast API #151

Merged
oleonardolima merged 1 commit intobitcoindevkit:masterfrom
oleonardolima:refactor/broadcast-api-to-return-txid
Feb 13, 2026
Merged

feat(client)!: update broadcast API #151
oleonardolima merged 1 commit intobitcoindevkit:masterfrom
oleonardolima:refactor/broadcast-api-to-return-txid

Conversation

@oleonardolima
Copy link
Collaborator

@oleonardolima oleonardolima commented Dec 19, 2025

Description

It's a remaining follow-up from #114, it does the remaining breaking change to broadcast API.

Changelog Notice

### Changed

BREAKING CHANGE: changes the `broadcast` method to return the `txid` for
broadcasted transaction, on both `AsyncClient` and `BlockingClient`.

@oleonardolima oleonardolima self-assigned this Dec 19, 2025
@oleonardolima oleonardolima added the enhancement New feature or request label Dec 19, 2025
@coveralls
Copy link

coveralls commented Dec 19, 2025

Pull Request Test Coverage Report for Build 21957871465

Details

  • 37 of 37 (100.0%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.5%) to 87.25%

Files with Coverage Reduction New Missed Lines %
src/blocking.rs 1 76.76%
Totals Coverage Status
Change from base Build 21934953145: 0.5%
Covered Lines: 1437
Relevant Lines: 1647

💛 - Coveralls

oleonardolima added a commit that referenced this pull request Jan 5, 2026
…ync client

cf64f97 feat(client): add new `submit_package` API (acidbunny21)

Pull request description:

  ### Description

  Add new `submit_package` method to both `BlockingClient` and `AsyncClient`, as it's now supported by Esplora API, see: Blockstream/electrs#119, Blockstream/electrs#159. Also, adds new `SubmitPackageResult`, `TxResult`, and `MempoolFeesSubmitPackage` API structures.

  It updates the internal `post_request_hex` method to `post_request_bytes`, now handling `query_params` and having `Response` as return type. Additionally, updates the internals of `broadcast` to utilize the new `post_request` and `post_request_bytes` without breaking its API.

  ### Notes to the reviewers

  As mentioned in the PR comments, I updated the original commit by `@acidbunny21` by:
  - (i) adding `@ValuedMammal`'s suggested fixes;
  - (ii) removing the breaking change on the `broadcast` API, it's now a follow-up in #151.

  ### Changelog notice

  ```
  ### Added

  - feat(client): add new `submit_package` API to `BlockingClient` and `AsyncClient`
  - feat(api): add new `SubmitPackageResult`, `TxResult`, and `MempoolFeesSubmitPackage` API structures

  ### Changed

  - feat(client): update the `post_request_hex` method to `post_request_bytes`, now handling `query_params` and having `Response` as return type.
  - feat(client): update the internals of the  `broadcast` method to use new `post_request` and `post_request_bytes`, with no breaking change.
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `just p` before pushing

  #### New Features:

  * [ ] I've added tests for the new feature
  > The PR does not add new tests for the `submit_package` API, as it's not yet supported by `electrsd`, it's tracked by: #152
  * [x] I've added docs for the new feature

ACKs for top commit:
  ValuedMammal:
    ACK cf64f97; used `git range-diff`
  luisschwab:
    re-ACK cf64f97

Tree-SHA512: cfc0a4ad3d119f52e503facbfcb3666c9fa521707d76016cb506bc4ad5261e0a9d1e9fdfcfcaa6de329b44535bc428c76d7dba47e437a0877a828786420ac1a3
@tnull
Copy link
Contributor

tnull commented Feb 10, 2026

Any update on this? Would be great to have this in an upcoming rust-esplora-client release as we want to lean on submitpackage support soon. Let me know if you'd prefer me to take this one over.

@oleonardolima
Copy link
Collaborator Author

Any update on this? Would be great to have this in an upcoming rust-esplora-client release as we want to lean on submitpackage support soon. Let me know if you'd prefer me to take this one over.

@tnull The new submit_package API is already supported on the recent esplora-client v0.12.2, this one is addressing a follow-up that required a breaking change and will be on v0.13.0.

@oleonardolima oleonardolima moved this to In Progress in BDK Chain Feb 10, 2026
@tnull
Copy link
Contributor

tnull commented Feb 11, 2026

Any update on this? Would be great to have this in an upcoming rust-esplora-client release as we want to lean on submitpackage support soon. Let me know if you'd prefer me to take this one over.

@tnull The new submit_package API is already supported on the recent esplora-client v0.12.2, this one is addressing a follow-up that required a breaking change and will be on v0.13.0.

Ah, thanks, didn't realize that.

@oleonardolima oleonardolima force-pushed the refactor/broadcast-api-to-return-txid branch from 8e05c29 to c7ec977 Compare February 11, 2026 23:17
@oleonardolima oleonardolima moved this from In Progress to Needs Review in BDK Chain Feb 11, 2026
@oleonardolima oleonardolima marked this pull request as ready for review February 11, 2026 23:20
@luisschwab
Copy link
Member

Also missing a test to assert broadcast returns a Txid.

@oleonardolima oleonardolima force-pushed the refactor/broadcast-api-to-return-txid branch 3 times, most recently from 6801fb2 to 772d145 Compare February 11, 2026 23:54
@oleonardolima
Copy link
Collaborator Author

oleonardolima commented Feb 11, 2026

I did amend the suggestion and the new test into 772d145

luisschwab

This comment was marked as outdated.

@luisschwab luisschwab self-requested a review February 12, 2026 17:11
- updates the return type of `broadcast` API.

BREAKING CHANGE: changes the `broadcast` method to return the `txid` for
broadcasted transaction, on both `AsyncClient` and `BlockingClient`.
@oleonardolima oleonardolima force-pushed the refactor/broadcast-api-to-return-txid branch from 772d145 to 90b8a6e Compare February 12, 2026 17:48
Copy link
Contributor

@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.

ACK 90b8a6e

Copy link
Member

@luisschwab luisschwab left a comment

Choose a reason for hiding this comment

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

ACK 90b8a6e

@oleonardolima oleonardolima merged commit 3224994 into bitcoindevkit:master Feb 13, 2026
26 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Done in BDK Chain Feb 13, 2026
@oleonardolima oleonardolima deleted the refactor/broadcast-api-to-return-txid branch February 13, 2026 00:19
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.

5 participants