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

Commit 705c051

Browse files
committed
Define payjoin network resources in mod
1 parent 3db9a43 commit 705c051

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

mutiny-core/src/lib.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -916,16 +916,11 @@ impl<S: MutinyStorage> MutinyWallet<S> {
916916
use anyhow::anyhow;
917917
// DANGER! TODO get from &self config, do not get config directly from PAYJOIN_DIR ohttp-gateway
918918
// That would reveal IP address
919-
const OHTTP_RELAYS: [&str; 2] = [
920-
"https://ohttp-relay.obscuravpn.io/payjoin",
921-
"https://bobspace-ohttp.duckdns.org",
922-
];
923-
const PAYJOIN_DIR: &str = "https://payjo.in";
924919

925920
let http_client = reqwest::Client::builder().build().unwrap();
926921

927922
let ohttp_config_base64 = http_client
928-
.get(format!("{}/ohttp-config", PAYJOIN_DIR))
923+
.get(format!("{}/ohttp-config", crate::payjoin::PAYJOIN_DIR))
929924
.send()
930925
.await
931926
.unwrap()
@@ -934,9 +929,9 @@ impl<S: MutinyStorage> MutinyWallet<S> {
934929
.unwrap();
935930

936931
let mut enroller = pj::receive::v2::Enroller::from_relay_config(
937-
PAYJOIN_DIR,
932+
crate::payjoin::PAYJOIN_DIR,
938933
&ohttp_config_base64,
939-
OHTTP_RELAYS[0], // TODO pick ohttp relay at random
934+
crate::payjoin::OHTTP_RELAYS[0], // TODO pick ohttp relay at random
940935
);
941936

942937
// 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)