[package]
name = "smoldot-light"
version = "0.12.0"
description = "Browser bindings to a light client for Substrate-based blockchains"
authors.workspace = true
license.workspace = true
edition.workspace = true
repository.workspace = true
include.workspace = true

[[example]]
name = "basic"
required-features = ["std"]

[dependencies]
async-channel = { version = "2.0.0", default-features = false }
async-lock = { version = "3.0.0", default-features = false }
base64 = { version = "0.21.2", default-features = false, features = ["alloc"] }
blake2-rfc = { version = "0.2.18", default-features = false }
derive_more = "0.99.17"
either = { version = "1.9.0", default-features = false }
event-listener = { version = "3.0.0", default-features = false }
fnv = { version = "1.0.7", default-features = false }
futures-channel = { version = "0.3.27", default-features = false, features = ["alloc"] }
futures-lite = { version = "2.0.0", default-features = false, features = ["alloc"] }
futures-util = { version = "0.3.27", default-features = false, features = ["alloc", "sink"] }  # TODO: slim down these features and consider removing this dependency altogether
hashbrown = { version = "0.14.0", default-features = false }
hex = { version = "0.4.3", default-features = false }
itertools = { version = "0.11.0", default-features = false, features = ["use_alloc"] }
log = { version = "0.4.18", default-features = false }
lru = { version = "0.12.0", default-features = false, features = ["hashbrown"] } # The `hashbrown` feature brings no-std compatibility.
no-std-net = { version = "0.6.0", default-features = false }
pin-project = "1.1.3"
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
rand_chacha = { version = "0.3.1", default-features = false }
serde = { version = "1.0.183", default-features = false, features = ["alloc", "derive"] }
serde_json = { version = "1.0.104", default-features = false, features = ["alloc"] }
siphasher = { version = "1.0.0", default-features = false }
slab = { version = "0.4.8", default-features = false }
smoldot = { version = "0.14.0", path = "../lib", default-features = false }
zeroize = { version = "1.6.0", default-features = false, features = ["alloc"] }

# `std` feature
# Add here the crates that cannot function without the help of the operating system or environment.
parking_lot = { version = "0.12.1", optional = true }
smol = { version = "1.3.0", optional = true }

[features]
default = ["std", "wasmtime"]
std = ["dep:parking_lot", "dep:smol", "rand/std", "rand/std_rng", "smoldot/std"]
wasmtime = ["smoldot/wasmtime"]

[dev-dependencies]
env_logger = "0.10.0"
