[package]
name = "host-wallet"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Multi-chain wallet: sr25519/secp256k1 key management, per-app derivation, platform keychain"

[dependencies]
schnorrkel = "0.11"
bip39 = { version = "2", features = ["rand", "zeroize"] }
blake2 = "0.10"
zeroize = { version = "1", features = ["derive"] }
rand_core = { version = "0.6", features = ["getrandom"] }
bs58 = "0.5"
anyhow = { workspace = true }
thiserror = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
serde_json = "1"

# Ed25519 signing (Substrate hard-derived path)
ed25519-dalek = { version = "2", default-features = false, features = ["alloc", "zeroize"] }

# secp256k1 / BIP-44 (ETH + BTC key derivation)
k256 = { version = "0.13", features = ["ecdsa"] }
bip32 = { version = "0.5", default-features = false, features = ["secp256k1", "alloc"] }
sha2 = "0.10"
sha3 = "0.10"
ripemd = "0.1"
bech32 = "0.11"
base64 = "0.22"

# Polkadot App pairing protocol (P-256/AES-128-GCM/SCALE)
p256 = { version = "0.13", features = ["ecdh"] }
aes-gcm = "0.10"
hkdf = "0.12"
hmac = "0.12"
pbkdf2 = { version = "0.12", default-features = false }
scrypt = { version = "0.11", default-features = false }
xsalsa20poly1305 = "0.9"
hex = "0.4"

[target.'cfg(all(not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android"), not(target_arch = "wasm32")))'.dependencies]
keyring = "3"

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
web-time = "1"

[dev-dependencies]
wasm-bindgen-test = "0.3"
tracing = { workspace = true }
tracing-subscriber = { workspace = true }

# Apple platforms (macOS + iOS): Keychain + biometric authentication
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
security-framework = { version = "3", features = ["OSX_10_15"] }
security-framework-sys = "2"
core-foundation = "0.10"

# macOS-only: NSWorkspace observer for sleep/screen-lock auto-lock
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6"
