webylib 0.3.20

Webcash HD wallet library — bearer e-cash with BIP32-style key derivation, SQLite storage, AES-256-GCM encryption, and full C FFI for cross-platform SDKs
Documentation
[workspace]
resolver = "2"
members = [
    # Root published crate
    ".",
    # Proc-macro crate (must be a separate crate-type = ["proc-macro"])
    "crates/macros",
    # Non-published workspace members that depend on the root
    "crates/webylib-wasm",
    "crates/webylib-ffi",
    "crates/webylib-cli",
    "crates/conformance",
]

[workspace.package]
version = "0.3.20"
edition = "2021"
rust-version = "1.85"
license = "MIT"
authors = ["Webycash Developers"]
repository = "https://github.com/webycash/webylib"

[workspace.dependencies]
# Proc-macro crate (published separately — proc-macro crates must be standalone)
webylib-macros = { path = "crates/macros", version = "0.3" }
# Root webylib crate (used by non-published workspace members)
webylib = { path = ".", version = "0.3.20", default-features = false }

# Pinned versions for shared deps
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0"
anyhow = "1.0"
async-trait = "0.1"
sha2 = "0.10"
hex = "0.4"
proptest = "1"

[package]
name = "webylib"
version = "0.3.20"
edition = "2021"
rust-version = "1.85"
description = "Webcash HD wallet library — bearer e-cash with BIP32-style key derivation, SQLite storage, AES-256-GCM encryption, and full C FFI for cross-platform SDKs"
license = "MIT"
authors = ["Webycash Developers"]
homepage = "https://weby.cash"
repository = "https://github.com/webycash/webylib"
documentation = "https://docs.rs/webylib"
readme = "README.md"
keywords = ["webcash", "wallet", "payments", "bearer-cash", "hd-wallet"]
categories = ["cryptography", "cryptography::cryptocurrencies", "api-bindings"]
include = [
    "src/**/*.rs",
    "tests/**/*.rs",
    "tests/**/*.txt",
    # Sub-crate source trees included as modules via #[path = "../crates/*/src/..."]
    "crates/**/*.rs",
    "LICENSE",
    "README.md",
    "CHANGELOG.md",
    "docs/**/*.md",
    "include/**/*",
    "cbindgen.toml",
]

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

[[bin]]
name = "webyc"
path = "src/bin/cli.rs"
required-features = ["cli"]

[dependencies]
# ── Always available (WASM-safe) ────────────────────────────────
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0"
anyhow = "1.0"
async-trait = "0.1"
sha2 = "0.10"
hmac = "0.12"
rand = "0.9"
rand_chacha = "0.9"
aes-gcm = "0.10"
argon2 = "0.5"
hkdf = "0.12"
hex = "0.4"
base64 = "0.22"
chrono = { version = "0.4", default-features = false, features = ["serde", "clock"] }
uuid = { version = "1.0", features = ["v4"] }
url = "2.5"
zeroize = { version = "1.5", features = ["derive"] }

# getrandom: native uses default, WASM uses js feature
getrandom = "0.2"
getrandom_0_3 = { package = "getrandom", version = "0.3" }

# ── Native-only (optional) ──────────────────────────────────────
tokio = { version = "1.0", features = ["full"], optional = true }
rusqlite = { version = "0.37.0", features = ["bundled"], optional = true }
reqwest = { version = "0.12", default-features = false, features = ["json"], optional = true }
keyring = { version = "3", features = ["apple-native", "linux-native", "windows-native"], optional = true }

webylib-macros = { workspace = true }

# WASM (optional)
web-sys = { version = "0.3", features = ["DomStringList", "Event", "EventTarget", "IdbDatabase", "IdbFactory", "IdbObjectStore", "IdbOpenDbRequest", "IdbRequest", "IdbTransaction", "IdbTransactionMode", "IdbVersionChangeEvent", "Window"], optional = true }
js-sys = { version = "0.3", optional = true }
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
futures-channel = { version = "0.3", optional = true }

# CLI (optional)
clap = { version = "4.0", features = ["derive"], optional = true }
rpassword = { version = "7.3", optional = true }
dirs-next = { version = "2", optional = true }

[dev-dependencies]
tempfile = "3.0"
mockito = "1.7.0"
ed25519-dalek = "2"
serde_json = "1"

[features]
default = ["native", "cli"]

# Native: SQLite storage, HTTP client with TLS, async runtime, keyring
native = [
    "dep:tokio",
    "dep:rusqlite",
    "dep:reqwest",
    "reqwest?/rustls-tls",
    "dep:keyring",
    "bundled-sqlite",
    "mem",
    "json",
    "sqlite",
]
bundled-sqlite = ["rusqlite?/bundled"]

# WASM: HTTP client via browser fetch, getrandom via JS, IndexedDB persistence
wasm = [
    "dep:reqwest",
    "dep:web-sys",
    "dep:js-sys",
    "dep:wasm-bindgen",
    "dep:wasm-bindgen-futures",
    "dep:futures-channel",
    "getrandom/js",
    "getrandom_0_3/wasm_js",
    "uuid/js",
    "mem",
    "json",
    "indexeddb",
]

ffi = ["native"]
cli = ["native", "dep:clap", "dep:rpassword", "dep:dirs-next"]
passkey = []

# Storage backend features (names match crates/storage/src/lib.rs #[cfg(feature = ...)])
mem = []
json = []
sqlite = ["dep:rusqlite"]
indexeddb = ["dep:web-sys", "dep:js-sys", "dep:wasm-bindgen"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]