[package]
name = "titan-rust-client"
version = "0.1.9"
edition = "2021"
description = "Rust client for Titan Exchange WebSocket API"
license = "MIT"
authors = ["ohaddahan@gmail.com"]
repository = "https://github.com/ohaddahan/titan-rust-client.git"
homepage = "https://github.com/ohaddahan/titan-rust-client"
documentation = "https://docs.rs/titan-rust-client"
exclude = [
  ".github/*",
  ".env*",
  "examples/*.sh",
]

[lib]
name = "titan_rust_client"
path = "src/lib.rs"

[[bin]]
name = "titan-cli"
path = "src/bin/titan_cli.rs"

[dependencies]
# Titan API
titan-api-codec = { version = "1.2.1", features = ["messagepack", "zstd", "brotli", "gzip"] }
titan-api-types = { version = "2.0.0", features = [
  "serde",
  "pubkey-str",
  "solana-instruction-convert-v2",
  "solana-pubkey-convert-v2",
  "solana-alt-account-convert-v2",
] }

# Async runtime
tokio = { version = "1", features = ["full"] }
tokio-tungstenite = { version = "0.26", features = ["rustls-tls-native-roots"] }
tokio-rustls = "0.26"
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
rustls-native-certs = "0.8"
futures-util = { version = "0.3" }

# Serialization
rmp-serde = { version = "1.3" }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1" }
bytes = { version = "1" }
# Error handling
thiserror = { version = "2" }
anyhow = { version = "1" }
# Observability
tracing = { version = "0.1" }

# Solana (optional - excluded from docs.rs to avoid timeout)
solana-sdk = { version = "2.3", optional = true }
solana-client = { version = "2.3", optional = true }
solana-address-lookup-table-interface = { version = "2.2.2", optional = true }

# CLI dependencies
clap = { version = "4", features = ["derive", "env"], optional = true }
dotenvy = { version = "0.15", optional = true }
tokio-stream = { version = "0.1", optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
bs58 = { version = "0.5", optional = true }

[features]
default = ["solana"]
solana = ["solana-sdk", "solana-client", "solana-address-lookup-table-interface"]
cli = ["clap", "dotenvy", "tokio-stream", "tracing-subscriber", "bs58", "solana"]

[package.metadata.docs.rs]
# Skip solana deps to avoid docs.rs build timeout
default-features = false
rustdoc-args = ["--cfg", "docsrs"]

[dev-dependencies]
cargo-husky = { version = "1", default-features = false, features = [
  "precommit-hook",
  "run-cargo-test",
  "run-cargo-clippy",
  "run-cargo-fmt",
  "run-for-all",
] }
dotenvy = "0.15"
tokio-test = { version = "0.4" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
