Wallet: Check Pending Melt Quotes (#895)

* Add transaction for pending melt

* Check pending melt quotes

* Fix imports
This commit is contained in:
David Caseria
2025-07-17 03:37:38 -04:00
committed by GitHub
parent 0b88c990a9
commit bd2fbb13f9
6 changed files with 134 additions and 0 deletions

View File

@@ -530,6 +530,30 @@ ON CONFLICT(id) DO UPDATE SET
.transpose()?)
}
#[instrument(skip(self))]
async fn get_melt_quotes(&self) -> Result<Vec<wallet::MeltQuote>, Self::Err> {
Ok(Statement::new(
r#"
SELECT
id,
unit,
amount,
request,
fee_reserve,
state,
expiry,
payment_preimage
FROM
melt_quote
"#,
)
.fetch_all(&self.pool.get().map_err(Error::Pool)?)
.map_err(Error::Sqlite)?
.into_iter()
.map(sqlite_row_to_melt_quote)
.collect::<Result<_, _>>()?)
}
#[instrument(skip(self))]
async fn remove_melt_quote(&self, quote_id: &str) -> Result<(), Self::Err> {
Statement::new(r#"DELETE FROM melt_quote WHERE id=:id"#)