-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Which crate is this feature request for (if any)?
payjoin-ffi
Question
Hey there,
As part of my BOSS 2026 project I am working on proving out the Javascript FFI bindings. My first step has been building out a plain node project that essentially recreates the payjoin-cli functionality just to get a feel for the bindings api (all this bindings stuff is totally foreign to me).
My question is in regards to the callback method within the CanBroadcast trait here:
rust-payjoin/payjoin-ffi/src/receive/mod.rs
Lines 631 to 634 in 6c3a3e4
| pub trait CanBroadcast: Send + Sync { | |
| fn callback(&self, tx: Vec<u8>) -> Result<bool, ForeignError>; | |
| } | |
When the bindings are generated in javascript it is forcing a non async function to be used as the callback. Is it realistic to expect this to be a non async function in javascript?
My current implementation was planning to call the bitcoin-cli testmempoolaccept to implement the callback method but I do not know of a non async way of doing this. Was there better recommended way of implementing callback?
Thanks!