[package]
name = "ergo-rest"
version = "0.9.0"
license = "CC0-1.0"
authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"]
repository.workspace = true
edition.workspace = true
description = "Ergo node REST API library"
exclude = [
    "proptest-regressions/*"
]

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

[dependencies]
async-trait = "^0.1"
bounded-integer = { workspace = true }
bounded-vec = { workspace = true, features=["serde"] }
sigma-ser = { workspace = true }
sigma-util = { workspace = true }
ergo-chain-types = { workspace = true }
ergo-nipopow = { workspace = true }
ergotree-ir = { workspace =  true, features = ["json"] }
ergo-merkle-tree = { workspace = true }
futures = { workspace = true }
thiserror = { workspace = true }
derive_more = { workspace = true }
proptest-derive = {workspace = true, optional = true }
rand = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true, optional = true }
url = { workspace = true }
proptest = { workspace = true , optional = true }

# Dependencies for `wasm-timer`
parking_lot = "0.12"
pin-utils = "0.1"
# Dependencies for `reqwest`
http = "0.2"
bytes = "1.0"
serde_urlencoded = "0.7.1"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"
# Dependencies for `wasm-timer`
js-sys = "0.3"
wasm-bindgen = "0.2"
# Depdencies for `reqwest`
serde_json = "1.0"
getrandom = { version = "0.2.7", features = ["js"] }

[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
version = "0.3.25"
features = [
    "console",
    "Headers",
    "Request",
    "RequestInit",
    "RequestMode",
    "AbortController",
    "AbortSignal",
    "Response",
    "ReadableStream",
    "Window",
    "FormData",
    "Blob",
    "BlobPropertyBag",
    "ServiceWorkerGlobalScope",
    "RequestCredentials",
    "File",
    "Performance"
]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { workspace = true }
tokio-stream = { workspace = true }
reqwest = { version = "0.11.10", default-features = false, features = ["json"] }

[features]
json = ["serde_json"]
arbitrary = ["proptest", "proptest-derive"]
default = ["json"]

[dev-dependencies]
sigma-test-util = { workspace = true }

# Addition from `reqwest`
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen = { version = "0.2.68", features = ["serde-serialize"] }
wasm-bindgen-test = "0.3"
