[package]
name = "hopr-api"
version = "1.10.0"
description = "Common high-level external and internal API traits used by hopr-lib to implement the HOPR protocol"
authors = ["HOPR Association <tech@hoprnet.org>"]
homepage = "https://hoprnet.org/"
repository = "https://github.com/hoprnet/hopr-api"
license = "GPL-3.0-only"
edition = "2024"
rust-version = "1.94"

[lib]
crate-type = ["rlib"]

[features]
default = []
full = [
  "chain",
  "ct",
  "network",
  "graph",
  "node",
  "node-session-client",
  "node-session-server",
  "serde",
  "tickets",
  "types-chain",
  "types-random",
  "types-fixed-rng",
  "types-telemetry",
]
chain = ["dep:auto_impl", "types-chain", "dep:auto_impl"]
ct = []
network = ["dep:auto_impl"]
graph = ["dep:auto_impl"]
node = [
  "chain",
  "graph",
  "network",
  "tickets",
  "dep:atomic_enum",
  "dep:auto_impl",
]
node-session-client = ["node"]
node-session-server = ["node"]
serde = ["hopr-types/serde", "dep:serde"]
tickets = ["chain", "dep:auto_impl"]
types-random = ["hopr-types/random"]
types-fixed-rng = ["hopr-types/fixed-rng"]
types-chain = ["hopr-types/chain"]
types-internal = ["hopr-types/internal"]
types-telemetry = ["hopr-types/telemetry"]
types-keypair = ["hopr-types/keypair"]
types-with-bindings = ["types-chain", "hopr-types/use-bindings"]

[dependencies]
async-trait = "0.1.89"
auto_impl = { version = "1.3.0", optional = true }
atomic_enum = { version = "0.3.0", optional = true }
chrono = { version = "0.4.44", default-features = false, features = [
  "std",
  "clock",
] }
futures = { version = "0.3.32", default-features = false, features = [
  "std",
  "async-await",
] }
futures-concurrency = "7.7.1"
libp2p-identity = { version = "0.2.13", features = [
  "peerid",
  "ed25519",
  "rand",
] }
multiaddr = "0.18.2"
serde = { version = "1.0.228", features = ["derive"], optional = true }
strum = { version = "0.28.0", features = ["derive"] }
thiserror = "2.0.18"
tracing = { version = "0.1.44", default-features = false, features = [
  "std",
  "release_max_level_debug",
] }

hopr-types = { version = "1.8.2", features = [
  "crypto",
  "internal",
  "primitive",
  "rayon",
] }

[dev-dependencies]
anyhow = "1.0.102"
insta = { version = "1.47.2", features = ["json", "yaml", "redactions"] }
mockall = "0.14.0"
serde = { version = "1.0.228", features = ["derive"] }
tokio = { version = "1.52.1", features = ["macros", "rt-multi-thread"] }

[workspace]

[profile.dev]
opt-level = 0
debug = true

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1

# make insta snapshots faster
[profile.dev.package]
insta.opt-level = 3
