Ver Fonte

chore: remove phd

thesimplekid há 1 mês atrás
pai
commit
f5be0ceeb6

+ 0 - 2
.github/workflows/ci.yml

@@ -101,7 +101,6 @@ jobs:
             -p cdk-axum,
             -p cdk-cln,
             -p cdk-lnd,
-            -p cdk-phoenixd,
             -p cdk-lnbits,
             -p cdk-fake-wallet,
             --bin cdk-cli,
@@ -217,7 +216,6 @@ jobs:
             -p cdk-axum,
             -p cdk-axum --no-default-features --features redis,
             -p cdk-lnbits,
-            -p cdk-phoenixd,
             -p cdk-fake-wallet,
             -p cdk-cln,
             -p cdk-lnd,

+ 0 - 1
Cargo.toml

@@ -24,7 +24,6 @@ cdk-axum = { path = "./crates/cdk-axum", default-features = false, version = "=0
 cdk-cln = { path = "./crates/cdk-cln", version = "=0.7.1" }
 cdk-lnbits = { path = "./crates/cdk-lnbits", version = "=0.7.1" }
 cdk-lnd = { path = "./crates/cdk-lnd", version = "=0.7.1" }
-cdk-phoenixd = { path = "./crates/cdk-phoenixd", version = "=0.7.1" }
 cdk-fake-wallet = { path = "./crates/cdk-fake-wallet", version = "=0.7.1" }
 cdk-mint-rpc = { path = "./crates/cdk-mint-rpc", version = "=0.7.1" }
 cdk-redb = { path = "./crates/cdk-redb", default-features = true, version = "=0.7.1" }

+ 0 - 1
README.md

@@ -23,7 +23,6 @@ The project is split up into several crates in the `crates/` directory:
     * [**cdk-cln**](./crates/cdk-cln/): CLN Lightning backend for mint.
     * [**cdk-lnd**](./crates/cdk-lnd/): Lnd Lightning backend for mint.
     * [**cdk-lnbits**](./crates/cdk-lnbits/): [LNbits](https://lnbits.com/) Lightning backend for mint.
-    * [**cdk-phoenixd**](./crates/cdk-phoenixd/): Phoenixd 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.
     * [**cdk-mint-rpc**](./crates/cdk-mint-rpc/): Mint management gRPC server and cli.
 * Binaries:

+ 0 - 1
crates/cdk-mintd/Cargo.toml

@@ -32,7 +32,6 @@ cdk-sqlite = { workspace = true, features = [
 ] }
 cdk-cln.workspace = true
 cdk-lnbits.workspace = true
-cdk-phoenixd.workspace = true
 cdk-lnd.workspace = true
 cdk-fake-wallet.workspace = true
 cdk-axum.workspace = true

+ 0 - 16
crates/cdk-mintd/src/config.rs

@@ -49,7 +49,6 @@ pub enum LnBackend {
     Cln,
     LNbits,
     FakeWallet,
-    Phoenixd,
     Lnd,
 }
 
@@ -61,7 +60,6 @@ impl std::str::FromStr for LnBackend {
             "cln" => Ok(LnBackend::Cln),
             "lnbits" => Ok(LnBackend::LNbits),
             "fakewallet" => Ok(LnBackend::FakeWallet),
-            "phoenixd" => Ok(LnBackend::Phoenixd),
             "lnd" => Ok(LnBackend::Lnd),
             _ => Err(format!("Unknown Lightning backend: {}", s)),
         }
@@ -118,15 +116,6 @@ pub struct Lnd {
     pub reserve_fee_min: Amount,
 }
 
-#[derive(Debug, Clone, Serialize, Deserialize, Default)]
-pub struct Phoenixd {
-    pub api_password: String,
-    pub api_url: String,
-    pub bolt12: bool,
-    pub fee_percent: f32,
-    pub reserve_fee_min: Amount,
-}
-
 #[derive(Debug, Clone, Serialize, Deserialize)]
 pub struct FakeWallet {
     pub supported_units: Vec<CurrencyUnit>,
@@ -194,7 +183,6 @@ pub struct Settings {
     pub ln: Ln,
     pub cln: Option<Cln>,
     pub lnbits: Option<LNbits>,
-    pub phoenixd: Option<Phoenixd>,
     pub lnd: Option<Lnd>,
     pub fake_wallet: Option<FakeWallet>,
     pub database: Database,
@@ -288,10 +276,6 @@ impl Settings {
                 settings.lnbits.is_some(),
                 "LNbits backend requires a valid config"
             ),
-            LnBackend::Phoenixd => assert!(
-                settings.phoenixd.is_some(),
-                "Phoenixd backend requires a valid config"
-            ),
             LnBackend::Lnd => {
                 assert!(
                     settings.lnd.is_some(),

+ 1 - 43
crates/cdk-mintd/src/env_vars.rs

@@ -8,8 +8,7 @@ use cdk::nuts::CurrencyUnit;
 #[cfg(feature = "management-rpc")]
 use crate::config::MintManagementRpc;
 use crate::config::{
-    Cln, Database, DatabaseEngine, FakeWallet, Info, LNbits, Ln, LnBackend, Lnd, MintInfo,
-    Phoenixd, Settings,
+    Cln, Database, DatabaseEngine, FakeWallet, Info, LNbits, Ln, LnBackend, Lnd, MintInfo, Settings,
 };
 
 pub const ENV_WORK_DIR: &str = "CDK_MINTD_WORK_DIR";
@@ -51,12 +50,6 @@ pub const ENV_LND_CERT_FILE: &str = "CDK_MINTD_LND_CERT_FILE";
 pub const ENV_LND_MACAROON_FILE: &str = "CDK_MINTD_LND_MACAROON_FILE";
 pub const ENV_LND_FEE_PERCENT: &str = "CDK_MINTD_LND_FEE_PERCENT";
 pub const ENV_LND_RESERVE_FEE_MIN: &str = "CDK_MINTD_LND_RESERVE_FEE_MIN";
-// Phoenixd environment variables
-pub const ENV_PHOENIXD_API_PASSWORD: &str = "CDK_MINTD_PHOENIXD_API_PASSWORD";
-pub const ENV_PHOENIXD_API_URL: &str = "CDK_MINTD_PHOENIXD_API_URL";
-pub const ENV_PHOENIXD_BOLT12: &str = "CDK_MINTD_PHOENIXD_BOLT12";
-pub const ENV_PHOENIXD_FEE_PERCENT: &str = "CDK_MINTD_PHOENIXD_FEE_PERCENT";
-pub const ENV_PHOENIXD_RESERVE_FEE_MIN: &str = "CDK_MINTD_PHOENIXD_RESERVE_FEE_MIN";
 // LNBits
 pub const ENV_LNBITS_ADMIN_API_KEY: &str = "CDK_MINTD_LNBITS_ADMIN_API_KEY";
 pub const ENV_LNBITS_INVOICE_API_KEY: &str = "CDK_MINTD_LNBITS_INVOICE_API_KEY";
@@ -110,9 +103,6 @@ impl Settings {
             LnBackend::FakeWallet => {
                 self.fake_wallet = Some(self.fake_wallet.clone().unwrap_or_default().from_env());
             }
-            LnBackend::Phoenixd => {
-                self.phoenixd = Some(self.phoenixd.clone().unwrap_or_default().from_env());
-            }
             LnBackend::Lnd => {
                 self.lnd = Some(self.lnd.clone().unwrap_or_default().from_env());
             }
@@ -322,38 +312,6 @@ impl Lnd {
     }
 }
 
-impl Phoenixd {
-    pub fn from_env(mut self) -> Self {
-        if let Ok(password) = env::var(ENV_PHOENIXD_API_PASSWORD) {
-            self.api_password = password;
-        }
-
-        if let Ok(url) = env::var(ENV_PHOENIXD_API_URL) {
-            self.api_url = url;
-        }
-
-        if let Ok(bolt12_str) = env::var(ENV_PHOENIXD_BOLT12) {
-            if let Ok(bolt12) = bolt12_str.parse() {
-                self.bolt12 = bolt12;
-            }
-        }
-
-        if let Ok(fee_str) = env::var(ENV_PHOENIXD_FEE_PERCENT) {
-            if let Ok(fee) = fee_str.parse() {
-                self.fee_percent = fee;
-            }
-        }
-
-        if let Ok(reserve_fee_str) = env::var(ENV_PHOENIXD_RESERVE_FEE_MIN) {
-            if let Ok(reserve_fee) = reserve_fee_str.parse::<u64>() {
-                self.reserve_fee_min = reserve_fee.into();
-            }
-        }
-
-        self
-    }
-}
-
 impl LNbits {
     pub fn from_env(mut self) -> Self {
         if let Ok(admin_key) = env::var(ENV_LNBITS_ADMIN_API_KEY) {

+ 0 - 17
crates/cdk-mintd/src/main.rs

@@ -199,23 +199,6 @@ async fn main() -> anyhow::Result<()> {
 
             mint_builder = mint_builder.add_supported_websockets(nut17_supported);
         }
-        LnBackend::Phoenixd => {
-            let phd_settings = settings.clone().phoenixd.expect("Checked at config load");
-            let phd = phd_settings
-                .setup(&mut ln_routers, &settings, CurrencyUnit::Sat)
-                .await?;
-
-            mint_builder = mint_builder.add_ln_backend(
-                CurrencyUnit::Sat,
-                PaymentMethod::Bolt11,
-                mint_melt_limits,
-                Arc::new(phd),
-            );
-
-            let nut17_supported = SupportedMethods::new(PaymentMethod::Bolt11, CurrencyUnit::Sat);
-
-            mint_builder = mint_builder.add_supported_websockets(nut17_supported);
-        }
         LnBackend::Lnd => {
             let lnd_settings = settings.clone().lnd.expect("Checked at config load");
             let lnd = lnd_settings

+ 1 - 49
crates/cdk-mintd/src/setup.rs

@@ -1,7 +1,7 @@
 use std::collections::{HashMap, HashSet};
 use std::sync::Arc;
 
-use anyhow::{anyhow, bail};
+use anyhow::anyhow;
 use async_trait::async_trait;
 use axum::Router;
 use bip39::rand::{thread_rng, Rng};
@@ -10,7 +10,6 @@ use cdk::mint::FeeReserve;
 use cdk::mint_url::MintUrl;
 use cdk::nuts::CurrencyUnit;
 use tokio::sync::Mutex;
-use url::Url;
 
 use crate::config::{self, Settings};
 use crate::expand_path;
@@ -95,53 +94,6 @@ impl LnBackendSetup for config::LNbits {
 }
 
 #[async_trait]
-impl LnBackendSetup for config::Phoenixd {
-    async fn setup(
-        &self,
-        routers: &mut Vec<Router>,
-        settings: &Settings,
-        _unit: CurrencyUnit,
-    ) -> anyhow::Result<cdk_phoenixd::Phoenixd> {
-        let api_password = &self.api_password;
-
-        let api_url = &self.api_url;
-
-        let fee_reserve = FeeReserve {
-            min_fee_reserve: self.reserve_fee_min,
-            percent_fee_reserve: self.fee_percent,
-        };
-
-        if fee_reserve.percent_fee_reserve < 0.04 {
-            bail!("Fee reserve is too low needs to be at least 0.02");
-        }
-
-        let webhook_endpoint = "/webhook/phoenixd";
-
-        let mint_url = Url::parse(&settings.info.url)?;
-
-        let webhook_url = mint_url.join(webhook_endpoint)?.to_string();
-
-        let (sender, receiver) = tokio::sync::mpsc::channel(8);
-
-        let phoenixd = cdk_phoenixd::Phoenixd::new(
-            api_password.to_string(),
-            api_url.to_string(),
-            fee_reserve,
-            Arc::new(Mutex::new(Some(receiver))),
-            webhook_url,
-        )?;
-
-        let router = phoenixd
-            .create_invoice_webhook(webhook_endpoint, sender)
-            .await?;
-
-        routers.push(router);
-
-        Ok(phoenixd)
-    }
-}
-
-#[async_trait]
 impl LnBackendSetup for config::Lnd {
     async fn setup(
         &self,

+ 0 - 24
crates/cdk-phoenixd/Cargo.toml

@@ -1,24 +0,0 @@
-[package]
-name = "cdk-phoenixd"
-version = "0.7.1"
-edition = "2021"
-authors = ["CDK Developers"]
-license = "MIT"
-homepage = "https://github.com/cashubtc/cdk"
-repository = "https://github.com/cashubtc/cdk.git"
-rust-version = "1.75.0" # MSRV
-description = "CDK ln backend for phoenixd"
-
-[dependencies]
-async-trait.workspace = true
-anyhow.workspace = true
-axum.workspace = true
-bitcoin.workspace = true
-cdk = { workspace = true, features = ["mint"] }
-futures.workspace = true
-tokio.workspace = true
-tokio-util.workspace = true
-tracing.workspace = true
-thiserror.workspace = true
-phoenixd-rs = "0.5.0"
-uuid.workspace = true

+ 0 - 46
crates/cdk-phoenixd/README.md

@@ -1,46 +0,0 @@
-# cdk-phoenixd
-
-## Run phoenixd
-
-The `phoenixd` node is included in the cdk and needs to be run separately.
-Get started here: [Phoenixd Server Documentation](https://phoenix.acinq.co/server/get-started)
-
-## Start Phoenixd
-
-By default, `phoenixd` will run with auto-liquidity enabled. While this simplifies channel management, it makes fees non-deterministic, which is not recommended for most scenarios. However, it is necessary to start with auto-liquidity enabled in order to open a channel and get started.
-
-Start the node with auto-liquidity enabled as documented by [Phoenixd](https://phoenix.acinq.co/server/get-started):
-```sh
-./phoenixd
-```
-
-> **Note:** By default the `auto-liquidity` will open a channel of 2m sats depending on the size of mint you plan to run you may want to increase this by setting the `--auto-liquidity` flag to `5m` or `10m`.
-
-## Open Channel
-
-Once the node is running, create an invoice using the phoenixd-cli to fund your node. A portion of this deposit will go to ACINQ as a fee for the provided liquidity, and a portion will cover the mining fee. These two fees cannot be refunded or withdrawn from the node. More on fees can be found [here](https://phoenix.acinq.co/server/auto-liquidity#fees). The remainder will stay as the node balance and can be withdrawn later.
-```sh
-./phoenix-cli createinvoice \
-    --description "Fund Node" \
-    --amountSat xxxxx
-```
-
-> **Note:** The amount above should be set depending on the size of the mint you would like to run as it will determine the size of the channel and amount of liquidity.
-
-## Check Channel state
-
-After paying the invoice view that a channel has been opened.
-```sh
-./phoenix-cli listchannels
-```
-
-## Restart Phoenixd without `auto-liquidity`
-
-Now that the node has a channel, it is recommended to stop the node and restart it without auto-liquidity. This will prevent phoenixd from opening new channels and incurring additional fees.
-```sh
-./phoenixd --auto-liquidity off
-```
-
-## Start cashu-mintd
-
-Once the node is running following the [cashu-mintd](../cdk-mintd/README.md) to start the mint. by default the `api_url` will be `http://127.0.0.1:9740` and the `api_password` can be found in `~/.phoenix/phoenix.conf` these will need to be set in the `cdk-mintd` config file.

+ 0 - 32
crates/cdk-phoenixd/src/error.rs

@@ -1,32 +0,0 @@
-//! Error for phoenixd ln backend
-
-use thiserror::Error;
-
-/// Phoenixd Error
-#[derive(Debug, Error)]
-pub enum Error {
-    /// Invoice amount not defined
-    #[error("Unknown invoice amount")]
-    UnknownInvoiceAmount,
-    /// Unknown invoice
-    #[error("Unknown invoice")]
-    UnknownInvoice,
-    /// Unsupported unit
-    #[error("Unit Unsupported")]
-    UnsupportedUnit,
-    /// Amount overflow
-    #[error("Amount overflow")]
-    AmountOverflow,
-    /// phd error
-    #[error(transparent)]
-    Phd(#[from] phoenixd_rs::Error),
-    /// Anyhow error
-    #[error(transparent)]
-    Anyhow(#[from] anyhow::Error),
-}
-
-impl From<Error> for cdk::cdk_lightning::Error {
-    fn from(e: Error) -> Self {
-        Self::Lightning(Box::new(e))
-    }
-}

+ 0 - 315
crates/cdk-phoenixd/src/lib.rs

@@ -1,315 +0,0 @@
-//! CDK lightning backend for Phoenixd
-
-#![warn(missing_docs)]
-#![warn(rustdoc::bare_urls)]
-
-use std::pin::Pin;
-use std::str::FromStr;
-use std::sync::atomic::{AtomicBool, Ordering};
-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_lightning::{
-    self, CreateInvoiceResponse, MintLightning, PayInvoiceResponse, PaymentQuoteResponse, Settings,
-};
-use cdk::mint::FeeReserve;
-use cdk::nuts::{CurrencyUnit, MeltQuoteBolt11Request, MeltQuoteState, MintQuoteState};
-use cdk::{mint, Bolt11Invoice};
-use error::Error;
-use futures::{Stream, StreamExt};
-use phoenixd_rs::webhooks::WebhookResponse;
-use phoenixd_rs::{InvoiceRequest, Phoenixd as PhoenixdApi};
-use tokio::sync::Mutex;
-use tokio_util::sync::CancellationToken;
-
-pub mod error;
-
-/// Phoenixd
-#[derive(Clone)]
-pub struct Phoenixd {
-    phoenixd_api: PhoenixdApi,
-    fee_reserve: FeeReserve,
-    receiver: Arc<Mutex<Option<tokio::sync::mpsc::Receiver<WebhookResponse>>>>,
-    webhook_url: String,
-    wait_invoice_cancel_token: CancellationToken,
-    wait_invoice_is_active: Arc<AtomicBool>,
-}
-
-impl Phoenixd {
-    /// Create new [`Phoenixd`] wallet
-    pub fn new(
-        api_password: String,
-        api_url: String,
-        fee_reserve: FeeReserve,
-        receiver: Arc<Mutex<Option<tokio::sync::mpsc::Receiver<WebhookResponse>>>>,
-        webhook_url: String,
-    ) -> Result<Self, Error> {
-        let phoenixd = PhoenixdApi::new(&api_password, &api_url)?;
-        Ok(Self {
-            phoenixd_api: phoenixd,
-            fee_reserve,
-            receiver,
-            webhook_url,
-            wait_invoice_cancel_token: CancellationToken::new(),
-            wait_invoice_is_active: Arc::new(AtomicBool::new(false)),
-        })
-    }
-
-    /// Create invoice webhook
-    pub async fn create_invoice_webhook(
-        &self,
-        webhook_endpoint: &str,
-        sender: tokio::sync::mpsc::Sender<WebhookResponse>,
-    ) -> anyhow::Result<Router> {
-        self.phoenixd_api
-            .create_invoice_webhook_router(webhook_endpoint, sender)
-            .await
-    }
-}
-
-#[async_trait]
-impl MintLightning for Phoenixd {
-    type Err = cdk_lightning::Error;
-
-    fn get_settings(&self) -> Settings {
-        Settings {
-            mpp: false,
-            unit: CurrencyUnit::Sat,
-            invoice_description: true,
-        }
-    }
-    fn is_wait_invoice_active(&self) -> bool {
-        self.wait_invoice_is_active.load(Ordering::SeqCst)
-    }
-
-    fn cancel_wait_invoice(&self) {
-        self.wait_invoice_cancel_token.cancel()
-    }
-
-    async fn wait_any_invoice(
-        &self,
-    ) -> Result<Pin<Box<dyn Stream<Item = String> + Send>>, Self::Err> {
-        let receiver = self
-            .receiver
-            .lock()
-            .await
-            .take()
-            .ok_or(anyhow!("No receiver"))?;
-
-        let phoenixd_api = self.phoenixd_api.clone();
-
-        let cancel_token = self.wait_invoice_cancel_token.clone();
-
-        Ok(futures::stream::unfold(
-        (receiver, phoenixd_api, cancel_token,
-                Arc::clone(&self.wait_invoice_is_active),
-        ),
-        |(mut receiver, phoenixd_api, cancel_token, is_active)| async move {
-
-                is_active.store(true, Ordering::SeqCst);
-            tokio::select! {
-                _ = cancel_token.cancelled() => {
-                    // Stream is cancelled
-                    is_active.store(false, Ordering::SeqCst);
-                    tracing::info!("Waiting for phonixd invoice ending");
-                    None
-                }
-                msg_option = receiver.recv() => {
-                    match msg_option {
-                        Some(msg) => {
-                            let check = phoenixd_api.get_incoming_invoice(&msg.payment_hash).await;
-
-                            match check {
-                                Ok(state) => {
-                                    if state.is_paid {
-                                        // Yield the payment hash and continue the stream
-                                        Some((msg.payment_hash, (receiver, phoenixd_api, cancel_token, is_active)))
-                                    } else {
-                                        // Invoice not paid yet, continue waiting
-                                        // We need to continue the stream, so we return the same state
-                                        None
-                                    }
-                                }
-                                Err(e) => {
-                                    // Log the error and continue
-                                    tracing::warn!("Error checking invoice state: {:?}", e);
-                                    None
-                                }
-                            }
-                        }
-                        None => {
-                            // The receiver stream has ended
-                            None
-                        }
-                    }
-                }
-            }
-        },
-    )
-    .boxed())
-    }
-
-    async fn get_payment_quote(
-        &self,
-        melt_quote_request: &MeltQuoteBolt11Request,
-    ) -> Result<PaymentQuoteResponse, Self::Err> {
-        if CurrencyUnit::Sat != melt_quote_request.unit {
-            return Err(Error::UnsupportedUnit.into());
-        }
-
-        let amount = melt_quote_request.amount_msat()?;
-
-        let amount = amount / MSAT_IN_SAT.into();
-
-        let relative_fee_reserve =
-            (self.fee_reserve.percent_fee_reserve * u64::from(amount) as f32) as u64;
-
-        let absolute_fee_reserve: u64 = self.fee_reserve.min_fee_reserve.into();
-
-        let mut fee = match relative_fee_reserve > absolute_fee_reserve {
-            true => relative_fee_reserve,
-            false => absolute_fee_reserve,
-        };
-
-        // Fee in phoenixd is always 0.04 + 4 sat
-        fee = fee.checked_add(4).ok_or(Error::AmountOverflow)?;
-
-        Ok(PaymentQuoteResponse {
-            request_lookup_id: melt_quote_request.request.payment_hash().to_string(),
-            amount,
-            fee: fee.into(),
-            state: MeltQuoteState::Unpaid,
-        })
-    }
-
-    async fn pay_invoice(
-        &self,
-        melt_quote: mint::MeltQuote,
-        _partial_amount: Option<Amount>,
-        _max_fee_msats: Option<Amount>,
-    ) -> Result<PayInvoiceResponse, Self::Err> {
-        let msat_to_pay: Option<u64> = melt_quote
-            .msat_to_pay
-            .map(|a| <cdk::Amount as Into<u64>>::into(a) / MSAT_IN_SAT);
-
-        let pay_response = self
-            .phoenixd_api
-            .pay_bolt11_invoice(&melt_quote.request, msat_to_pay)
-            .await?;
-
-        // The pay invoice response does not give the needed fee info so we have to check.
-        let check_outgoing_response = self
-            .check_outgoing_payment(&pay_response.payment_id)
-            .await?;
-
-        let bolt11: Bolt11Invoice = melt_quote.request.parse()?;
-
-        Ok(PayInvoiceResponse {
-            payment_lookup_id: bolt11.payment_hash().to_string(),
-            payment_preimage: Some(pay_response.payment_preimage),
-            status: MeltQuoteState::Paid,
-            total_spent: check_outgoing_response.total_spent,
-            unit: CurrencyUnit::Sat,
-        })
-    }
-
-    async fn create_invoice(
-        &self,
-        amount: Amount,
-        unit: &CurrencyUnit,
-        description: String,
-        _unix_expiry: u64,
-    ) -> Result<CreateInvoiceResponse, Self::Err> {
-        let amount_sat = to_unit(amount, unit, &CurrencyUnit::Sat)?;
-
-        let invoice_request = InvoiceRequest {
-            external_id: None,
-            description: Some(description),
-            description_hash: None,
-            amount_sat: amount_sat.into(),
-            webhook_url: Some(self.webhook_url.clone()),
-        };
-
-        let create_invoice_response = self.phoenixd_api.create_invoice(invoice_request).await?;
-
-        let bolt11: Bolt11Invoice = create_invoice_response.serialized.parse()?;
-        let expiry = bolt11.expires_at().map(|t| t.as_secs());
-
-        Ok(CreateInvoiceResponse {
-            request_lookup_id: create_invoice_response.payment_hash,
-            request: bolt11.clone(),
-            expiry,
-        })
-    }
-
-    async fn check_incoming_invoice_status(
-        &self,
-        payment_hash: &str,
-    ) -> Result<MintQuoteState, Self::Err> {
-        let invoice = self.phoenixd_api.get_incoming_invoice(payment_hash).await?;
-
-        let state = match invoice.is_paid {
-            true => MintQuoteState::Paid,
-            false => MintQuoteState::Unpaid,
-        };
-
-        Ok(state)
-    }
-
-    /// Check the status of an outgoing invoice
-    async fn check_outgoing_payment(
-        &self,
-        payment_id: &str,
-    ) -> Result<PayInvoiceResponse, Self::Err> {
-        // We can only check the status of the payment if we have the payment id not if we only have a payment hash.
-        // In phd this is a uuid, that we get after getting a response from the pay invoice
-        if let Err(_err) = uuid::Uuid::from_str(payment_id) {
-            tracing::warn!("Could not check status of payment, no payment id");
-            return Ok(PayInvoiceResponse {
-                payment_lookup_id: payment_id.to_string(),
-                payment_preimage: None,
-                status: MeltQuoteState::Unknown,
-                total_spent: Amount::ZERO,
-                unit: CurrencyUnit::Sat,
-            });
-        }
-
-        let res = self.phoenixd_api.get_outgoing_invoice(payment_id).await;
-
-        let state = match res {
-            Ok(res) => {
-                let status = match res.is_paid {
-                    true => MeltQuoteState::Paid,
-                    false => MeltQuoteState::Unpaid,
-                };
-
-                let total_spent = res.sent + (res.fees + 999) / MSAT_IN_SAT;
-
-                PayInvoiceResponse {
-                    payment_lookup_id: res.payment_hash,
-                    payment_preimage: Some(res.preimage),
-                    status,
-                    total_spent: total_spent.into(),
-                    unit: CurrencyUnit::Sat,
-                }
-            }
-            Err(err) => match err {
-                phoenixd_rs::Error::NotFound => PayInvoiceResponse {
-                    payment_lookup_id: payment_id.to_string(),
-                    payment_preimage: None,
-                    status: MeltQuoteState::Unknown,
-                    total_spent: Amount::ZERO,
-                    unit: CurrencyUnit::Sat,
-                },
-                _ => {
-                    return Err(Error::from(err).into());
-                }
-            },
-        };
-
-        Ok(state)
-    }
-}

+ 0 - 4
misc/justfile.custom.just

@@ -77,8 +77,6 @@ release m="":
     "-p cdk-mint-rpc"
     "-p cdk-cln"
     "-p cdk-lnd"
-    "-p cdk-strike"
-    "-p cdk-phoenixd"
     "-p cdk-lnbits"
     "-p cdk-fake-wallet"
     "-p cdk-cli"
@@ -105,8 +103,6 @@ check-docs:
     "-p cdk-rexie"
     "-p cdk-cln"
     "-p cdk-lnd"
-    "-p cdk-strike"
-    "-p cdk-phoenixd"
     "-p cdk-lnbits"
     "-p cdk-fake-wallet"
     "-p cdk-mint-rpc"