forked from LtbLightning/payjoin-ffi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
35 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::sync::Arc; | ||
|
||
use crate::uri::Url; | ||
|
||
///Represents data that needs to be transmitted to the receiver. | ||
///You need to send this request over HTTP(S) to the receiver. | ||
#[derive(Clone, Debug)] | ||
pub struct Request { | ||
///URL to send the request to. | ||
/// | ||
///This is full URL with scheme etc - you can pass it right to reqwest or a similar library. | ||
pub url: Arc<Url>, | ||
///Bytes to be sent to the receiver. | ||
/// | ||
///This is properly encoded PSBT, already in base64. You only need to make sure Content-Type is text/plain and Content-Length is body.len() (most libraries do the latter automatically). | ||
pub body: Vec<u8>, | ||
} | ||
|
||
impl From<payjoin::Request> for Request { | ||
fn from(value: payjoin::Request) -> Self { | ||
Self { url: Arc::new(value.url.into()), body: value.body } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters