Skip to content

Commit 46d7102

Browse files
committed
WIP: rebased
1 parent 61cd894 commit 46d7102

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ base64 = "0.22.1"
3535
bitcoin-ffi = { git = "https://github.com/bitcoindevkit/bitcoin-ffi.git", rev = "4cd8e644dbf4e001d71d5fffb232480fa5ff2246" }
3636
hex = "0.4.3"
3737
ohttp = { package = "bitcoin-ohttp", version = "0.6.0" }
38-
payjoin = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "bb47c8469146f1a9055b7f850d86f58f2b9627c6", features = ["v1", "io"] }
38+
payjoin = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "bb47c8469146f1a9055b7f850d86f58f2b9627c6", features = ["v1"] }
3939
serde_json = "1.0.128"
4040
thiserror = "1.0.58"
4141
uniffi = { version = "0.28.0", optional = true }

src/receive/wasm.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::bitcoin_ffi::Network;
1010
use crate::ohttp::OhttpKeys;
1111
// use crate::uri::PjUriBuilder;
1212
use crate::Url;
13+
use crate::error::PayjoinError;
1314

1415
use {
1516
crate::utils::result::JsResult,
@@ -51,8 +52,8 @@ impl Receiver {
5152
.map_err(|_| wasm_bindgen::JsError::new("Invalid network"))?;
5253

5354
// Parse URLs
54-
let directory = Url::parse(directory)
55-
.map_err(|_| wasm_bindgen::JsError::new("Invalid directory URL"))?;
55+
// let directory = Url::parse(directory)
56+
// .map_err(|_| wasm_bindgen::JsError::new("Invalid directory URL"))?;
5657
let ohttp_relay = Url::parse(ohttp_relay)
5758
.map_err(|_| wasm_bindgen::JsError::new("Invalid relay URL"))?;
5859

@@ -66,14 +67,14 @@ impl Receiver {
6667
.require_network(network)
6768
.map_err(|_| wasm_bindgen::JsError::new("Address network mismatch"))?;
6869

69-
Ok(payjoin::receive::v2::Receiver::new(//new_with_time(
70+
Ok(payjoin::receive::v2::Receiver::new(
7071
address,
71-
directory.into(),
72+
directory,
7273
ohttp_keys.into(),
73-
ohttp_relay.into(),
74-
// js_sys::Date::now(),
74+
// Date::now(),
7575
expire_after.map(Duration::from_secs)
7676
)
77+
.map_err(PayjoinError::from)?
7778
.into())
7879
}
7980

0 commit comments

Comments
 (0)