From 5cd03b0027ee3a97f06f5994fd0d00b268a2e0d2 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Wed, 10 Apr 2024 22:48:53 +0100 Subject: [PATCH] refactor: consolidate to one CDK crate Having the two crates adds complexity without benefit since features can be used instead --- Cargo.toml | 9 - crates/cashu/Cargo.toml | 37 ---- crates/cashu/src/error.rs | 184 ------------------ crates/cashu/src/lib.rs | 20 -- crates/cdk/Cargo.toml | 28 +-- crates/{cashu => cdk}/src/amount.rs | 0 crates/{cashu => cdk}/src/dhke.rs | 0 crates/cdk/src/error.rs | 183 +++++++++++++++++ crates/cdk/src/lib.rs | 27 ++- crates/{cashu => cdk}/src/nuts/mod.rs | 0 crates/{cashu => cdk}/src/nuts/nut00.rs | 0 crates/{cashu => cdk}/src/nuts/nut01/mod.rs | 0 .../src/nuts/nut01/public_key.rs | 0 .../src/nuts/nut01/secret_key.rs | 0 crates/{cashu => cdk}/src/nuts/nut02.rs | 0 crates/{cashu => cdk}/src/nuts/nut03.rs | 0 crates/{cashu => cdk}/src/nuts/nut04.rs | 0 crates/{cashu => cdk}/src/nuts/nut05.rs | 0 crates/{cashu => cdk}/src/nuts/nut06.rs | 0 crates/{cashu => cdk}/src/nuts/nut07.rs | 0 crates/{cashu => cdk}/src/nuts/nut08.rs | 0 crates/{cashu => cdk}/src/nuts/nut09.rs | 0 crates/{cashu => cdk}/src/nuts/nut10.rs | 0 crates/{cashu => cdk}/src/nuts/nut11.rs | 0 crates/{cashu => cdk}/src/nuts/nut12.rs | 0 crates/{cashu => cdk}/src/nuts/nut13.rs | 0 crates/{cashu => cdk}/src/secret.rs | 0 crates/{cashu => cdk}/src/serde_utils.rs | 0 crates/{cashu => cdk}/src/types.rs | 0 crates/{cashu => cdk}/src/url.rs | 0 crates/{cashu => cdk}/src/util/hex.rs | 0 crates/{cashu => cdk}/src/util/mod.rs | 0 32 files changed, 219 insertions(+), 269 deletions(-) delete mode 100644 crates/cashu/Cargo.toml delete mode 100644 crates/cashu/src/error.rs delete mode 100644 crates/cashu/src/lib.rs rename crates/{cashu => cdk}/src/amount.rs (100%) rename crates/{cashu => cdk}/src/dhke.rs (100%) rename crates/{cashu => cdk}/src/nuts/mod.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut00.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut01/mod.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut01/public_key.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut01/secret_key.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut02.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut03.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut04.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut05.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut06.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut07.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut08.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut09.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut10.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut11.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut12.rs (100%) rename crates/{cashu => cdk}/src/nuts/nut13.rs (100%) rename crates/{cashu => cdk}/src/secret.rs (100%) rename crates/{cashu => cdk}/src/serde_utils.rs (100%) rename crates/{cashu => cdk}/src/types.rs (100%) rename crates/{cashu => cdk}/src/url.rs (100%) rename crates/{cashu => cdk}/src/util/hex.rs (100%) rename crates/{cashu => cdk}/src/util/mod.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index fcc9216b..94e84a24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,5 @@ [workspace] members = [ - "crates/cashu", "crates/cdk", ] resolver = "2" @@ -21,15 +20,7 @@ license-file = "LICENSE" keywords = ["bitcoin", "e-cash", "cashu"] [workspace.dependencies] -serde = { version = "1.0.160", features = ["derive"]} -serde_json = "1.0.96" -url = "2.3.1" tokio = { version = "1.32", default-features = false } -tracing = { version = "0.1", default-features = false } -tracing-subscriber = "0.3" -uniffi = "0.24" -thiserror = "1.0.50" -getrandom = { version = "0.2", features = ["js"] } [profile] diff --git a/crates/cashu/Cargo.toml b/crates/cashu/Cargo.toml deleted file mode 100644 index c92cf2bc..00000000 --- a/crates/cashu/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "cashu" -version = "0.4.1-ALPHA" -edition = "2021" -authors = ["thesimplekid"] -readme = "README.md" -homepage.workspace = true -repository.workspace = true -license.workspace = true -rust-version.workspace = true # MSRV -description = "Cashu rust wallet and mint library" - - -[features] -default = ["mint", "wallet", "all-nuts"] -mint = [] -wallet = [] -all-nuts = ["nut13"] -nut13 = ["dep:bip39"] - -[dependencies] -base64 = "0.21" # bitcoin uses v0.21 (optional dep) -bip39 = { version = "2.0", optional = true } -bitcoin = { version = "0.30", features = ["serde", "rand", "rand-std"] } # lightning-invoice uses v0.30 -lightning-invoice = { version = "0.29", features = ["serde"] } -once_cell = "1.19" -serde.workspace = true -serde_json.workspace = true -serde_with = "3.4" -url.workspace = true -thiserror.workspace = true -tracing.workspace = true -uuid = { version = "1.6", features = ["v4"] } - -[target.'cfg(target_arch = "wasm32")'.dependencies] -getrandom.workspace = true -instant = { version = "0.1", features = [ "wasm-bindgen", "inaccurate" ] } diff --git a/crates/cashu/src/error.rs b/crates/cashu/src/error.rs deleted file mode 100644 index 519a64e2..00000000 --- a/crates/cashu/src/error.rs +++ /dev/null @@ -1,184 +0,0 @@ -use std::string::FromUtf8Error; - -use serde::{Deserialize, Serialize}; -use thiserror::Error; - -use crate::util::hex; - -#[derive(Debug, Error)] -pub enum Error { - /// Parse Url Error - #[error("`{0}`")] - UrlParseError(#[from] url::ParseError), - /// Utf8 parse error - #[error("`{0}`")] - Utf8ParseError(#[from] FromUtf8Error), - /// Serde Json error - #[error("`{0}`")] - SerdeJsonError(#[from] serde_json::Error), - /// Base64 error - #[error("`{0}`")] - Base64Error(#[from] base64::DecodeError), - /// From hex error - #[error("`{0}`")] - HexError(#[from] hex::Error), - /// Secp256k1 error - #[error("`{0}`")] - Secp256k1(#[from] bitcoin::secp256k1::Error), - #[error("No Key for Amoun")] - AmountKey, - #[error("Amount miss match")] - Amount, - #[error("Token already spent")] - TokenSpent, - #[error("Token not verified")] - TokenNotVerifed, - #[error("Invoice Amount undefined")] - InvoiceAmountUndefined, - #[error("Proof missing required field")] - MissingProofField, - #[error("No valid point found")] - NoValidPoint, - #[error("Kind not found")] - KindNotFound, - #[error("Unknown Tag")] - UnknownTag, - #[error("Incorrect Secret Kind")] - IncorrectSecretKind, - #[error("Spending conditions not met")] - SpendConditionsNotMet, - #[error("Could not convert key")] - Key, - #[error("Invalid signature")] - InvalidSignature, - #[error("Locktime in past")] - LocktimeInPast, - #[error("`{0}`")] - Secret(#[from] super::secret::Error), - #[error("`{0}`")] - NUT01(#[from] crate::nuts::nut01::Error), - #[error("`{0}`")] - NUT02(#[from] crate::nuts::nut02::Error), - #[cfg(feature = "nut13")] - #[error("`{0}`")] - Bip32(#[from] bitcoin::bip32::Error), - #[error("`{0}`")] - ParseInt(#[from] std::num::ParseIntError), - /// Custom error - #[error("`{0}`")] - CustomError(String), -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct ErrorResponse { - pub code: u32, - pub error: Option, - pub detail: Option, -} - -impl ErrorResponse { - pub fn from_json(json: &str) -> Result { - if let Ok(res) = serde_json::from_str::(json) { - Ok(res) - } else { - Ok(Self { - code: 999, - error: Some(json.to_string()), - detail: None, - }) - } - } -} - -pub mod wallet { - use std::string::FromUtf8Error; - - use thiserror::Error; - - use crate::nuts::nut01; - - #[derive(Debug, Error)] - pub enum Error { - /// Serde Json error - #[error("`{0}`")] - SerdeJsonError(#[from] serde_json::Error), - /// Secp256k1 error - #[error("`{0}`")] - Secp256k1(#[from] bitcoin::secp256k1::Error), - /// NUT01 error - #[error("`{0}`")] - NUT01(#[from] nut01::Error), - /// Insufficient Funds - #[error("Insufficient funds")] - InsufficientFunds, - /// Utf8 parse error - #[error("`{0}`")] - Utf8ParseError(#[from] FromUtf8Error), - /// Base64 error - #[error("`{0}`")] - Base64Error(#[from] base64::DecodeError), - /// Unsupported Token - #[error("Token unsupported")] - UnsupportedToken, - /// Token Requires proofs - #[error("Proofs Required")] - ProofsRequired, - /// Url Parse error - #[error("Url Parse")] - UrlParse, - #[error("`{0}`")] - Secret(#[from] crate::secret::Error), - #[error("`{0}`")] - Cashu(#[from] super::Error), - /// Custom Error message - #[error("`{0}`")] - CustomError(String), - } - - impl From for Error { - fn from(_err: crate::url::Error) -> Error { - Error::UrlParse - } - } -} - -pub mod mint { - use thiserror::Error; - - use crate::nuts::nut01; - - #[derive(Debug, Error)] - pub enum Error { - #[error("No key for amount")] - AmountKey, - #[error("Amount miss match")] - Amount, - #[error("Token Already Spent")] - TokenSpent, - /// Secp256k1 error - #[error("`{0}`")] - Secp256k1(#[from] bitcoin::secp256k1::Error), - /// NUT01 error - #[error("`{0}`")] - NUT01(#[from] nut01::Error), - #[error("`Token not verified`")] - TokenNotVerifed, - #[error("Invoice amount undefined")] - InvoiceAmountUndefined, - /// Duplicate Proofs sent in request - #[error("Duplicate proofs")] - DuplicateProofs, - /// Keyset id not active - #[error("Keyset id is not active")] - InactiveKeyset, - /// Keyset is not known - #[error("Unknown Keyset")] - UnknownKeySet, - #[error("`{0}`")] - Secret(#[from] crate::secret::Error), - #[error("`{0}`")] - Cashu(#[from] super::Error), - #[error("`{0}`")] - CustomError(String), - } -} diff --git a/crates/cashu/src/lib.rs b/crates/cashu/src/lib.rs deleted file mode 100644 index 6e55d7ff..00000000 --- a/crates/cashu/src/lib.rs +++ /dev/null @@ -1,20 +0,0 @@ -extern crate core; - -pub use bitcoin::hashes::sha256::Hash as Sha256; -pub use bitcoin::secp256k1; -pub use lightning_invoice::{self, Bolt11Invoice}; - -pub mod amount; -pub mod dhke; -pub mod error; -pub mod nuts; -pub mod secret; -pub mod serde_utils; -pub mod types; -pub mod url; -pub mod util; - -pub use self::amount::Amount; -pub use self::util::SECP256K1; - -pub type Result> = std::result::Result; diff --git a/crates/cdk/Cargo.toml b/crates/cdk/Cargo.toml index adaaae48..6673fd5b 100644 --- a/crates/cdk/Cargo.toml +++ b/crates/cdk/Cargo.toml @@ -11,25 +11,30 @@ license.workspace = true [features] default = ["mint", "wallet", "all-nuts", "redb"] -mint = ["cashu/mint"] -wallet = ["cashu/wallet", "dep:minreq"] +mint = [] +wallet = ["dep:minreq"] gloo = ["dep:gloo"] all-nuts = ["nut13"] -nut13 = ["cashu/nut13"] +nut13 = ["dep:bip39"] redb = ["dep:redb"] [dependencies] -bip39 = "2.0.0" -cashu = { path = "../cashu" } -serde = { workspace = true } -serde_json = { workspace = true } -url = { workspace = true } -tracing = { workspace = true } -thiserror = { workspace = true } +base64 = "0.21" # bitcoin uses v0.21 (optional dep) +bip39 = { version = "2.0", optional = true } +bitcoin = { version = "0.30", features = ["serde", "rand", "rand-std"] } # lightning-invoice uses v0.30 +lightning-invoice = { version = "0.29", features = ["serde"] } +once_cell = "1.19" +serde = { version = "1.0.160", default-features = false, features = ["derive"]} +serde_json = { version = "1.0.96", default-features = false } +serde_with = "3.4" +url = "2.3.1" +tracing = { version = "0.1", default-features = false } +thiserror = "1.0.50" async-trait = "0.1.74" gloo = { version = "0.11.0", optional = true, features = ["net"] } http = "1.0.0" +uuid = { version = "1.6", features = ["v4"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] tokio = { workspace = true, features = ["rt-multi-thread", "time", "macros", "sync"] } @@ -38,6 +43,7 @@ redb = { version = "2.0.0", optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] tokio = { workspace = true, features = ["rt", "macros", "sync", "time"] } -getrandom = { workspace = true } +getrandom = { version = "0.2.14" } +instant = { version = "0.1", features = [ "wasm-bindgen", "inaccurate" ] } diff --git a/crates/cashu/src/amount.rs b/crates/cdk/src/amount.rs similarity index 100% rename from crates/cashu/src/amount.rs rename to crates/cdk/src/amount.rs diff --git a/crates/cashu/src/dhke.rs b/crates/cdk/src/dhke.rs similarity index 100% rename from crates/cashu/src/dhke.rs rename to crates/cdk/src/dhke.rs diff --git a/crates/cdk/src/error.rs b/crates/cdk/src/error.rs index 8b137891..519a64e2 100644 --- a/crates/cdk/src/error.rs +++ b/crates/cdk/src/error.rs @@ -1 +1,184 @@ +use std::string::FromUtf8Error; +use serde::{Deserialize, Serialize}; +use thiserror::Error; + +use crate::util::hex; + +#[derive(Debug, Error)] +pub enum Error { + /// Parse Url Error + #[error("`{0}`")] + UrlParseError(#[from] url::ParseError), + /// Utf8 parse error + #[error("`{0}`")] + Utf8ParseError(#[from] FromUtf8Error), + /// Serde Json error + #[error("`{0}`")] + SerdeJsonError(#[from] serde_json::Error), + /// Base64 error + #[error("`{0}`")] + Base64Error(#[from] base64::DecodeError), + /// From hex error + #[error("`{0}`")] + HexError(#[from] hex::Error), + /// Secp256k1 error + #[error("`{0}`")] + Secp256k1(#[from] bitcoin::secp256k1::Error), + #[error("No Key for Amoun")] + AmountKey, + #[error("Amount miss match")] + Amount, + #[error("Token already spent")] + TokenSpent, + #[error("Token not verified")] + TokenNotVerifed, + #[error("Invoice Amount undefined")] + InvoiceAmountUndefined, + #[error("Proof missing required field")] + MissingProofField, + #[error("No valid point found")] + NoValidPoint, + #[error("Kind not found")] + KindNotFound, + #[error("Unknown Tag")] + UnknownTag, + #[error("Incorrect Secret Kind")] + IncorrectSecretKind, + #[error("Spending conditions not met")] + SpendConditionsNotMet, + #[error("Could not convert key")] + Key, + #[error("Invalid signature")] + InvalidSignature, + #[error("Locktime in past")] + LocktimeInPast, + #[error("`{0}`")] + Secret(#[from] super::secret::Error), + #[error("`{0}`")] + NUT01(#[from] crate::nuts::nut01::Error), + #[error("`{0}`")] + NUT02(#[from] crate::nuts::nut02::Error), + #[cfg(feature = "nut13")] + #[error("`{0}`")] + Bip32(#[from] bitcoin::bip32::Error), + #[error("`{0}`")] + ParseInt(#[from] std::num::ParseIntError), + /// Custom error + #[error("`{0}`")] + CustomError(String), +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ErrorResponse { + pub code: u32, + pub error: Option, + pub detail: Option, +} + +impl ErrorResponse { + pub fn from_json(json: &str) -> Result { + if let Ok(res) = serde_json::from_str::(json) { + Ok(res) + } else { + Ok(Self { + code: 999, + error: Some(json.to_string()), + detail: None, + }) + } + } +} + +pub mod wallet { + use std::string::FromUtf8Error; + + use thiserror::Error; + + use crate::nuts::nut01; + + #[derive(Debug, Error)] + pub enum Error { + /// Serde Json error + #[error("`{0}`")] + SerdeJsonError(#[from] serde_json::Error), + /// Secp256k1 error + #[error("`{0}`")] + Secp256k1(#[from] bitcoin::secp256k1::Error), + /// NUT01 error + #[error("`{0}`")] + NUT01(#[from] nut01::Error), + /// Insufficient Funds + #[error("Insufficient funds")] + InsufficientFunds, + /// Utf8 parse error + #[error("`{0}`")] + Utf8ParseError(#[from] FromUtf8Error), + /// Base64 error + #[error("`{0}`")] + Base64Error(#[from] base64::DecodeError), + /// Unsupported Token + #[error("Token unsupported")] + UnsupportedToken, + /// Token Requires proofs + #[error("Proofs Required")] + ProofsRequired, + /// Url Parse error + #[error("Url Parse")] + UrlParse, + #[error("`{0}`")] + Secret(#[from] crate::secret::Error), + #[error("`{0}`")] + Cashu(#[from] super::Error), + /// Custom Error message + #[error("`{0}`")] + CustomError(String), + } + + impl From for Error { + fn from(_err: crate::url::Error) -> Error { + Error::UrlParse + } + } +} + +pub mod mint { + use thiserror::Error; + + use crate::nuts::nut01; + + #[derive(Debug, Error)] + pub enum Error { + #[error("No key for amount")] + AmountKey, + #[error("Amount miss match")] + Amount, + #[error("Token Already Spent")] + TokenSpent, + /// Secp256k1 error + #[error("`{0}`")] + Secp256k1(#[from] bitcoin::secp256k1::Error), + /// NUT01 error + #[error("`{0}`")] + NUT01(#[from] nut01::Error), + #[error("`Token not verified`")] + TokenNotVerifed, + #[error("Invoice amount undefined")] + InvoiceAmountUndefined, + /// Duplicate Proofs sent in request + #[error("Duplicate proofs")] + DuplicateProofs, + /// Keyset id not active + #[error("Keyset id is not active")] + InactiveKeyset, + /// Keyset is not known + #[error("Unknown Keyset")] + UnknownKeySet, + #[error("`{0}`")] + Secret(#[from] crate::secret::Error), + #[error("`{0}`")] + Cashu(#[from] super::Error), + #[error("`{0}`")] + CustomError(String), + } +} diff --git a/crates/cdk/src/lib.rs b/crates/cdk/src/lib.rs index 939613a1..6e55d7ff 100644 --- a/crates/cdk/src/lib.rs +++ b/crates/cdk/src/lib.rs @@ -1,9 +1,20 @@ -pub use bip39::Mnemonic; -pub use cashu::{self, *}; +extern crate core; -#[cfg(feature = "wallet")] -pub mod client; -#[cfg(feature = "mint")] -pub mod mint; -#[cfg(feature = "wallet")] -pub mod wallet; +pub use bitcoin::hashes::sha256::Hash as Sha256; +pub use bitcoin::secp256k1; +pub use lightning_invoice::{self, Bolt11Invoice}; + +pub mod amount; +pub mod dhke; +pub mod error; +pub mod nuts; +pub mod secret; +pub mod serde_utils; +pub mod types; +pub mod url; +pub mod util; + +pub use self::amount::Amount; +pub use self::util::SECP256K1; + +pub type Result> = std::result::Result; diff --git a/crates/cashu/src/nuts/mod.rs b/crates/cdk/src/nuts/mod.rs similarity index 100% rename from crates/cashu/src/nuts/mod.rs rename to crates/cdk/src/nuts/mod.rs diff --git a/crates/cashu/src/nuts/nut00.rs b/crates/cdk/src/nuts/nut00.rs similarity index 100% rename from crates/cashu/src/nuts/nut00.rs rename to crates/cdk/src/nuts/nut00.rs diff --git a/crates/cashu/src/nuts/nut01/mod.rs b/crates/cdk/src/nuts/nut01/mod.rs similarity index 100% rename from crates/cashu/src/nuts/nut01/mod.rs rename to crates/cdk/src/nuts/nut01/mod.rs diff --git a/crates/cashu/src/nuts/nut01/public_key.rs b/crates/cdk/src/nuts/nut01/public_key.rs similarity index 100% rename from crates/cashu/src/nuts/nut01/public_key.rs rename to crates/cdk/src/nuts/nut01/public_key.rs diff --git a/crates/cashu/src/nuts/nut01/secret_key.rs b/crates/cdk/src/nuts/nut01/secret_key.rs similarity index 100% rename from crates/cashu/src/nuts/nut01/secret_key.rs rename to crates/cdk/src/nuts/nut01/secret_key.rs diff --git a/crates/cashu/src/nuts/nut02.rs b/crates/cdk/src/nuts/nut02.rs similarity index 100% rename from crates/cashu/src/nuts/nut02.rs rename to crates/cdk/src/nuts/nut02.rs diff --git a/crates/cashu/src/nuts/nut03.rs b/crates/cdk/src/nuts/nut03.rs similarity index 100% rename from crates/cashu/src/nuts/nut03.rs rename to crates/cdk/src/nuts/nut03.rs diff --git a/crates/cashu/src/nuts/nut04.rs b/crates/cdk/src/nuts/nut04.rs similarity index 100% rename from crates/cashu/src/nuts/nut04.rs rename to crates/cdk/src/nuts/nut04.rs diff --git a/crates/cashu/src/nuts/nut05.rs b/crates/cdk/src/nuts/nut05.rs similarity index 100% rename from crates/cashu/src/nuts/nut05.rs rename to crates/cdk/src/nuts/nut05.rs diff --git a/crates/cashu/src/nuts/nut06.rs b/crates/cdk/src/nuts/nut06.rs similarity index 100% rename from crates/cashu/src/nuts/nut06.rs rename to crates/cdk/src/nuts/nut06.rs diff --git a/crates/cashu/src/nuts/nut07.rs b/crates/cdk/src/nuts/nut07.rs similarity index 100% rename from crates/cashu/src/nuts/nut07.rs rename to crates/cdk/src/nuts/nut07.rs diff --git a/crates/cashu/src/nuts/nut08.rs b/crates/cdk/src/nuts/nut08.rs similarity index 100% rename from crates/cashu/src/nuts/nut08.rs rename to crates/cdk/src/nuts/nut08.rs diff --git a/crates/cashu/src/nuts/nut09.rs b/crates/cdk/src/nuts/nut09.rs similarity index 100% rename from crates/cashu/src/nuts/nut09.rs rename to crates/cdk/src/nuts/nut09.rs diff --git a/crates/cashu/src/nuts/nut10.rs b/crates/cdk/src/nuts/nut10.rs similarity index 100% rename from crates/cashu/src/nuts/nut10.rs rename to crates/cdk/src/nuts/nut10.rs diff --git a/crates/cashu/src/nuts/nut11.rs b/crates/cdk/src/nuts/nut11.rs similarity index 100% rename from crates/cashu/src/nuts/nut11.rs rename to crates/cdk/src/nuts/nut11.rs diff --git a/crates/cashu/src/nuts/nut12.rs b/crates/cdk/src/nuts/nut12.rs similarity index 100% rename from crates/cashu/src/nuts/nut12.rs rename to crates/cdk/src/nuts/nut12.rs diff --git a/crates/cashu/src/nuts/nut13.rs b/crates/cdk/src/nuts/nut13.rs similarity index 100% rename from crates/cashu/src/nuts/nut13.rs rename to crates/cdk/src/nuts/nut13.rs diff --git a/crates/cashu/src/secret.rs b/crates/cdk/src/secret.rs similarity index 100% rename from crates/cashu/src/secret.rs rename to crates/cdk/src/secret.rs diff --git a/crates/cashu/src/serde_utils.rs b/crates/cdk/src/serde_utils.rs similarity index 100% rename from crates/cashu/src/serde_utils.rs rename to crates/cdk/src/serde_utils.rs diff --git a/crates/cashu/src/types.rs b/crates/cdk/src/types.rs similarity index 100% rename from crates/cashu/src/types.rs rename to crates/cdk/src/types.rs diff --git a/crates/cashu/src/url.rs b/crates/cdk/src/url.rs similarity index 100% rename from crates/cashu/src/url.rs rename to crates/cdk/src/url.rs diff --git a/crates/cashu/src/util/hex.rs b/crates/cdk/src/util/hex.rs similarity index 100% rename from crates/cashu/src/util/hex.rs rename to crates/cdk/src/util/hex.rs diff --git a/crates/cashu/src/util/mod.rs b/crates/cdk/src/util/mod.rs similarity index 100% rename from crates/cashu/src/util/mod.rs rename to crates/cdk/src/util/mod.rs