Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 6bed5bf

Browse files
committed
Define payjoin network resources in mod
1 parent 00be64a commit 6bed5bf

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

mutiny-core/src/lib.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,16 +1060,11 @@ impl<S: MutinyStorage> MutinyWallet<S> {
10601060
use anyhow::anyhow;
10611061
// DANGER! TODO get from &self config, do not get config directly from PAYJOIN_DIR ohttp-gateway
10621062
// That would reveal IP address
1063-
const OHTTP_RELAYS: [&str; 2] = [
1064-
"https://ohttp-relay.obscuravpn.io/payjoin",
1065-
"https://bobspace-ohttp.duckdns.org",
1066-
];
1067-
const PAYJOIN_DIR: &str = "https://payjo.in";
10681063

10691064
let http_client = reqwest::Client::builder().build().unwrap();
10701065

10711066
let ohttp_config_base64 = http_client
1072-
.get(format!("{}/ohttp-config", PAYJOIN_DIR))
1067+
.get(format!("{}/ohttp-config", crate::payjoin::PAYJOIN_DIR))
10731068
.send()
10741069
.await
10751070
.unwrap()
@@ -1078,9 +1073,9 @@ impl<S: MutinyStorage> MutinyWallet<S> {
10781073
.unwrap();
10791074

10801075
let mut enroller = pj::receive::v2::Enroller::from_relay_config(
1081-
PAYJOIN_DIR,
1076+
crate::payjoin::PAYJOIN_DIR,
10821077
&ohttp_config_base64,
1083-
OHTTP_RELAYS[0], // TODO pick ohttp relay at random
1078+
crate::payjoin::OHTTP_RELAYS[0], // TODO pick ohttp relay at random
10841079
);
10851080

10861081
// enroll client

mutiny-core/src/payjoin.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ use payjoin::receive::v2::Enrolled;
66
use serde::{Deserialize, Serialize};
77
use std::collections::HashMap;
88

9+
pub(crate) const OHTTP_RELAYS: [&str; 2] = [
10+
"https://ohttp-relay.obscuravpn.io/payjoin",
11+
"https://bobspace-ohttp.duckdns.org",
12+
];
13+
pub(crate) const PAYJOIN_DIR: &str = "https://payjo.in";
14+
915
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1016
pub struct Session {
1117
pub enrolled: Enrolled,

0 commit comments

Comments
 (0)