[package]
name = "ethers-providers"
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
readme = "README.md"
description = "Clients for interacting with Ethereum nodes"

version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
documentation.workspace = true
repository.workspace = true
homepage.workspace = true
categories.workspace = true
keywords.workspace = true
exclude.workspace = true

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

[package.metadata.playground]
all-features = true

[dependencies]
ethers-core.workspace = true

serde.workspace = true
serde_json = { workspace = true, features = ["raw_value"] }

http = "0.2"
reqwest = { workspace = true, features = ["json"] }
url.workspace = true
base64 = "0.21"

async-trait.workspace = true
hex.workspace = true
thiserror.workspace = true
auto_impl.workspace = true
once_cell.workspace = true
bytes.workspace = true
instant.workspace = true
hashers = "1.0"

# required for implementing stream on the filters
futures-core.workspace = true
futures-util.workspace = true
futures-timer.workspace = true
futures-channel = { workspace = true, optional = true }
pin-project.workspace = true

# peer-related admin namespace
enr = { version = "0.8.0", default-features = false, features = ["k256", "serde"] }

# tracing
tracing = { workspace = true, features = ["attributes"] }
tracing-futures = { workspace = true, features = ["std-future"] }

[target.'cfg(target_family = "windows")'.dependencies]
winapi = { version = "0.3", optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# tokio
tokio = { workspace = true, features = ["time"] }
tokio-tungstenite = { workspace = true, features = ["connect"], optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
ws_stream_wasm = "0.7"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = ["console"] }
# NOTE: this enables wasm compatibility for getrandom indirectly
getrandom.workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
tokio = { workspace = true, features = ["rt", "macros", "time"] }
tempfile = "3.4.0"

[features]
default = ["ws", "rustls"]
celo = ["ethers-core/celo"]

ws = ["tokio-tungstenite", "futures-channel"]
legacy-ws = ["ws"]
ipc = ["tokio/io-util", "futures-channel", "winapi"]

openssl = ["tokio-tungstenite/native-tls", "reqwest/native-tls"]
# we use the webpki roots so we can build static binaries w/o any root cert dependencies
# on the host
rustls = ["tokio-tungstenite/rustls-tls-webpki-roots", "reqwest/rustls-tls"]
dev-rpc = []

[dev-dependencies]
tracing-test = { version = "0.2.4", features = ["no-env-filter"] }
