Skip to content

Commit

Permalink
Re-use and re-export lightning-invoice crate
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed Feb 8, 2024
1 parent e87f60e commit 9bcaf60
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 31 deletions.
30 changes: 3 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion libs/gl-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ bytes = "1.2.1"
hex = "0.4.3"
http = "0.2"
http-body = "^0.4"
lightning-invoice = "0.26.0"
log = "^0.4"
pin-project = "1.1.3"
prost = "0.11"
Expand Down
1 change: 1 addition & 0 deletions libs/gl-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub enum Error {
}

pub use lightning_signer::bitcoin;
pub use lightning_signer::lightning_invoice;

pub(crate) const TCP_KEEPALIVE: Duration = Duration::from_secs(30);
pub(crate) const TCP_KEEPALIVE_TIMEOUT: Duration = Duration::from_secs(90);
4 changes: 3 additions & 1 deletion libs/gl-client/src/lnurl/pay/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use super::models;
use super::utils::parse_lnurl;

use crate::lightning_invoice::{Bolt11Invoice, Bolt11InvoiceDescription};
use crate::lnurl::{
models::{LnUrlHttpClient, PayRequestCallbackResponse, PayRequestResponse},
utils::parse_invoice,
};

use anyhow::{anyhow, ensure, Result};
use lightning_invoice::{Bolt11Invoice, Bolt11InvoiceDescription};
use log::debug;
use reqwest::Url;
use sha256;
Expand Down
6 changes: 4 additions & 2 deletions libs/gl-client/src/lnurl/utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use std::str::FromStr;

use anyhow::{anyhow, Result};
use bech32::FromBase32;
use lightning_invoice::Bolt11Invoice;
use std::str::FromStr;

use crate::lightning_invoice::Bolt11Invoice;

// Function to decode and parse the lnurl into a URL
pub fn parse_lnurl(lnurl: &str) -> Result<String> {
Expand Down

0 comments on commit 9bcaf60

Please sign in to comment.