[package]
name = "neo3"
version = "2.0.1"
edition = "2021"
rust-version = "1.83"
authors = ["R3E Network <jimmy@r3e.network> (c) 2020-2025"]
license = "MIT OR Apache-2.0"
description = "Production-ready Rust SDK for Neo N3 blockchain with high-level API, unified error handling, and enterprise features"
documentation = "https://docs.rs/neo3"
repository = "https://github.com/R3E-Network/NeoRust"
homepage = "https://github.com/R3E-Network/NeoRust"
readme = "README.md"
categories = ["cryptography::cryptocurrencies", "api-bindings", "cryptography"]
keywords = ["crypto", "neo", "neo-N3", "web3", "blockchain"]
include = [
    "/Cargo.toml",
    "/Cargo.lock",
    "/build.rs",
    "/README.md",
    "/CHANGELOG.md",
    "/LICENSE",
    "/LICENSE-APACHE",
    "/LICENSE-MIT",
    "/COPYRIGHT",
    "/assets/**",
    "/src/**",
]

[lib]
doctest = true

# https://docs.rs/about/metadata
[package.metadata.docs.rs]
all-features = false
features = ["futures", "ledger"]
rustdoc-args = ["--cfg", "docsrs"]
default-target = "x86_64-unknown-linux-gnu"

# https://github.com/integer32llc/rust-playground/blob/c6165a36923db5d99313e6056b5b610a2ede5bb0/top-crates/src/lib.rs#L175-L184
[package.metadata.playground]
all-features = false

[workspace]
# Explicitly set the resolver to version 2, which is the default for packages with edition >= 2021
# https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html
resolver = "2"
members = [
    ".",
    "neo-cli",
    "examples/basic",
    "examples/intermediate", 
    "examples/advanced",
    "examples/contract_interaction",
    "examples/message_signing",
    "examples/neo_contracts",
    "examples/subscriptions",
    "examples/neo_transactions",
    "examples/transactions",
    "examples/neo_smart_contracts",
    "examples/wallets",
    "examples/neo_fs",
    "examples/events",
    "examples/big-numbers",
    "examples/neo_x",
    "examples/neo_nodes",
    "examples/neo_nns",
    "examples/middleware",
    "examples/contracts",
    "examples/providers",
    "examples/neo_famous_contracts",
    "examples/neo_nep17_tokens",
    "examples/queries",
    "examples/neo_wallets",
    "examples/neo_crypto",
    "examples/standalone"
]
exclude = [
    "examples/sgx_enclave",
]

[dependencies]
tokio-tungstenite = { version = "0.29.0", features = ["native-tls", "connect"], optional = true }
futures = { version = "0.3.32", default-features = false, features = ["std"] }
futures-util = "0.3.28"
futures-channel = "0.3.28"
futures-timer = { version = "3.0.2", default-features = false, features = ["wasm-bindgen"] }
pin-project = "1.1"
reqwest = { version = "0.12.5", default-features = false, features = ["json", "blocking", "rustls-tls", "stream"] }
url = { version = "2.5", default-features = false }

# crypto
elliptic-curve = { version = "0.13.5", default-features = false }
k256 = { version = "0.13.1", default-features = false, features = ["ecdsa", "std", "ecdsa-core"] }
sha2 = { version = "0.11", default-features = false }
sha3 = { version = "0.10.8", default-features = false, features = ["std"] }
blake2 = { version = "0.10.6", default-features = false, features = ["std"] }
ed25519-dalek = { version = "2.1.1", default-features = false, features = ["std", "rand_core"] }
hmac = "0.13.0"
base64 = "0.22.1"

# serde
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["raw_value"] }

async-trait = "0.1.73"
auto_impl = "1.1"

# misc
bytes = "1.4"
hex = { package = "const-hex", version = "1.6", features = ["hex"] }
hex-literal = "1.1"
once_cell = "1.21"
rand = "0.9.3"
rayon = "1.7"
# tempfile: moved to [dev-dependencies]
thiserror = "2.0.17"

# tracing
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", default-features = false, features = ["fmt", "std"] }
tracing-futures = "0.2.5"

# wasm
# instant = "0.1.12"  # REMOVED: Unmaintained (RUSTSEC-2024-0384)
serde_with = "3.18.0"
# For base64 encoding
bs58 = "0.5.1"
aes = "0.8.3"
# For JSON manipulation
# json = "0.12"  # REMOVED: Unmaintained and vulnerable (RUSTSEC-2022-0081)
rust_decimal = "1.41"
# JSON encode

ripemd = "0.2.0"

# Data structures
p256 = "0.13.2"
# Big integer math
num-bigint = "0.4"
# Byte array utils
byte-slice-cast = "1.2"
primitive-types = { version = "0.14.0", features = ["serde"] }
# Serialization
# bincode = "1.3"
# rust-crypto = "0.2"  # REMOVED: Vulnerable (RUSTSEC-2022-0011) - replaced with ring and other secure alternatives
lazy_static = "1.4.0"
num-traits = "0.2.16"
chrono = { version = "0.4.44", features = ["serde"] }
strum = "0.28.0"
strum_macros = "0.28.0"
num_enum =   "0.7.6"
derive_more = { version = "2.1.1", features = ["full"] }
getset = "0.1.2"
rustc-hash = { version = "2.1", optional = true }

scrypt = "0.11.0"
signature   = "2.1.0"
rand_core = "0.9.3"
#openssl = "0.10"

# log removed: use `tracing` exclusively for structured logging
ecb = "0.1.2"
http = "1.4.0"
jsonwebtoken = { version = "10.3.0", default-features = false, features = ["rust_crypto"] }

# ledger
coins-ledger = { version = "0.13.0", default-features = false, optional = true }
# yubi - conditional compilation for release builds
yubihsm = { version = "0.42", features = ["http", "usb"], optional = true }

bip39 = { version = "2.2.2", features = ["rand"] }
# Neo X EVM layer. Replaces the unmaintained `ethers` crate (which pulled in
# vulnerable rustls-webpki 0.101 via reqwest 0.11). alloy is the maintained
# successor; `essentials` bundles contract (sol!), provider-http, rpc-types
# and signer-local, `reqwest` enables the HTTP transport.
alloy = { version = "2.1", features = ["essentials", "reqwest"] }

# SGX dependencies (optional) - only available when building for SGX target
# These are commented out by default as they require special SGX environment

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.50", features = ["full"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
# Tokio restricts supported features on wasm targets (including WASI).
tokio = { version = "1.45", default-features = false, features = ["sync", "macros", "io-util", "rt", "time"] }
# Uncomment when building for SGX:
# sgx_tstd = { git = "https://github.com/apache/teaclave-sgx-sdk.git", rev = "v2.0.0", optional = true }
# sgx_types = { git = "https://github.com/apache/teaclave-sgx-sdk.git", rev = "v2.0.0", optional = true }
# sgx_trts = { git = "https://github.com/apache/teaclave-sgx-sdk.git", rev = "v2.0.0", optional = true }
# sgx_tcrypto = { git = "https://github.com/apache/teaclave-sgx-sdk.git", rev = "v2.0.0", optional = true }


[dev-dependencies]
mockall = "0.14.0"
tracing = "0.1"
tracing-subscriber = "0.3.23"
criterion = { version = "0.8", features = ["html_reports"] }
tempfile = "3.27"
serial_test = "3.4.0"
proptest = "1.11"
env_logger = "0.11"

[[bench]]
name = "crypto_benchmarks"
harness = false

[[bench]]
name = "script_builder_benchmarks"
harness = false

[[bench]]
name = "gas_estimator_benchmarks"
harness = false

[[bench]]
name = "wallet_benchmarks"
harness = false

[features]
futures = []
ledger = ["coins-ledger"]
# aws = ["rusoto_core", "rusoto_kms"]  # DISABLED: Security vulnerabilities in rusoto dependencies
default = []
# Mock client + in-memory provider for offline tests/CI
mock = []
# YubiHSM features - only for development/testing
yubi = ["dep:yubihsm"]
mock-hsm = ["yubi", "yubihsm/mockhsm"]
ipc = ["dep:rustc-hash"]
init = []
legacy-ws = ["dep:tokio-tungstenite"]
ws = ["dep:tokio-tungstenite"]
# Note: use `yubi` feature to enable YubiHSM support (activates `dep:yubihsm`)

# SGX support for secure enclave execution
# Note: SGX dependencies must be manually uncommented above when building for SGX
sgx = [
    "no_std"
    # Uncomment these when SGX dependencies are enabled:
    # "sgx_tstd",
    # "sgx_types", 
    # "sgx_trts",
    # "sgx_tcrypto",
]

# no_std support for embedded and SGX environments
no_std = [
    "serde/alloc",
    "hex/alloc",

    "k256/arithmetic",
    "elliptic-curve/arithmetic",
]

[profile.dev.package."*"]
opt-level = 3


[profile.test]
opt-level = 1


[profile.test.package."*"]
opt-level = 3
