[package]
name = "deribit-websocket"
version = "0.3.1"
edition = "2024"
authors = ["Joaquin Bejar <jb@taunais.com>"]
description = "WebSocket client for Deribit trading platform real-time data"
license = "MIT"
readme = "README.md"
repository = "https://github.com/joaquinbejar/deribit-websocket"
homepage = "https://github.com/joaquinbejar/deribit-websocket"
keywords = ["finance", "deribit", "trading", "websocket", "realtime"]
categories = ["finance", "api-bindings", "web-programming::websocket"]

[features]
default = ["rustls-aws-lc"]

# Exactly one of the three TLS backends below must be active. The
# `compile_error!` mutex in `src/tls.rs` rejects any other combination
# (zero or multiple) at compile time.
#
# - `rustls-aws-lc` (default) pulls rustls with the `aws-lc-rs` crypto
#   provider and tokio-tungstenite wired to the native root store.
# - `rustls-ring` is the same but with the `ring` crypto provider,
#   useful on targets without aws-lc prebuilts (for example some musl
#   or BSD setups) or where avoiding aws-lc C/ASM dependencies is
#   required.
# - `native-tls` routes through the OS TLS stack (SChannel /
#   SecureTransport / OpenSSL) and drops the rustls dependency
#   entirely.
rustls-aws-lc = [
    "dep:rustls",
    "rustls/std",
    "rustls/tls12",
    "rustls/logging",
    "rustls/prefer-post-quantum",
    "rustls/aws-lc-rs",
    "tokio-tungstenite/rustls-tls-native-roots",
]
rustls-ring = [
    "dep:rustls",
    "rustls/std",
    "rustls/tls12",
    "rustls/logging",
    "rustls/ring",
    "tokio-tungstenite/rustls-tls-native-roots",
]
native-tls = [
    "tokio-tungstenite/native-tls",
]

# Opt-in: pulls in live Deribit-reachable integration tests that
# require real credentials.
integration-tests = []


[dependencies]
pretty-simple-display = { workspace = true }
tracing-subscriber = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tracing = { workspace = true }
tokio-tungstenite = { workspace = true }
tokio = { workspace = true }
rustls = { workspace = true, optional = true }
thiserror = { workspace = true }
url = { workspace = true }
futures-util = { workspace = true }
dotenv = { workspace = true }


[dev-dependencies]
serial_test = "3.4"
dotenv = "0.15"

# Examples are intentionally *not* gated via `required-features`:
# `install_default_crypto_provider()` is available under every TLS
# backend (no-op under `native-tls`), so `cargo build --examples` works
# with any single TLS feature active. The crate-level `compile_error!`
# mutex in `src/tls.rs` still rejects zero- or multi-backend builds, so
# the example set can never be compiled against a misconfigured crate.

[workspace.dependencies]
pretty-simple-display = "0.1"
tracing-subscriber = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tracing = "0.1"
tokio-tungstenite = { version = "0.29" }
tokio = { version = "1.50", features = ["full"] }
thiserror = "2.0"
url = "2.5"
futures-util = "0.3"
rustls = { version = "0.23", default-features = false }
dotenv = "0.15" 