From 623e4cbf1aa160ded3dd0a6aa60eb6c7a069c1a8 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Fri, 28 Jul 2023 20:02:33 -0400 Subject: [PATCH] chore: update ln --- Cargo.toml | 2 +- src/client.rs | 6 +++--- src/lib.rs | 2 +- src/nuts/nut03.rs | 4 ++-- src/nuts/nut05.rs | 6 +++--- src/nuts/nut08.rs | 4 ++-- src/wallet.rs | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 47beb2d7..30b9d6c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ bitcoin = { version = "0.30.0", features=["serde", "rand", "no-std"] } bitcoin_hashes = "0.12.0" hex = "0.4.3" k256 = { version = "0.13.1", features=["arithmetic"] } -lightning-invoice = { version = "0.23.0", features=["serde"] } +lightning-invoice = { version = "0.24.0", features=["serde"] } rand = "0.8.5" getrandom = { version = "0.2", features = ["js"] } serde = { version = "1.0.160", features = ["derive"]} diff --git a/src/client.rs b/src/client.rs index 1cc6149b..8b9e142c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -17,7 +17,7 @@ use crate::nuts::nut09::MintInfo; use crate::nuts::*; use crate::utils; use crate::Amount; -pub use crate::Invoice; +pub use crate::Bolt11Invoice; #[derive(Debug)] pub enum Error { @@ -199,7 +199,7 @@ impl Client { } /// Check Max expected fee [NUT-05] - pub async fn check_fees(&self, invoice: Invoice) -> Result { + pub async fn check_fees(&self, invoice: Bolt11Invoice) -> Result { let url = self.mint_url.join("checkfees")?; let request = CheckFeesRequest { pr: invoice }; @@ -223,7 +223,7 @@ impl Client { pub async fn melt( &self, proofs: Vec, - invoice: Invoice, + invoice: Bolt11Invoice, outputs: Option>, ) -> Result { let url = self.mint_url.join("melt")?; diff --git a/src/lib.rs b/src/lib.rs index f075bb3c..dc1970bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,6 @@ pub use client::Client; pub use amount::Amount; pub use bitcoin::hashes::sha256::Hash as Sha256; pub use lightning_invoice; -pub use lightning_invoice::Invoice; +pub use lightning_invoice::Bolt11Invoice; pub type Result> = std::result::Result; diff --git a/src/nuts/nut03.rs b/src/nuts/nut03.rs index 3419ce19..cc6b9722 100644 --- a/src/nuts/nut03.rs +++ b/src/nuts/nut03.rs @@ -3,13 +3,13 @@ use serde::{Deserialize, Serialize}; -pub use crate::Invoice; +pub use crate::Bolt11Invoice; /// Mint request response [NUT-03] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct RequestMintResponse { /// Bolt11 payment request - pub pr: Invoice, + pub pr: Bolt11Invoice, /// Random hash MUST not be the hash of invoice pub hash: String, } diff --git a/src/nuts/nut05.rs b/src/nuts/nut05.rs index e5762b9d..333f9721 100644 --- a/src/nuts/nut05.rs +++ b/src/nuts/nut05.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use super::nut00::Proofs; use crate::error::Error; use crate::Amount; -use crate::Invoice; +use crate::Bolt11Invoice; /// Check Fees Response [NUT-05] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] @@ -19,7 +19,7 @@ pub struct CheckFeesResponse { #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct CheckFeesRequest { /// Lighting Invoice - pub pr: Invoice, + pub pr: Bolt11Invoice, } /// Melt Request [NUT-05] @@ -27,7 +27,7 @@ pub struct CheckFeesRequest { pub struct MeltRequest { pub proofs: Proofs, /// bollt11 - pub pr: Invoice, + pub pr: Bolt11Invoice, } impl MeltRequest { diff --git a/src/nuts/nut08.rs b/src/nuts/nut08.rs index 6c0fa611..d3a326d9 100644 --- a/src/nuts/nut08.rs +++ b/src/nuts/nut08.rs @@ -1,7 +1,7 @@ //! Lightning fee return // https://github.com/cashubtc/nuts/blob/main/08.md -use lightning_invoice::Invoice; +use lightning_invoice::Bolt11Invoice; use serde::{Deserialize, Serialize}; use crate::{error::Error, Amount}; @@ -13,7 +13,7 @@ use super::nut00::{BlindedMessage, BlindedSignature, Proofs}; pub struct MeltRequest { pub proofs: Proofs, /// bollt11 - pub pr: Invoice, + pub pr: Bolt11Invoice, /// Blinded Message that can be used to return change [NUT-08] /// Amount field of blindedMessages `SHOULD` be set to zero pub outputs: Option>, diff --git a/src/wallet.rs b/src/wallet.rs index e1f10fa1..a2d5b195 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -12,7 +12,7 @@ use crate::nuts::nut03::RequestMintResponse; use crate::nuts::nut06::{SplitPayload, SplitRequest}; use crate::types::{Melted, ProofsStatus, SendProofs}; use crate::Amount; -pub use crate::Invoice; +pub use crate::Bolt11Invoice; use crate::{ dhke::construct_proofs, error::{self, wallet::Error}, @@ -98,7 +98,7 @@ impl Wallet { } /// Check fee - pub async fn check_fee(&self, invoice: Invoice) -> Result { + pub async fn check_fee(&self, invoice: Bolt11Invoice) -> Result { Ok(self.client.check_fees(invoice).await?.fee) } @@ -267,7 +267,7 @@ impl Wallet { pub async fn melt( &self, - invoice: Invoice, + invoice: Bolt11Invoice, proofs: Proofs, fee_reserve: Amount, ) -> Result {