[package]
name = "pr402-client"
version = "0.1.0"
edition = "2021"
description = "Lightweight x402 v2 client library and CLI for buyer agents: discover, build, sign, settle."
license = "Apache-2.0"
repository = "https://github.com/miralandlabs/pr402"
readme = "README.md"
keywords = ["x402", "http-402", "solana", "payments", "cli"]
categories = ["command-line-utilities", "web-programming::http-client", "api-bindings"]
rust-version = "1.75"

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

# `pr402-buy` — installable one-shot buyer CLI over the library. Keep the bin's
# dependencies light: it just wraps `X402AgentClient::fetch_with_auto_pay`, adds
# argument parsing via clap, and walks the full 402 → pay → retry loop.
[[bin]]
name = "pr402-buy"
path = "src/main.rs"

[dependencies]
anyhow = "1.0"
base64 = "0.22"
bincode = "1.3"
clap = { version = "4.5", features = ["derive"] }
reqwest = { version = "0.11", features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
solana-sdk = "^2.1"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true
