[package]
name = "keetanetwork-anchor-client"
version = "0.2.0"
edition.workspace = true
authors.workspace = true
license-file.workspace = true
repository.workspace = true
homepage.workspace = true
description = "Transport-agnostic KeetaNet anchor client: request signing byte-compatible with the TypeScript reference"

[lib]
path = "src/lib.rs"

# The integration suite drives the feature-gated asset-movement surface, so a
# default-feature `cargo check --tests` skips it instead of failing.
[[test]]
name = "asset_movement"
required-features = ["asset"]

# The on-chain certificate read and trust evaluation are `trust`-gated.
[[test]]
name = "account_certificates"
required-features = ["trust"]

[features]
default = ["std"]
codec = ["dep:serde", "dep:serde_json", "dep:keetanetwork-client"]
service = ["codec", "dep:percent-encoding"]
kyc = ["service"]
fx = ["service"]
storage = ["service"]
asset = ["service"]
trust = [
	"codec",
	"keetanetwork-anchor/x509",
	"keetanetwork-anchor/chrono",
	"dep:keetanetwork-x509",
	"dep:chrono",
]
http = ["service", "dep:reqwest", "reqwest/json"]
resilience = ["dep:spin"]
std = [
	"http",
	"kyc",
	"dep:tokio",
	"reqwest/rustls",
	"snafu/std",
	"base64/std",
	"serde?/std",
	"serde_json?/std",
	"url/std",
	"percent-encoding?/std",
	"keetanetwork-anchor/std",
	"keetanetwork-account/std",
	"keetanetwork-client/std",
]
wasm = ["http", "keetanetwork-client/http", "keetanetwork-client/wasm"]
wasi = ["service"]

[dependencies]
keetanetwork-anchor = { workspace = true, features = [
	"signing",
] }
keetanetwork-account = { workspace = true, default-features = false, features = [
	"rasn",
] }
keetanetwork-x509 = { workspace = true, default-features = false, features = [
	"rasn",
	"alloc",
], optional = true }
keetanetwork-client = { workspace = true, optional = true }

async-trait = { workspace = true }
chrono = { workspace = true, default-features = false, features = [
	"alloc",
], optional = true }
base64 = { workspace = true, features = ["alloc"] }
miniz_oxide = { workspace = true }
url = { workspace = true }
snafu = { workspace = true }

serde = { workspace = true, features = ["derive"], optional = true }
serde_json = { workspace = true, features = ["alloc"], optional = true }
percent-encoding = { workspace = true, optional = true }
spin = { workspace = true, features = ["mutex", "spin_mutex"], optional = true }

[dependencies.reqwest]
workspace = true
optional = true

[dependencies.tokio]
workspace = true
features = ["rt", "time"]
optional = true

# Browser runtime backend for the resilience layer.
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]
gloo-timers = { workspace = true, features = ["futures"] }
wasm-bindgen-futures = { workspace = true }
js-sys = { workspace = true }
web-sys = { workspace = true, features = ["Window", "Performance"] }

# WASI Preview 2 runtime backend for the resilience layer.
[target.'cfg(target_os = "wasi")'.dependencies]
wstd = { workspace = true }

[dev-dependencies]
keetanetwork-anchor = { workspace = true, default-features = true, features = [
	"std",
	"signing",
	"serde",
	"chrono",
] }
keetanetwork-account = { workspace = true, features = ["std", "rasn"] }
keetanetwork-asn1 = { workspace = true, features = ["rasn"] }
keetanetwork-x509 = { workspace = true, features = ["std", "rasn"] }
keetanetwork-crypto = { workspace = true, features = [
	"std",
	"signature",
	"encryption",
	"rasn",
] }
keetanetwork-utils = { workspace = true, features = ["std"] }
async-trait = { workspace = true }
base64 = { workspace = true, features = ["std"] }
hex = { workspace = true, features = ["std"] }
serde = { workspace = true, features = ["std", "derive"] }
serde_json = { workspace = true, features = ["std"] }
snafu = { workspace = true, features = ["std"] }
chrono = { workspace = true, features = ["std", "clock"] }

[dev-dependencies.tokio]
workspace = true
features = ["rt", "rt-multi-thread", "macros", "time", "net"]
