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

Commit 2a34e06

Browse files
committed
Define payjoin network resources in mod
1 parent 1169ad8 commit 2a34e06

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
@@ -678,16 +678,11 @@ impl<S: MutinyStorage> MutinyWallet<S> {
678678
use anyhow::anyhow;
679679
// DANGER! TODO get from &self config, do not get config directly from PAYJOIN_DIR ohttp-gateway
680680
// That would reveal IP address
681-
const OHTTP_RELAYS: [&str; 2] = [
682-
"https://ohttp-relay.obscuravpn.io/payjoin",
683-
"https://bobspace-ohttp.duckdns.org",
684-
];
685-
const PAYJOIN_DIR: &str = "https://payjo.in";
686681

687682
let http_client = reqwest::Client::builder().build().unwrap();
688683

689684
let ohttp_config_base64 = http_client
690-
.get(format!("{}/ohttp-config", PAYJOIN_DIR))
685+
.get(format!("{}/ohttp-config", crate::payjoin::PAYJOIN_DIR))
691686
.send()
692687
.await
693688
.unwrap()
@@ -696,9 +691,9 @@ impl<S: MutinyStorage> MutinyWallet<S> {
696691
.unwrap();
697692

698693
let mut enroller = pj::receive::v2::Enroller::from_relay_config(
699-
PAYJOIN_DIR,
694+
crate::payjoin::PAYJOIN_DIR,
700695
&ohttp_config_base64,
701-
OHTTP_RELAYS[0], // TODO pick ohttp relay at random
696+
crate::payjoin::OHTTP_RELAYS[0], // TODO pick ohttp relay at random
702697
);
703698

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