Ln use common (#751)

* chore: cdk-cln use common

* feat: lnd use common

* feat: lnbits use common
This commit is contained in:
thesimplekid
2025-05-14 17:29:58 +01:00
committed by GitHub
parent 65e785561c
commit 9ac387ae3d
9 changed files with 31 additions and 31 deletions

View File

@@ -13,15 +13,15 @@ use std::sync::Arc;
use anyhow::anyhow;
use async_trait::async_trait;
use axum::Router;
use cdk::amount::{to_unit, Amount, MSAT_IN_SAT};
use cdk::cdk_payment::{
use cdk_common::amount::{to_unit, Amount, MSAT_IN_SAT};
use cdk_common::common::FeeReserve;
use cdk_common::nuts::{CurrencyUnit, MeltOptions, MeltQuoteState, MintQuoteState};
use cdk_common::payment::{
self, Bolt11Settings, CreateIncomingPaymentResponse, MakePaymentResponse, MintPayment,
PaymentQuoteResponse,
};
use cdk::nuts::{CurrencyUnit, MeltOptions, MeltQuoteState, MintQuoteState};
use cdk::types::FeeReserve;
use cdk::util::unix_time;
use cdk::{mint, Bolt11Invoice};
use cdk_common::util::unix_time;
use cdk_common::{mint, Bolt11Invoice};
use error::Error;
use futures::stream::StreamExt;
use futures::Stream;
@@ -77,7 +77,7 @@ impl LNbits {
#[async_trait]
impl MintPayment for LNbits {
type Err = cdk_payment::Error;
type Err = payment::Error;
async fn get_settings(&self) -> Result<Value, Self::Err> {
Ok(serde_json::to_value(&self.settings)?)
@@ -166,7 +166,7 @@ impl MintPayment for LNbits {
let amount_msat = match options {
Some(amount) => {
if matches!(amount, MeltOptions::Mpp { mpp: _ }) {
return Err(cdk_payment::Error::UnsupportedPaymentOption);
return Err(payment::Error::UnsupportedPaymentOption);
}
amount.amount_msat()
}