[package]
name = "ergo-lib-wasm"
version = "0.24.0"
license = "CC0-1.0"
authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"]
repository = "https://github.com/ergoplatform/sigma-rust"
edition.workspace = true
description = "WASM bindings for ergo-lib"

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

[features]
default = ["console_error_panic_hook"]
rest = ["ergo-lib/rest"]
compiler = ["ergo-lib/compiler"]

[dependencies]
base16 = { workspace = true }
serde =  { workspace = true } 
ergo-lib = { workspace = true }
sigma-util = { workspace = true }
serde_json = { workspace = true }
js-sys = "0.3"
web-sys = {version = "0.3", features = ["Url"]}
url = { workspace = true }
bounded-integer = { workspace = true }
futures = { workspace = true }
thiserror = { workspace = true }
# This dependency is needed due to deprecation of `JsValue::[into|from]_serde` in `wasm-bindgen`.
# Note that the deprecation comments suggest using `serde-wasm-bindgen` as another alternative; I
# tried it but it breaks some of our tests.
gloo-utils = {version = "0.1.5", features = ["serde"] }
# used in elliptic-curve(in ergo-lib), compiled here with WASM support
getrandom = { workspace = true, features = ["js"] }
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.6", optional = true }
derive_more = { workspace = true }
num-traits = { workspace = true }
serde_with = { workspace = true }
bounded-vec = { workspace = true, features=["serde"] }
wasm-bindgen = { version = "0.2.84", features = [] }
wasm-bindgen-futures = { version = "0.4.34" }

[dev-dependencies]
wasm-bindgen-test = { workspace = true }
ergo-lib = { workspace = true, features = ["arbitrary"] }
proptest = { workspace = true }

[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-Os", "--enable-mutable-globals"]
# wasm-opt = false
