mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-10 07:36:13 +01:00
fix(cdk-lnbits): Strike -> LNbits, LNBits -> LNbits
This commit is contained in:
committed by
thesimplekid
parent
5e5345074d
commit
8ee5f62d62
@@ -21,7 +21,7 @@ The project is split up into several crates in the `crates/` directory:
|
||||
* [**cdk-axum**](./crates/cdk-axum/): Axum webserver for mint.
|
||||
* [**cdk-cln**](./crates/cdk-cln/): CLN Lightning backend for mint.
|
||||
* [**cdk-strike**](./crates/cdk-strike/): Strike Lightning backend for mint.
|
||||
* [**cdk-lnbits**](./crates/cdk-lnbits/): [LNBits](https://lnbits.com/) Lightning backend for mint.
|
||||
* [**cdk-lnbits**](./crates/cdk-lnbits/): [LNbits](https://lnbits.com/) Lightning backend for mint.
|
||||
* [**cdk-fake-wallet**](./crates/cdk-fake-wallet/): Fake Lightning backend for mint. To be used only for testing, quotes are automatically filled.
|
||||
* Binaries:
|
||||
* [**cdk-cli**](./crates/cdk-cli/): Cashu wallet CLI.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Error for Strike ln backend
|
||||
//! Error for LNbits ln backend
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
/// Strike Error
|
||||
/// LNbits Error
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
/// Invoice amount not defined
|
||||
|
||||
@@ -27,9 +27,9 @@ use tokio::sync::Mutex;
|
||||
|
||||
pub mod error;
|
||||
|
||||
/// LNBits
|
||||
/// LNbits
|
||||
#[derive(Clone)]
|
||||
pub struct LNBits {
|
||||
pub struct LNbits {
|
||||
lnbits_api: LNBitsClient,
|
||||
mint_settings: MintMeltSettings,
|
||||
melt_settings: MintMeltSettings,
|
||||
@@ -38,8 +38,8 @@ pub struct LNBits {
|
||||
webhook_url: String,
|
||||
}
|
||||
|
||||
impl LNBits {
|
||||
/// Create new [`LNBits`] wallet
|
||||
impl LNbits {
|
||||
/// Create new [`LNbits`] wallet
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn new(
|
||||
admin_api_key: String,
|
||||
@@ -65,7 +65,7 @@ impl LNBits {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl MintLightning for LNBits {
|
||||
impl MintLightning for LNbits {
|
||||
type Err = cdk_lightning::Error;
|
||||
|
||||
fn get_settings(&self) -> Settings {
|
||||
@@ -260,7 +260,7 @@ impl MintLightning for LNBits {
|
||||
}
|
||||
}
|
||||
|
||||
impl LNBits {
|
||||
impl LNbits {
|
||||
/// Create invoice webhook
|
||||
pub async fn create_invoice_webhook_router(
|
||||
&self,
|
||||
|
||||
@@ -21,7 +21,7 @@ pub enum LnBackend {
|
||||
#[default]
|
||||
Cln,
|
||||
Strike,
|
||||
LNBits,
|
||||
LNbits,
|
||||
FakeWallet,
|
||||
// Greenlight,
|
||||
// Ldk,
|
||||
@@ -42,7 +42,7 @@ pub struct Strike {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
pub struct LNBits {
|
||||
pub struct LNbits {
|
||||
pub admin_api_key: String,
|
||||
pub invoice_api_key: String,
|
||||
pub lnbits_api: String,
|
||||
@@ -86,7 +86,7 @@ pub struct Settings {
|
||||
pub ln: Ln,
|
||||
pub cln: Option<Cln>,
|
||||
pub strike: Option<Strike>,
|
||||
pub lnbits: Option<LNBits>,
|
||||
pub lnbits: Option<LNbits>,
|
||||
pub fake_wallet: Option<FakeWallet>,
|
||||
pub database: Database,
|
||||
}
|
||||
@@ -151,7 +151,7 @@ impl Settings {
|
||||
match settings.ln.ln_backend {
|
||||
LnBackend::Cln => assert!(settings.cln.is_some()),
|
||||
LnBackend::Strike => assert!(settings.strike.is_some()),
|
||||
LnBackend::LNBits => assert!(settings.lnbits.is_some()),
|
||||
LnBackend::LNbits => assert!(settings.lnbits.is_some()),
|
||||
LnBackend::FakeWallet => (),
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use cdk::nuts::{
|
||||
use cdk_axum::LnKey;
|
||||
use cdk_cln::Cln;
|
||||
use cdk_fake_wallet::FakeWallet;
|
||||
use cdk_lnbits::LNBits;
|
||||
use cdk_lnbits::LNbits;
|
||||
use cdk_redb::MintRedbDatabase;
|
||||
use cdk_sqlite::MintSqliteDatabase;
|
||||
use cdk_strike::Strike;
|
||||
@@ -198,7 +198,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
routers
|
||||
}
|
||||
LnBackend::LNBits => {
|
||||
LnBackend::LNbits => {
|
||||
let lnbits_settings = settings.lnbits.expect("Checked on config load");
|
||||
let admin_api_key = lnbits_settings.admin_api_key;
|
||||
let invoice_api_key = lnbits_settings.invoice_api_key;
|
||||
@@ -209,7 +209,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
let webhook_url = mint_url.join(webhook_endpoint)?;
|
||||
|
||||
let lnbits = LNBits::new(
|
||||
let lnbits = LNbits::new(
|
||||
admin_api_key,
|
||||
invoice_api_key,
|
||||
lnbits_settings.lnbits_api,
|
||||
|
||||
Reference in New Issue
Block a user