Introduce cashu to host the shared types, traits and other common code (#519)

---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
This commit is contained in:
C
2025-01-12 09:50:05 -03:00
committed by GitHub
parent 8ac766dd62
commit 8fe0982c6d
93 changed files with 1341 additions and 963 deletions

View File

@@ -0,0 +1,34 @@
//! CDK Database
#[cfg(feature = "mint")]
mod mint;
#[cfg(feature = "wallet")]
mod wallet;
#[cfg(feature = "mint")]
pub use mint::Database as MintDatabase;
#[cfg(feature = "wallet")]
pub use wallet::Database as WalletDatabase;
/// CDK_database error
#[derive(Debug, thiserror::Error)]
pub enum Error {
/// Database Error
#[error(transparent)]
Database(Box<dyn std::error::Error + Send + Sync>),
/// DHKE error
#[error(transparent)]
DHKE(#[from] crate::dhke::Error),
/// NUT00 Error
#[error(transparent)]
NUT00(#[from] crate::nuts::nut00::Error),
/// NUT02 Error
#[error(transparent)]
NUT02(#[from] crate::nuts::nut02::Error),
/// Serde Error
#[error(transparent)]
Serde(#[from] serde_json::Error),
/// Unknown Quote
#[error("Unknown Quote")]
UnknownQuote,
}