[package]
name = "iroh-base"
version = "1.0.1"
edition = "2024"
readme = "README.md"
description = "base type and utilities for Iroh"
license = "MIT OR Apache-2.0"
authors = ["n0 team"]
repository = "https://github.com/n0-computer/iroh"

# Sadly this also needs to be updated in .github/workflows/ci.yml
rust-version = "1.91"

[lints]
workspace = true

[dependencies]
curve25519-dalek = { version = "=5.0.0-rc.0", features = ["serde", "rand_core", "zeroize"], optional = true }
data-encoding = { version = "2.6.0", optional = true }
data-encoding-macro = { version = "0.1.19", optional = true }
ed25519-dalek = { version = "=3.0.0-rc.0", features = ["serde", "rand_core", "zeroize"], optional = true }
derive_more = { version = "2.0.1", features = ["debug", "display"], optional = true }
url = { version = "2.5.3", features = ["serde"], optional = true }
rand = { version = "0.10", optional = true }
serde = { version = "1", features = ["derive", "rc"] }
n0-error = "1.0.0"
zeroize = { version = "1.9", optional = true, features = ["derive"] }

# wasm-in-browser dependencies
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]
getrandom = { version = "0.4", features = ["wasm_js"], optional = true }

[dev-dependencies]
postcard = { version = "1", features = ["use-std"] }
proptest = "1.11.0"
rand_chacha = "0.10"
serde_json = "1"
serde_test = "1"


[features]
default = ["relay"]
key = [
  "dep:curve25519-dalek",
  "dep:ed25519-dalek",
  "dep:url",
  "dep:derive_more",
  "dep:data-encoding",
  "dep:data-encoding-macro",
  "dep:rand",
  "dep:getrandom",
  "dep:zeroize",
  "relay",
]
relay = [
  "dep:url",
  "dep:derive_more",
]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "iroh_docsrs"]

[package.metadata.cargo_check_external_types]
allowed_external_types = [
    "n0_error::*",
    "serde_core::*",
    "url::*",
]
