[package]
name = "cdk-ffi"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "FFI bindings for cdk wallet"
homepage = "https://github.com/cashubtc/cdk"

[lib]
crate-type = ["cdylib", "staticlib", "rlib"]
name = "cdk_ffi"

[dependencies]
async-trait = { workspace = true }
bip39 = { workspace = true }
cdk = { workspace = true, default-features = false, features = ["wallet", "auth", "bip353", "nostr"] }
cdk-sqlite = { workspace = true }
cdk-postgres = { workspace = true, optional = true }
cdk-npubcash = { workspace = true, optional = true }
nostr-sdk = { workspace = true, optional = true }
futures = { workspace = true }
once_cell = { workspace = true }
rand = { workspace = true }
cdk-sql-common = { workspace = true }
serde = { workspace = true, features = ["derive", "rc"] }
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["sync", "rt", "rt-multi-thread"] }
uniffi = { version = "0.29", features = ["cli", "tokio"] }
url = { workspace = true }
uuid = { workspace = true, features = ["v4"] }
cdk-common.workspace = true
tracing.workspace = true
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] }

[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.15"
log = "0.4"


[features]
default = ["postgres", "npubcash"]
# Enable Postgres-backed wallet database support in FFI
postgres = ["cdk-postgres"]
# Enable NpubCash client bindings
npubcash = ["cdk-npubcash", "nostr-sdk"]

[dev-dependencies]

[[bin]]
name = "uniffi-bindgen"
path = "src/bin/uniffi-bindgen.rs"

[lints]
workspace = true
