diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8e2cd92e..ecfff9cd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -30,6 +30,7 @@ jobs:
-p cdk --no-default-features,
-p cdk --no-default-features --features wallet,
-p cdk --no-default-features --features mint,
+ -p cdk --no-default-features --features wallet --features nostr,
-p cdk-redb
]
steps:
@@ -64,6 +65,7 @@ jobs:
-p cdk,
-p cdk --no-default-features,
-p cdk --no-default-features --features wallet,
+ -p cdk --no-default-features --features wallet --features nostr,
-p cdk-js
]
steps:
diff --git a/.helix/languages.toml b/.helix/languages.toml
index 22210359..fd2475f5 100644
--- a/.helix/languages.toml
+++ b/.helix/languages.toml
@@ -1,2 +1,2 @@
[language-server.rust-analyzer.config]
-cargo = { features = ["wallet", "mint"] }
+cargo = { features = ["wallet", "mint", "nostr"] }
diff --git a/crates/cdk-redb/Cargo.toml b/crates/cdk-redb/Cargo.toml
index a2a88cdd..b076fb84 100644
--- a/crates/cdk-redb/Cargo.toml
+++ b/crates/cdk-redb/Cargo.toml
@@ -12,6 +12,7 @@ rust-version.workspace = true
default = ["mint", "wallet"]
mint = ["cdk/mint"]
wallet = ["cdk/wallet"]
+nostr = ["cdk/nostr"]
[dependencies]
async-trait.workspace = true
diff --git a/crates/cdk-redb/src/wallet.rs b/crates/cdk-redb/src/wallet.rs
index c36f0e84..2686d681 100644
--- a/crates/cdk-redb/src/wallet.rs
+++ b/crates/cdk-redb/src/wallet.rs
@@ -5,6 +5,8 @@ use std::sync::Arc;
use async_trait::async_trait;
use cdk::cdk_database;
use cdk::cdk_database::WalletDatabase;
+#[cfg(feature = "nostr")]
+use cdk::nuts::PublicKey;
use cdk::nuts::{Id, KeySetInfo, Keys, MintInfo, Proofs};
use cdk::types::{MeltQuote, MintQuote};
use cdk::url::UncheckedUrl;
@@ -25,6 +27,8 @@ const PENDING_PROOFS_TABLE: MultimapTableDefinition<&str, &str> =
MultimapTableDefinition::new("pending_proofs");
const CONFIG_TABLE: TableDefinition<&str, &str> = TableDefinition::new("config");
const KEYSET_COUNTER: TableDefinition<&str, u32> = TableDefinition::new("keyset_counter");
+#[cfg(feature = "nostr")]
+const NOSTR_LAST_CHECKED: TableDefinition<&str, u32> = TableDefinition::new("keyset_counter");
const DATABASE_VERSION: u32 = 0;
@@ -64,6 +68,8 @@ impl RedbWalletDatabase {
let _ = write_txn.open_table(MINT_KEYS_TABLE)?;
let _ = write_txn.open_multimap_table(PROOFS_TABLE)?;
let _ = write_txn.open_table(KEYSET_COUNTER)?;
+ #[cfg(feature = "nostr")]
+ let _ = write_txn.open_table(NOSTR_LAST_CHECKED)?;
table.insert("db_version", "0")?;
}
}
@@ -562,4 +568,45 @@ impl WalletDatabase for RedbWalletDatabase {
Ok(counter.map(|c| c.value()))
}
+
+ #[cfg(feature = "nostr")]
+ #[instrument(skip(self))]
+ async fn get_nostr_last_checked(
+ &self,
+ verifying_key: &PublicKey,
+ ) -> Result