-
Notifications
You must be signed in to change notification settings - Fork 86
feat: add non-persisted Async Payjoin support #200
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
base: master
Are you sure you want to change the base?
Changes from all commits
a28076a
f62287a
594dbcf
f371ece
2a72560
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -430,6 +430,41 @@ pub enum OnlineWalletSubCommand { | |
| )] | ||
| tx: Option<String>, | ||
| }, | ||
| // Generates a Payjoin receive URI and processes the sender's Payjoin proposal. | ||
| ReceivePayjoin { | ||
| /// Amount to be received in sats. | ||
| #[arg(env = "PAYJOIN_AMOUNT", long = "amount", required = true)] | ||
| amount: u64, | ||
| /// Payjoin directory which will be used to store the PSBTs which are pending action | ||
| /// from one of the parties. | ||
| #[arg(env = "PAYJOIN_DIRECTORY", long = "directory", required = true)] | ||
| directory: String, | ||
| /// URL of the Payjoin OHTTP relay. Can be repeated multiple times to attempt the | ||
| /// operation with multiple relays for redundancy. | ||
| #[arg(env = "PAYJOIN_OHTTP_RELAY", long = "ohttp_relay", required = true)] | ||
| ohttp_relay: Vec<String>, | ||
|
Comment on lines
+442
to
+445
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: also plural here
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as the above. The reason I kept this singular here is that it works better from a CLI options perspective: Having the options be |
||
| /// Maximum effective fee rate the receiver is willing to pay for their own input/output contributions. | ||
| #[arg(env = "PAYJOIN_RECEIVER_MAX_FEE_RATE", long = "max_fee_rate")] | ||
| max_fee_rate: Option<u64>, | ||
| }, | ||
| /// Sends an original PSBT to a BIP 21 URI and broadcasts the returned Payjoin PSBT. | ||
| SendPayjoin { | ||
| /// BIP 21 URI for the Payjoin. | ||
| #[arg(env = "PAYJOIN_URI", long = "uri", required = true)] | ||
| uri: String, | ||
| /// URL of the Payjoin OHTTP relay. Can be repeated multiple times to attempt the | ||
| /// operation with multiple relays for redundancy. | ||
| #[arg(env = "PAYJOIN_OHTTP_RELAY", long = "ohttp_relay", required = true)] | ||
| ohttp_relay: Vec<String>, | ||
|
Comment on lines
+455
to
+458
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: plural
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason I kept this singular here is that it works better from a CLI options perspective: Having the options be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough, I guess I was thinking about it from the perspective of a config file but I realize now this only supports command line argument parsing so it makes sense. |
||
| /// Fee rate to use in sat/vbyte. | ||
| #[arg( | ||
| env = "PAYJOIN_SENDER_FEE_RATE", | ||
| short = 'f', | ||
| long = "fee_rate", | ||
| required = true | ||
| )] | ||
| fee_rate: u64, | ||
| }, | ||
| } | ||
|
|
||
| /// Subcommands for Key operations. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the
urldependency was removed from the public payjoin API for 1.0.0-rc, so it should no longer be required.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am changing the function signatures to use payjoin::IntoUrl, but going to hold on to the Url dependency to parse the URLs before passing them to the Payjoin process functions. Let me know if there is an alternative approach 👍🏻