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

Commit f77afba

Browse files
committed
Define payjoin network resources in mod
1 parent c508205 commit f77afba

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
@@ -914,16 +914,11 @@ impl<S: MutinyStorage> MutinyWallet<S> {
914914
use anyhow::anyhow;
915915
// DANGER! TODO get from &self config, do not get config directly from PAYJOIN_DIR ohttp-gateway
916916
// That would reveal IP address
917-
const OHTTP_RELAYS: [&str; 2] = [
918-
"https://ohttp-relay.obscuravpn.io/payjoin",
919-
"https://bobspace-ohttp.duckdns.org",
920-
];
921-
const PAYJOIN_DIR: &str = "https://payjo.in";
922917

923918
let http_client = reqwest::Client::builder().build().unwrap();
924919

925920
let ohttp_config_base64 = http_client
926-
.get(format!("{}/ohttp-config", PAYJOIN_DIR))
921+
.get(format!("{}/ohttp-config", crate::payjoin::PAYJOIN_DIR))
927922
.send()
928923
.await
929924
.unwrap()
@@ -932,9 +927,9 @@ impl<S: MutinyStorage> MutinyWallet<S> {
932927
.unwrap();
933928

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

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