[package]
name = "celestia-rpc"
version.workspace = true
edition.workspace = true
license = "Apache-2.0"
description = "A collection of traits for interacting with Celestia data availability nodes RPC"
authors = ["Celestia <contact@celestia.org>"]
homepage = "https://www.celestia.org"
repository = "https://github.com/celestiaorg/lumina"
readme = "README.md"
rust-version = "1.88"
# crates.io is limited to 5 keywords and 5 categories
keywords = ["blockchain", "celestia", "lumina"]
# Must be one of <https://crates.io/category_slugs>
categories = [
  "api-bindings",
  "asynchronous",
  "encoding",
  "cryptography::cryptocurrencies",
]

[dependencies]
celestia-proto.workspace = true
celestia-types.workspace = true

async-stream.workspace = true
base64.workspace = true
futures-util.workspace = true
jsonrpsee = { workspace = true, features = [
  "client-core",
  "macros",
  "server-core",
] }
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
serde_repr.workspace = true
thiserror.workspace = true
tracing.workspace = true
libp2p-identity = { workspace = true, optional = true }
multiaddr = { version = "0.18.1", optional = true }
tendermint-proto.workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
http.workspace = true
jsonrpsee = { workspace = true, features = ["http-client", "ws-client"] }
tokio = { workspace = true, features = ["sync"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
gloo-net = { version = "0.6", default-features = false, features = [
  "http",
  "json",
] }
gloo-timers.workspace = true
getrandom_03.workspace = true
send_wrapper.workspace = true
serde_json.workspace = true
web-sys = { workspace = true, features = [
  "console",
  "AbortController",
  "AbortSignal",
] }

[dev-dependencies]
anyhow.workspace = true
lumina-utils = { workspace = true, features = ["test-utils", "time"] }
nmt-rs.workspace = true
rand.workspace = true
tokio = { workspace = true, features = ["sync"] }
tracing.workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
dotenvy.workspace = true
libp2p = { workspace = true, features = [
  "tokio",
  "macros",
  "tcp",
  "noise",
  "yamux",
] }
tokio = { workspace = true, features = ["rt", "macros"] }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
getrandom_02.workspace = true
getrandom_03.workspace = true
rust-embed = { workspace = true, features = [
  "debug-embed",
  "include-exclude",
  "interpolate-folder-path",
] }
wasm-bindgen-test.workspace = true

[features]
default = ["p2p"]
p2p = ["dep:libp2p-identity", "dep:multiaddr"]
wasm-bindgen = ["celestia-types/wasm-bindgen", "jsonrpsee/wasm-client"]

[package.metadata.docs.rs]
features = ["p2p"]
rustdoc-args = ["--cfg", "docsrs"]
