rust-payjoin icon indicating copy to clipboard operation
rust-payjoin copied to clipboard

Build new crate to handle I/O

Open DanGould opened this issue 1 year ago • 4 comments

Default ureq I/O could allow for a higher-level payjoin abstraction that handles http requests. For example this could include

  • Sending v1 requests and parsing the response internally
  • Hosting a v1 receiver server with hyper
  • Polling for v2 payjoin requests and handling errors
  • Fetching OHTTP Key Configuration with various bootstrap mechanisms
  • Default persistent storage for V2 session state and previously-seen-input checks

This would allow a us to use a common implementation in payjoin-cli and integration tests as well which would be clean.

Such a crate could even do default BDK / bitcoin core integration for proposal processing.

DanGould avatar Mar 13 '24 00:03 DanGould

I would like to start this please. Probably will have time at the beginning of next week after the conf

jbesraa avatar Mar 13 '24 15:03 jbesraa

Sounds awesome. Fetching OHTTP Keys via CONNECT method in a crate shared between payjoin-cli and tests might be the simplest start that can be closed in a single PR

DanGould avatar Mar 13 '24 18:03 DanGould

Do you wanna keep this open or open new issue for each new functionality added to payjoin-defaults ?

jbesraa avatar May 08 '24 12:05 jbesraa

yes. keep it open until such a solution is actually shipped. That crate is still unreleased.

DanGould avatar May 08 '24 14:05 DanGould

This is done (as a feature) pending merge of #272

DanGould avatar Jun 02 '24 20:06 DanGould

Closed by #271 🎉

https://docs.rs/payjoin/latest/payjoin/io/index.html

DanGould avatar Jun 03 '24 02:06 DanGould