-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bolt12 support in submarine swaps
- Loading branch information
1 parent
684d768
commit 57b1b0f
Showing
45 changed files
with
5,411 additions
and
1,498 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use crate::config::CurrencyConfig; | ||
use crate::lightning::cln::Cln; | ||
use std::collections::HashMap; | ||
use tracing::{debug, warn}; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct Currency { | ||
pub cln: Option<Cln>, | ||
} | ||
|
||
pub type Currencies = HashMap<String, Currency>; | ||
|
||
pub async fn connect_nodes(currencies: Option<Vec<CurrencyConfig>>) -> anyhow::Result<Currencies> { | ||
let mut curs = HashMap::new(); | ||
|
||
match currencies { | ||
Some(currencies) => { | ||
for currency in currencies { | ||
debug!("Connecting to nodes of {}", currency.symbol); | ||
|
||
let cln = match currency.cln.clone() { | ||
Some(config) => { | ||
let mut cln = Cln::new(¤cy.symbol, config).await?; | ||
cln.connect().await?; | ||
Some(cln) | ||
} | ||
None => None, | ||
}; | ||
|
||
curs.insert(currency.symbol.clone(), Currency { cln }); | ||
} | ||
} | ||
None => { | ||
warn!("No currencies are configured"); | ||
} | ||
} | ||
|
||
Ok(curs) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.