[package]
name = "freenet-stdlib"
version = "0.8.1"
edition = "2021"
rust-version = "1.80"
publish = true
description = "Freeenet standard library"
license = "LGPL-3.0-only"
repository = "https://github.com/freenet/freenet-stdlib"

[dependencies]
arbitrary = { version = "1", optional = true, features = ["derive"] }
bincode = "1"
bytes = { version = "1", features = ["serde"] }
byteorder = "1"
blake3 = { version = "1", features = ["std", "traits-preview"] }
bs58 = "0.5"
chrono = { version = "0.4", default-features = false, features = ["serde"] }
flatbuffers = "24.3"
futures = { version = "0.3", default-features = false }
semver = { version = "1", default-features = false }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_with = { version = "3", default-features = false, features = ["macros", "alloc"] }
thiserror = "2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["default", "env-filter"] }

# internal
freenet-macros = { path = "../rust-macros", version = "0.2.0" }

[target.'cfg(any(unix, windows))'.dependencies]
tokio = { version = "1", optional = true, features = ["macros", "parking_lot", "rt-multi-thread", "sync", "time"] }
tokio-tungstenite = { version = "0.27.0", optional = true }
serde_with = { version = "3" }

[target.'cfg(target_family = "wasm")'.dependencies]
serde-wasm-bindgen = { version = "0.6", optional = true }
wasm-bindgen = { version = "0.2", features = ["serde-serialize"], optional = true }

[target.'cfg(target_family = "wasm")'.dependencies.web-sys]
version = "0.3"
features = [
  "BinaryType",
  "Blob",
  "CloseEvent",
  "ErrorEvent",
  "FileReader",
  "MessageEvent",
  "ProgressEvent",
  "WebSocket",
]
optional = true

[target.'cfg(all(target_family = "wasm"))'.dependencies.js-sys]
version = "0.3"
optional = true

[target.'cfg(any(unix, windows))'.dev-dependencies]
bincode = "1"
wasmer = { version = "5.0.4", features = [ "sys-default"] }
rand = { version = "0.9", features = ["small_rng"] }
arbitrary = { version = "1", features = ["derive"] }

[features]
default = []
contract = []
unstable = []
freenet-main-contract = []
net = ["dep:tokio", "dep:tokio-tungstenite", "dep:wasm-bindgen", "dep:web-sys", "dep:js-sys", "dep:serde-wasm-bindgen"]
testing = ["dep:arbitrary"]
trace = []
wasmer-tests = []
