mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-23 23:55:01 +01:00
Wallet: Check Pending Melt Quotes (#895)
* Add transaction for pending melt * Check pending melt quotes * Fix imports
This commit is contained in:
@@ -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"#)
|
||||
|
||||
Reference in New Issue
Block a user