[package]
name = "blueprint-sdk"
version = "0.2.0-alpha.4"
description = "Blueprint SDK for building decentralized and distributed services."
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[lints]
workspace = true

[dependencies]
# Required dependencies
blueprint-core = { workspace = true }
blueprint-router = { workspace = true }
blueprint-runner = { workspace = true }
blueprint-producers-extra = { workspace = true }
blueprint-qos = { workspace = true }
blueprint-keystore = { workspace = true }
blueprint-clients = { workspace = true }
blueprint-crypto = { workspace = true }
blueprint-std = { workspace = true }
blueprint-manager-bridge = { workspace = true, features = ["client"] }
blueprint-auth = { workspace = true }

# The keystore context is the only one that doesn't bring in extra dependencies, so we can always include it
blueprint-contexts = { workspace = true, features = ["keystore"] }
document-features = { workspace = true, features = ["default"] }
blueprint-chain-setup = { workspace = true, optional = true }

# Macros
blueprint-macros = { workspace = true, optional = true }
blueprint-context-derive = { workspace = true, optional = true }

# Tangle-specific extras
blueprint-tangle-extra = { workspace = true, optional = true }

# Eigenlayer and EVM-specific extras
blueprint-evm-extra = { workspace = true, optional = true }
blueprint-eigenlayer-extra = { workspace = true, optional = true }
alloy = { workspace = true, optional = true, features = ["full"] }
alloy-json-abi = { workspace = true, optional = true, features = ["serde_json"] }
eigensdk = { workspace = true, optional = true, features = ["full"] }

# K, V Stores
blueprint-stores = { workspace = true, optional = true }

# Error Handling
thiserror = { workspace = true }

# Required Features for macro resolution
tokio = { workspace = true, default-features = false }

# Networking-related dependencies
blueprint-networking = { workspace = true, optional = true }

# Round-based protocol support
blueprint-networking-round-based-extension = { workspace = true, optional = true }

# Gossip protocol extensions
blueprint-gossip-primitives = { workspace = true, optional = true }
blueprint-networking-agg-sig-gossip-extension = { workspace = true, optional = true }

# Optional dependencies for testing
blueprint-testing-utils = { workspace = true, optional = true }
tempfile = { workspace = true, optional = true }

# Optional dependencies for build
blueprint-build-utils = { workspace = true, optional = true }

# x402 Payment Gateway
blueprint-x402 = { workspace = true, optional = true }

# Webhook Producer
blueprint-webhooks = { workspace = true, optional = true }

# TEE Support
blueprint-tee = { workspace = true, optional = true }

# Remote cloud deployments
blueprint-remote-providers = { workspace = true, optional = true }

openssl-sys = { workspace = true, features = ["vendored"] }

[features]
default = ["std", "tracing"]

#! ### Core

## Enable standard library support
std = [
    # Core
    "blueprint-core/std",
    "blueprint-runner/std",
    "blueprint-keystore/std",
    "blueprint-contexts/std",
    "blueprint-clients/std",
    "blueprint-crypto/std",
    "blueprint-context-derive?/std",
    "blueprint-auth/std",
    # Extras
    "blueprint-tangle-extra?/std",
    "blueprint-evm-extra?/std",
    "blueprint-eigenlayer-extra?/std",
    "blueprint-chain-setup?/std",
]

## Enable [tracing] support
##
## [tracing]: https://crates.io/crates/tracing
tracing = [
    "blueprint-core/tracing",
    "blueprint-router/tracing",
    "blueprint-producers-extra/tracing",
]

##! ### Protocol Support

## Enable EVM support
evm = [
    "dep:blueprint-evm-extra",
    "dep:alloy",
    "dep:alloy-json-abi",
    "blueprint-clients/evm",
    "blueprint-contexts/evm",
    "blueprint-context-derive?/evm",
    "blueprint-macros?/evm",
    "blueprint-testing-utils?/anvil",
    "blueprint-chain-setup?/anvil",
]

## Enable Tangle EVM (v2) support
##
## This enables the EVM-native implementation for Tangle v2 contracts.
tangle = [
    "dep:blueprint-tangle-extra",
    "dep:alloy",
    "blueprint-clients/tangle",
    "blueprint-contexts/tangle",
    "blueprint-context-derive?/tangle",
    "blueprint-runner/tangle",
    "blueprint-testing-utils?/anvil",
    "blueprint-chain-setup?/anvil",
]

## Enable Tangle EVM with HTTP-based BLS aggregation service
tangle-aggregation = [
    "tangle",
    "blueprint-tangle-extra/aggregation",
]

## Enable Tangle EVM with P2P gossip-based BLS aggregation
tangle-p2p-aggregation = [
    "tangle",
    "blueprint-tangle-extra/p2p-aggregation",
    "agg-sig-gossip",
]

## Enable [Eigenlayer] support
##
## [Eigenlayer]: https://eigenlayer.xyz
eigenlayer = [
    "dep:eigensdk",
    "blueprint-contexts/eigenlayer",
    "blueprint-clients/eigenlayer",
    "blueprint-testing-utils?/eigenlayer",
    "blueprint-eigenlayer-extra",
    "evm",
]

##! ### Networking Support

## Enable networking support
networking = [
    "dep:blueprint-networking",
    "blueprint-contexts/networking",
    "blueprint-keystore/std",
    "blueprint-context-derive?/networking",
    "blueprint-runner/networking",
]

## Enable [round-based] networking capability
##
## [round-based]: https://github.com/LFDT-Lockness/round-based
round-based-compat = ["dep:blueprint-networking-round-based-extension"]

## Enable gossip protocol primitives (deduplication, message store, etc.)
gossip = ["dep:blueprint-gossip-primitives", "networking"]

## Enable BLS signature aggregation via P2P gossip
agg-sig-gossip = [
    "dep:blueprint-networking-agg-sig-gossip-extension",
    "dep:blueprint-gossip-primitives",
    "networking",
]

##! ### Utilities

## Enable local KV stores
local-store = ["blueprint-stores/local"]

## Enable all macros of subcrates
macros = ["dep:blueprint-macros", "dep:blueprint-context-derive"]

## Enable build-time utilities
build = ["dep:blueprint-build-utils", "macros"]

## Enable testing utilities
testing = [
    "blueprint-networking/testing",
    "dep:blueprint-testing-utils",
    "dep:blueprint-chain-setup",
    "dep:tempfile",
    "std",
]

## Enable testing utilities with FaaS support
testing-faas = [
    "testing",
    "faas",
    "blueprint-testing-utils/faas",
]

#! ### Extra producers

## Enable the cron job producer
cronjob = ["blueprint-producers-extra/cron"]

## Enable remote cloud deployment providers
remote-providers = ["dep:blueprint-remote-providers"]

## Enable FaaS (Function-as-a-Service) execution support
faas = ["blueprint-runner/faas"]

#! ### Payments

## Enable x402 payment gateway for cross-chain EVM job settlement
x402 = ["dep:blueprint-x402"]

## Enable webhook producer for external HTTP event triggers
webhooks = ["dep:blueprint-webhooks"]

#! ### TEE

## Enable Trusted Execution Environment (TEE) support
tee = ["dep:blueprint-tee", "blueprint-runner/tee"]

[package.metadata.docs.rs]
features = ["tangle", "tangle-aggregation", "tangle-p2p-aggregation", "evm", "eigenlayer", "networking", "round-based-compat", "gossip", "agg-sig-gossip", "local-store", "macros", "build", "testing", "cronjob"]
rustdoc-args = ["--cfg", "docsrs"]
