-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send Payjoin #365
Send Payjoin #365
Conversation
rebased on upstream/main |
Thanks for the rebase. |
There is a bug in here where after multiple sends the sender will throw: flutter: BdkError.electrum(field0: Electrum server error: "sendrawtransaction RPC error -26: {"code":-26,"message":"mandatory-script-verify-flag-failed (Witness program hash mismatch)"}") which must be from the broadcast call. My hunch is that the sender is trying to spend a UTXO that's already been spent but the wallet history hasn't updated, so the spend check during broadcast fails. |
4b49339
to
373616c
Compare
The remaining UI related items can be left out of this PR |
Parse the payjoin endpoint as a URI and add it to SendState.
Sends payjoin in place using the build, send, confirm flow. There are 2 hacks to get this to work that I'm sure must be worked out. 1. BIP21 Uris are mangled by dart's Uri struct since BIP21 and form URI encoding are different specifications. This requires some reencoding of bip21 values before the sender gets initialized. In the future, the bip21 implementation here must be made spec compliant, perhaps by depending on the rust crate so as to use the same types in bdk, payjoin-flutter, etc. 2. TransactionDetails used to display historical data are missing. BDK defines a TransactionDetails type which is now deprecated in BDK 1.0 which includes details like 'address', 'sent' amount, and 'received' amount. This PR makes no attempt to follow this paradigm. Somehow historical data must be populated so that history is accurately populated and the confirm screen and confirmed screen displays correct information.
This also toggles the text on the Confirm screen to give user state context.
This still ignores UI updates from the spawned isolate and doesn't even have a proper splash screen for a confirmed send. It has also yet to be smoke tested
ACK! |
I'll patch the linting issues after merge so we can move forward. |
This is a basic sender implementation that may be merged so we can build off of it. It does not include any isolate behavior or do accounting properly. I would like help getting the accounting right by taking data from a signed payjoin and pushing it into the Transaction model @ethicnology.
This separates the signing and "confirmed" stages and marshals successful payjoins to the final screen. I don't think a new payjoin handshake screen is merited until the isolates can allow that behavior to happen outside of the send cubit.
Please see the commit log for hacks taken to get this working.
For a payjoin send:
I ask reviewers to confirm errors are handled appropriately, since this flutter paradigm is new to me.