[package] name = "nostr" version = "0.37.0" edition = "2021" description = "Rust implementation of the Nostr protocol." authors.workspace = true homepage.workspace = true repository.workspace = true license.workspace = true readme = "README.md" rust-version.workspace = true keywords = ["nostr", "protocol", "no_std"] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] [features] default = ["std"] std = [ "dep:url", "base64?/std", "bech32/std", "bitcoin/std", "bitcoin/rand-std", "bip39?/std", "cbc?/std", "chacha20?/std", "chacha20poly1305?/std", "negentropy/std", "negentropy-deprecated/std", "once_cell/std", "scrypt?/std", "serde/std", "serde_json/std", "serde_json/preserve_order", "unicode-normalization?/std", ] alloc = [ "dep:url-fork", "base64?/alloc", "bech32/alloc", "cbc?/alloc", "chacha20poly1305?/alloc", "once_cell/alloc", "serde/alloc", "serde_json/alloc", ] all-nips = ["nip04", "nip05", "nip06", "nip07", "nip11", "nip44", "nip46", "nip47", "nip49", "nip57", "nip59"] nip03 = ["dep:nostr-ots"] nip04 = ["dep:aes", "dep:base64", "dep:cbc"] nip05 = ["dep:reqwest"] nip06 = ["dep:bip39"] nip07 = ["dep:js-sys", "dep:wasm-bindgen", "dep:wasm-bindgen-futures", "dep:web-sys"] nip11 = ["dep:reqwest"] nip44 = ["dep:base64", "dep:chacha20"] nip46 = ["nip04", "nip44"] nip47 = ["nip04"] nip49 = ["dep:chacha20poly1305", "dep:scrypt", "dep:unicode-normalization"] nip57 = ["dep:aes", "dep:cbc"] nip59 = ["nip44"] [dependencies] aes = { version = "0.8", optional = true } async-trait.workspace = true base64 = { version = "0.22", default-features = false, optional = true } bech32 = { version = "0.11", default-features = false } # bitcoin uses v0.11 bip39 = { version = "2.0", default-features = false, optional = true } bitcoin = { version = "0.32", default-features = false, features = ["rand", "serde"] } cbc = { version = "0.1", optional = true } chacha20 = { version = "0.9", optional = true } chacha20poly1305 = { version = "0.10", default-features = false, features = ["getrandom"], optional = true } negentropy.workspace = true negentropy-deprecated.workspace = true nostr-ots = { version = "0.2", optional = true } once_cell.workspace = true reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "socks"], optional = true } scrypt = { version = "0.11", default-features = false, optional = true } serde = { version = "1.0", default-features = false, features = ["derive"] } serde_json.workspace = true unicode-normalization = { version = "0.1", default-features = false, optional = true } url = { version = "2.5", default-features = false, features = ["serde"], optional = true } # Used in std url-fork = { version = "3.0", default-features = false, features = ["serde"], optional = true } # Used for no_std [target.'cfg(target_arch = "wasm32")'.dependencies] getrandom = { version = "0.2", features = ["js"] } instant = { version = "0.1", features = ["wasm-bindgen", "inaccurate"] } js-sys = { workspace = true, optional = true } wasm-bindgen = { workspace = true, optional = true } wasm-bindgen-futures = { workspace = true, optional = true } web-sys = { workspace = true, features = ["Window"], optional = true } [dev-dependencies] num_cpus = "1.15" tokio = { workspace = true, features = ["full"] } [[example]] name = "keys" required-features = ["std"] [[example]] name = "metadata" required-features = ["std"] [[example]] name = "nip05" required-features = ["std", "nip05"] [[example]] name = "nip06" required-features = ["std", "nip06"] [[example]] name = "nip09" required-features = ["std"] [[example]] name = "nip11" required-features = ["std", "nip11"] [[example]] name = "nip13" required-features = ["std"] [[example]] name = "nip19" required-features = ["std"] [[example]] name = "nip57" required-features = ["std", "nip57"] [[example]] name = "vanity" required-features = ["std"] [[example]] name = "nip15" required-features = ["std"] [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bench)'] }