feat: setup bitvora api

This commit is contained in:
2025-03-03 12:20:31 +00:00
parent 834ed44408
commit b80048e372
9 changed files with 181 additions and 28 deletions

View File

@ -1,3 +1,4 @@
use std::path::Path;
use crate::lightning::{AddInvoiceRequest, AddInvoiceResult, InvoiceUpdate, LightningNode};
use crate::settings::LndConfig;
use anyhow::Result;
@ -16,13 +17,8 @@ pub struct LndNode {
}
impl LndNode {
pub async fn new(settings: &LndConfig) -> Result<Self> {
let lnd = connect(
settings.url.clone(),
settings.cert.clone(),
settings.macaroon.clone(),
)
.await?;
pub async fn new(url: &str, cert: &Path, macaroon: &Path) -> Result<Self> {
let lnd = connect(url.to_string(), cert, macaroon).await?;
Ok(Self { client: lnd })
}
}