bdk-ffi icon indicating copy to clipboard operation
bdk-ffi copied to clipboard

Create Transaction from hex

Open ItoroD opened this issue 6 months ago • 4 comments

Describe the enhancement

Types like Transaction can create new Transactions by passing in transaction bytes. It will be helpful to also create transactions by passing in the string hex of a transaction.

Use case

  • Create a transaction from a transaction hex.

Additional context

@rustaceanrob hashlike types has useful methods that types like Transaction can benefit from. Like from_string. Could this be a method we add directly to Transaction impl?

ItoroD avatar Jul 07 '25 11:07 ItoroD

This would mirror the PSBT API. I don't see any problem with adding this.

rustaceanrob avatar Jul 07 '25 12:07 rustaceanrob

@ItoroD is this the sort of thing you're looking for https://github.com/bitcoindevkit/bdk-ffi/pull/804/files#diff-c73020e295d654c61c706f3634d67285896d23813c1fb4f5c30ff57c220e154dR337-R343

reez avatar Jul 07 '25 12:07 reez

@ItoroD is this the sort of thing you're looking for https://github.com/bitcoindevkit/bdk-ffi/pull/804/files#diff-c73020e295d654c61c706f3634d67285896d23813c1fb4f5c30ff57c220e154dR337-R343

Yes, Exactly!

ItoroD avatar Jul 07 '25 13:07 ItoroD

@ItoroD is this the sort of thing you're looking for https://github.com/bitcoindevkit/bdk-ffi/pull/804/files#diff-c73020e295d654c61c706f3634d67285896d23813c1fb4f5c30ff57c220e154dR337-R343

Yes, Exactly!

cool it was just as easy for me to write that function in a PR as it was to comment so I figured id just do the PR (especially since the from_string stuff was fresh in my mind from a recent PR of mine). I'll let CI tests pass then add you as a reviewer

reez avatar Jul 07 '25 13:07 reez