mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-23 14:06:56 +01:00
refactor: cdk MSRV
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
[package]
|
||||
name = "cdk-axum"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
description = "Cashu CDK axum webserver"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
async-trait.workspace = true
|
||||
axum.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["mint"] }
|
||||
tokio.workspace = true
|
||||
tower-http.workspace = true
|
||||
tracing.workspace = true
|
||||
futures.workspace = true
|
||||
anyhow = "1"
|
||||
async-trait = "0.1"
|
||||
axum = "0.6.20"
|
||||
cdk = { path = "../cdk", default-features = false, features = ["mint"] }
|
||||
tokio = { version = "1", default-features = false }
|
||||
tower-http = { version = "0.4.4", features = ["cors"] }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
|
||||
@@ -58,8 +58,9 @@ pub async fn create_mint_router(
|
||||
Ok(mint_router)
|
||||
}
|
||||
|
||||
/// CDK Mint State
|
||||
#[derive(Clone)]
|
||||
struct MintState {
|
||||
pub struct MintState {
|
||||
ln: HashMap<LnKey, Arc<dyn MintLightning<Err = cdk_lightning::Error> + Send + Sync>>,
|
||||
mint: Arc<Mint>,
|
||||
mint_url: MintUrl,
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
[package]
|
||||
name = "cdk-cli"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
description = "Cashu cli wallet built on CDK"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
bip39.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["wallet"] }
|
||||
cdk-redb = { workspace = true, default-features = false, features = ["wallet"] }
|
||||
cdk-sqlite = { workspace = true, default-features = false, features = ["wallet"] }
|
||||
clap.workspace = true
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
rand.workspace = true
|
||||
home.workspace = true
|
||||
anyhow = "1"
|
||||
bip39 = "2.0"
|
||||
cdk = { path = "../cdk", default-features = false, features = ["wallet"] }
|
||||
cdk-redb = { path = "../cdk-redb", default-features = false, features = ["wallet"] }
|
||||
cdk-sqlite = { path = "../cdk-sqlite", default-features = false, features = ["wallet"] }
|
||||
clap = { version = "4.4.8", features = ["derive", "env", "default"] }
|
||||
serde = { version = "1", default-features = false, features = ["derive"] }
|
||||
serde_json = "1"
|
||||
tokio = { version = "1", default-features = false }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||
rand = "0.8.5"
|
||||
home = "0.5.5"
|
||||
nostr-sdk = { version = "0.33.0", default-features = false, features = [
|
||||
"nip04",
|
||||
"nip44"
|
||||
]}
|
||||
url.workspace = true
|
||||
url = "2.3"
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
[package]
|
||||
name = "cdk-cln"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
description = "CDK ln backend for cln"
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
bitcoin.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["mint"] }
|
||||
async-trait = "0.1"
|
||||
bitcoin = { version = "0.30", default-features = false } # lightning-invoice uses v0.30
|
||||
cdk = { path = "../cdk", default-features = false, features = ["mint"] }
|
||||
cln-rpc = "0.1.9"
|
||||
futures.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
thiserror.workspace = true
|
||||
uuid.workspace = true
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
tokio = { version = "1", default-features = false }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
thiserror = "1"
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
[package]
|
||||
name = "cdk-fake-wallet"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
description = "CDK ln backend for cln"
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
description = "CDK fake ln backend"
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
bitcoin.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["mint"] }
|
||||
futures.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
thiserror.workspace = true
|
||||
uuid.workspace = true
|
||||
lightning-invoice.workspace = true
|
||||
async-trait = "0.1.74"
|
||||
bitcoin = { version = "0.30", default-features = false } # lightning-invoice uses v0.30
|
||||
cdk = { path = "../cdk", default-features = false, features = ["mint"] }
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
tokio = { version = "1", default-features = false }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
thiserror = "1"
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
lightning-invoice = { version = "0.31", features = ["serde"] }
|
||||
lightning = "0.0.123"
|
||||
tokio-stream = "0.1.15"
|
||||
rand.workspace = true
|
||||
rand = "0.8.5"
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
[package]
|
||||
name = "cdk-integration-tests"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
description = "Core Cashu Development Kit library implementing the Cashu protocol"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
|
||||
|
||||
[features]
|
||||
|
||||
|
||||
[dependencies]
|
||||
axum.workspace = true
|
||||
rand.workspace = true
|
||||
bip39 = { workspace = true, features = ["rand"] }
|
||||
anyhow.workspace = true
|
||||
cdk = { workspace = true, features = ["mint", "wallet"] }
|
||||
cdk-axum.workspace = true
|
||||
cdk-fake-wallet.workspace = true
|
||||
tower-http.workspace = true
|
||||
futures.workspace = true
|
||||
axum = "0.6.20"
|
||||
rand = "0.8.5"
|
||||
bip39 = { version = "2.0", features = ["rand"] }
|
||||
anyhow = "1"
|
||||
cdk = { path = "../cdk", features = ["mint", "wallet"] }
|
||||
cdk-axum = { path = "../cdk-axum"}
|
||||
cdk-fake-wallet = { path = "../cdk-fake-wallet" }
|
||||
tower-http = { version = "0.4.4", features = ["cors"] }
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
tokio = { workspace = true, features = [
|
||||
tokio = { version = "1", features = [
|
||||
"rt-multi-thread",
|
||||
"time",
|
||||
"macros",
|
||||
@@ -33,18 +33,15 @@ tokio = { workspace = true, features = [
|
||||
] }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
tokio = { workspace = true, features = ["rt", "macros", "sync", "time"] }
|
||||
tokio = { version = "1", features = ["rt", "macros", "sync", "time"] }
|
||||
getrandom = { version = "0.2", features = ["js"] }
|
||||
instant = { version = "0.1", features = ["wasm-bindgen", "inaccurate"] }
|
||||
|
||||
[dev-dependencies]
|
||||
axum.workspace = true
|
||||
rand.workspace = true
|
||||
bip39 = { workspace = true, features = ["rand"] }
|
||||
anyhow.workspace = true
|
||||
cdk = { workspace = true, features = ["mint", "wallet"] }
|
||||
cdk-axum.workspace = true
|
||||
cdk-fake-wallet.workspace = true
|
||||
tower-http.workspace = true
|
||||
# cdk-redb.workspace = true
|
||||
# cdk-sqlite.workspace = true
|
||||
rand = "0.8.5"
|
||||
bip39 = { version= "2.0", features = ["rand"] }
|
||||
anyhow = "1"
|
||||
cdk = { path = "../cdk", features = ["mint", "wallet"] }
|
||||
cdk-axum = { path = "../cdk-axum" }
|
||||
cdk-fake-wallet = { path = "../cdk-fake-wallet" }
|
||||
tower-http = { version = "0.4.4", features = ["cors"] }
|
||||
|
||||
@@ -115,11 +115,14 @@ pub async fn start_mint(
|
||||
}
|
||||
});
|
||||
}
|
||||
let listener =
|
||||
tokio::net::TcpListener::bind(format!("{}:{}", LISTEN_ADDR, LISTEN_PORT)).await?;
|
||||
|
||||
println!("Starting mint");
|
||||
axum::serve(listener, mint_service).await?;
|
||||
axum::Server::bind(
|
||||
&format!("{}:{}", LISTEN_ADDR, LISTEN_PORT)
|
||||
.as_str()
|
||||
.parse()?,
|
||||
)
|
||||
.serve(mint_service.into_make_service())
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
[package]
|
||||
name = "cdk-lnbits"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
description = "CDK ln backend for lnbits"
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
anyhow.workspace = true
|
||||
axum.workspace = true
|
||||
bitcoin.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["mint"] }
|
||||
futures.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
thiserror.workspace = true
|
||||
lnbits-rs = "0.1.0"
|
||||
async-trait = "0.1"
|
||||
anyhow = "1"
|
||||
axum = "0.6.20"
|
||||
bitcoin = { version = "0.30", default-features = false } # lightning-invoice uses v0.30
|
||||
cdk = { path = "../cdk", default-features = false, features = ["mint"] }
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
tokio = { version = "1", default-features = false }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
thiserror = "1"
|
||||
lnbits-rs = "0.2.0"
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
[package]
|
||||
name = "cdk-lnd"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
description = "CDK ln backend for lnd"
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
anyhow.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["mint"] }
|
||||
async-trait = "0.1"
|
||||
anyhow = "1"
|
||||
cdk = { path = "../cdk", default-features = false, features = ["mint"] }
|
||||
fedimint-tonic-lnd = "0.2.0"
|
||||
futures.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
thiserror.workspace = true
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
tokio = { version = "1", default-features = false }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
thiserror = "1"
|
||||
|
||||
14
crates/cdk-lnd/README.md
Normal file
14
crates/cdk-lnd/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
## Minimum Supported Rust Version (MSRV)
|
||||
|
||||
The `cdk` library should always compile with any combination of features on Rust **1.66.0**.
|
||||
|
||||
To build and test with the MSRV you will need to pin the below dependency versions:
|
||||
|
||||
```shell
|
||||
cargo update -p home --precise 0.5.5
|
||||
cargo update -p prost --precise 0.12.3
|
||||
cargo update -p prost-types --precise 0.12.3
|
||||
cargo update -p prost-build --precise 0.12.3
|
||||
cargo update -p prost-derive --precise 0.12.3
|
||||
```
|
||||
@@ -1,36 +1,36 @@
|
||||
[package]
|
||||
name = "cdk-mintd"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
description = "CDK mint binary"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
axum.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["mint"] }
|
||||
cdk-redb = { workspace = true, default-features = false, features = ["mint"] }
|
||||
cdk-sqlite = { workspace = true, default-features = false, features = ["mint"] }
|
||||
cdk-cln = { workspace = true, default-features = false }
|
||||
cdk-lnbits = { workspace = true, default-features = false }
|
||||
cdk-phoenixd = { workspace = true, default-features = false }
|
||||
cdk-lnd = { workspace = true, default-features = false }
|
||||
cdk-fake-wallet = { workspace = true, default-features = false }
|
||||
cdk-strike.workspace = true
|
||||
cdk-axum = { workspace = true, default-features = false }
|
||||
anyhow = "1"
|
||||
axum = "0.6.20"
|
||||
cdk = { path = "../cdk", default-features = false, features = ["mint"] }
|
||||
cdk-redb = { path = "../cdk-redb", default-features = false, features = ["mint"] }
|
||||
cdk-sqlite = { path = "../cdk-sqlite", default-features = false, features = ["mint"] }
|
||||
cdk-cln = { path = "../cdk-cln", default-features = false }
|
||||
cdk-lnbits = { path = "../cdk-lnbits", default-features = false }
|
||||
cdk-phoenixd = { path = "../cdk-phoenixd", default-features = false }
|
||||
cdk-lnd = { path = "../cdk-lnd", default-features = false }
|
||||
cdk-fake-wallet = { path = "../cdk-fake-wallet", default-features = false }
|
||||
cdk-strike = { path = "../cdk-strike" }
|
||||
cdk-axum = { path = "../cdk-axum", default-features = false }
|
||||
config = { version = "0.13.3", features = ["toml"] }
|
||||
clap.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
futures.workspace = true
|
||||
serde.workspace = true
|
||||
bip39.workspace = true
|
||||
tower-http = { version = "0.5.2", features = ["cors"] }
|
||||
lightning-invoice.workspace = true
|
||||
home.workspace = true
|
||||
url.workspace = true
|
||||
clap = { version = "4.4.8", features = ["derive", "env", "default"] }
|
||||
tokio = { version = "1", default-features = false }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
serde = { version = "1", default-features = false, features = ["derive"] }
|
||||
bip39 = "2.0"
|
||||
tower-http = { version = "0.4.4", features = ["cors"] }
|
||||
lightning-invoice = { version = "0.31", features = ["serde"] }
|
||||
home = "0.5.5"
|
||||
url = "2.3"
|
||||
|
||||
@@ -480,10 +480,13 @@ async fn main() -> anyhow::Result<()> {
|
||||
});
|
||||
}
|
||||
|
||||
let listener =
|
||||
tokio::net::TcpListener::bind(format!("{}:{}", listen_addr, listen_port)).await?;
|
||||
|
||||
axum::serve(listener, mint_service).await?;
|
||||
axum::Server::bind(
|
||||
&format!("{}:{}", listen_addr, listen_port)
|
||||
.as_str()
|
||||
.parse()?,
|
||||
)
|
||||
.serve(mint_service.into_make_service())
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
[package]
|
||||
name = "cdk-phoenixd"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
description = "CDK ln backend for phoenixd"
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
anyhow.workspace = true
|
||||
axum.workspace = true
|
||||
bitcoin.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["mint"] }
|
||||
futures.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
thiserror.workspace = true
|
||||
phoenixd-rs = "0.2.0"
|
||||
# phoenixd-rs = { path = "../../../../phoenixd-rs" }
|
||||
uuid.workspace = true
|
||||
async-trait = "0.1"
|
||||
anyhow = "1"
|
||||
axum = "0.6.20"
|
||||
bitcoin = { version = "0.30", default-features = false } # lightning-invoice uses v0.30
|
||||
cdk = { path = "../cdk", default-features = false, features = ["mint"] }
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
tokio = { version = "1", default-features = false }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
thiserror = "1"
|
||||
phoenixd-rs = "0.3.0"
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
[package]
|
||||
name = "cdk-redb"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
description = "Redb storage backend for CDK"
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.66.0" # MSRV
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[features]
|
||||
@@ -16,12 +16,12 @@ mint = ["cdk/mint"]
|
||||
wallet = ["cdk/wallet"]
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
cdk = { workspace = true, default-features = false }
|
||||
async-trait = "0.1"
|
||||
cdk = { path = "../cdk", default-features = false }
|
||||
redb = "2.1.0"
|
||||
tokio.workspace = true
|
||||
thiserror.workspace = true
|
||||
tracing.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
lightning-invoice.workspace = true
|
||||
tokio = { version = "1", default-features = false }
|
||||
thiserror = "1"
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
serde = { version = "1", default-features = false, features = ["derive"] }
|
||||
serde_json = "1"
|
||||
lightning-invoice = { version = "0.31", features = ["serde"] }
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
[package]
|
||||
name = "cdk-rexie"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
description = "Indexdb storage backend for CDK in the browser"
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[features]
|
||||
@@ -16,11 +16,11 @@ wallet = ["cdk/wallet"]
|
||||
|
||||
[dependencies]
|
||||
rexie = "0.6.0"
|
||||
cdk = { workspace = true, default-features = false }
|
||||
async-trait.workspace = true
|
||||
tokio.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
thiserror.workspace = true
|
||||
serde-wasm-bindgen.workspace = true
|
||||
web-sys.workspace = true
|
||||
cdk = { path = "../cdk", default-features = false }
|
||||
async-trait = "0.1.74"
|
||||
tokio = { version = "1", default-features = false }
|
||||
serde = { version = "1", default-features = false, features = ["derive"] }
|
||||
serde_json = "1"
|
||||
thiserror = "1"
|
||||
serde-wasm-bindgen = "0.6.5"
|
||||
web-sys = { version = "0.3.69", default-features = false, features = ["console"] }
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
[package]
|
||||
name = "cdk-sqlite"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
description = "SQLite storage backend for CDK"
|
||||
license.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.66.0" # MSRV
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[features]
|
||||
@@ -16,16 +16,16 @@ mint = ["cdk/mint"]
|
||||
wallet = ["cdk/wallet"]
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
cdk = { workspace = true, default-features = false }
|
||||
bitcoin.workspace = true
|
||||
async-trait = "0.1"
|
||||
cdk = { path = "../cdk", default-features = false }
|
||||
bitcoin = { version = "0.30", default-features = false } # lightning-invoice uses v0.30
|
||||
sqlx = { version = "0.6.3", default-features = false, features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
|
||||
thiserror.workspace = true
|
||||
tokio = { workspace = true, features = [
|
||||
thiserror = "1"
|
||||
tokio = { version = "1", features = [
|
||||
"time",
|
||||
"macros",
|
||||
"sync",
|
||||
] }
|
||||
tracing.workspace = true
|
||||
serde_json.workspace = true
|
||||
lightning-invoice.workspace = true
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
serde_json = "1"
|
||||
lightning-invoice = { version = "0.31", features = ["serde"] }
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
[package]
|
||||
name = "cdk-strike"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
description = "CDK ln backend for Strike api"
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
anyhow.workspace = true
|
||||
axum.workspace = true
|
||||
bitcoin.workspace = true
|
||||
cdk = { workspace = true, default-features = false, features = ["mint"] }
|
||||
futures.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
thiserror.workspace = true
|
||||
uuid.workspace = true
|
||||
strike-rs = "0.2.3"
|
||||
async-trait = "0.1"
|
||||
anyhow = "1"
|
||||
axum = "0.6.20"
|
||||
bitcoin = { version = "0.30", default-features = false } # lightning-invoice uses v0.30
|
||||
cdk = { path = "../cdk", default-features = false, features = ["mint"] }
|
||||
futures = { version = "0.3.28", default-features = false }
|
||||
tokio = { version = "1", default-features = false }
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
thiserror = "1"
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
strike-rs = "0.3.0"
|
||||
|
||||
@@ -1,32 +1,33 @@
|
||||
[package]
|
||||
name = "cdk"
|
||||
version = { workspace = true }
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
authors = ["CDK Developers"]
|
||||
description = "Core Cashu Development Kit library implementing the Cashu protocol"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
rust-version.workspace = true # MSRV
|
||||
license.workspace = true
|
||||
homepage = "https://github.com/cashubtc/cdk"
|
||||
repository = "https://github.com/cashubtc/cdk.git"
|
||||
rust-version = "1.63.0" # MSRV
|
||||
license = "MIT"
|
||||
|
||||
|
||||
[features]
|
||||
default = ["mint", "wallet"]
|
||||
mint = ["dep:futures"]
|
||||
wallet = ["dep:reqwest"]
|
||||
bench = []
|
||||
|
||||
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
anyhow.workspace = true
|
||||
async-trait = "0.1"
|
||||
anyhow = { version = "1.0.43", features = ["backtrace"] }
|
||||
base64 = "0.22" # bitcoin uses v0.13 (optional dep)
|
||||
bitcoin = { workspace = true, features = [
|
||||
bitcoin = { version= "0.30", features = [
|
||||
"serde",
|
||||
"rand",
|
||||
"rand-std",
|
||||
] } # lightning-invoice uses v0.30
|
||||
ciborium = { version = "0.2.2", default-features = false, features = ["std"] }
|
||||
lightning-invoice.workspace = true
|
||||
lightning-invoice = { version = "0.31", features = ["serde"] }
|
||||
once_cell = "1.19"
|
||||
regex = "1"
|
||||
reqwest = { version = "0.12", default-features = false, features = [
|
||||
@@ -35,17 +36,21 @@ reqwest = { version = "0.12", default-features = false, features = [
|
||||
"rustls-tls-native-roots",
|
||||
"socks",
|
||||
], optional = true }
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
serde_with = "3.4"
|
||||
tracing.workspace = true
|
||||
thiserror.workspace = true
|
||||
futures = { workspace = true, optional = true }
|
||||
url.workspace = true
|
||||
uuid.workspace = true
|
||||
serde = { version = "1", default-features = false, features = ["derive"] }
|
||||
serde_json = "1"
|
||||
serde_with = "3.1"
|
||||
tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
|
||||
thiserror = "1"
|
||||
futures = { version = "0.3.28", default-features = false, optional = true }
|
||||
url = "2.3"
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
|
||||
# -Z minimal-versions
|
||||
sync_wrapper = "0.1.2"
|
||||
bech32 = "0.9.1"
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
tokio = { workspace = true, features = [
|
||||
tokio = { version = "1", features = [
|
||||
"rt-multi-thread",
|
||||
"time",
|
||||
"macros",
|
||||
@@ -53,7 +58,7 @@ tokio = { workspace = true, features = [
|
||||
] }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
tokio = { workspace = true, features = ["rt", "macros", "sync", "time"] }
|
||||
tokio = { version = "1", features = ["rt", "macros", "sync", "time"] }
|
||||
getrandom = { version = "0.2", features = ["js"] }
|
||||
instant = { version = "0.1", features = ["wasm-bindgen", "inaccurate"] }
|
||||
|
||||
@@ -74,14 +79,10 @@ name = "proof-selection"
|
||||
required-features = ["wallet"]
|
||||
|
||||
[dev-dependencies]
|
||||
rand.workspace = true
|
||||
bip39.workspace = true
|
||||
anyhow.workspace = true
|
||||
rand = "0.8.5"
|
||||
bip39 = "2.0"
|
||||
criterion = "0.5.1"
|
||||
|
||||
[[bench]]
|
||||
name = "dhke_benchmarks"
|
||||
harness = false
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bench)'] }
|
||||
|
||||
@@ -81,6 +81,23 @@ async fn main() {
|
||||
|
||||
See more examples in the [examples](./examples) folder.
|
||||
|
||||
## Minimum Supported Rust Version (MSRV)
|
||||
|
||||
The `cdk` library should always compile with any combination of features on Rust **1.63.0**.
|
||||
|
||||
To build and test with the MSRV you will need to pin the below dependency versions:
|
||||
|
||||
```shell
|
||||
cargo update -p half --precise 2.2.1
|
||||
cargo update -p tokio --precise 1.38.1
|
||||
cargo update -p reqwest --precise 0.12.4
|
||||
cargo update -p serde_with --precise 3.1.0
|
||||
cargo update -p regex --precise 1.9.6
|
||||
cargo update -p backtrace --precise 0.3.58
|
||||
# For wasm32-unknown-unknown target
|
||||
cargo update -p bumpalo --precise 3.12.0
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -660,9 +660,10 @@ impl Mint {
|
||||
|
||||
let keysets = self.keysets.read().await;
|
||||
let keyset = keysets.get(keyset_id).ok_or(Error::UnknownKeySet)?;
|
||||
let Some(key_pair) = keyset.keys.get(amount) else {
|
||||
// No key for amount
|
||||
return Err(Error::AmountKey);
|
||||
|
||||
let key_pair = match keyset.keys.get(amount) {
|
||||
Some(key_pair) => key_pair,
|
||||
None => return Err(Error::AmountKey),
|
||||
};
|
||||
|
||||
let c = sign_message(&key_pair.secret_key, blinded_secret)?;
|
||||
@@ -877,8 +878,10 @@ impl Mint {
|
||||
self.ensure_keyset_loaded(&proof.keyset_id).await?;
|
||||
let keysets = self.keysets.read().await;
|
||||
let keyset = keysets.get(&proof.keyset_id).ok_or(Error::UnknownKeySet)?;
|
||||
let Some(keypair) = keyset.keys.get(&proof.amount) else {
|
||||
return Err(Error::AmountKey);
|
||||
|
||||
let keypair = match keyset.keys.get(&proof.amount) {
|
||||
Some(key_pair) => key_pair,
|
||||
None => return Err(Error::AmountKey),
|
||||
};
|
||||
|
||||
verify_message(&keypair.secret_key, proof.c, proof.secret.as_bytes())?;
|
||||
|
||||
@@ -150,7 +150,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(bench)]
|
||||
#[cfg(feature = "bench")]
|
||||
mod benches {
|
||||
use test::{black_box, Bencher};
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(bench)]
|
||||
#[cfg(feature = "bench")]
|
||||
mod benches {
|
||||
use super::*;
|
||||
use crate::test::{black_box, Bencher};
|
||||
|
||||
Reference in New Issue
Block a user