Skip to content

Commit

Permalink
fix(cdk-lnbits): Strike -> LNbits, LNBits -> LNbits
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak authored and thesimplekid committed Aug 29, 2024
1 parent 5e53450 commit 8ee5f62
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions crates/cdk-lnbits/src/error.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions crates/cdk-lnbits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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 {
Expand Down Expand Up @@ -260,7 +260,7 @@ impl MintLightning for LNBits {
}
}

impl LNBits {
impl LNbits {
/// Create invoice webhook
pub async fn create_invoice_webhook_router(
&self,
Expand Down
8 changes: 4 additions & 4 deletions crates/cdk-mintd/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum LnBackend {
#[default]
Cln,
Strike,
LNBits,
LNbits,
FakeWallet,
// Greenlight,
// Ldk,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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 => (),
}

Expand Down
6 changes: 3 additions & 3 deletions crates/cdk-mintd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 8ee5f62

Please sign in to comment.