Files
keysat-client-rust/Cargo.toml
T
Keysat 5dd301cd69 v0.2.0 — policy_slug on start_purchase + list_public_policies
Mirrors the TS SDK 0.2.0 changes (cf c3a57a0 in keysat-client-ts) so
all four language clients have parity on the tiered-purchase surface.

Breaking change on start_purchase: positional `(buyer_email,
redirect_url)` args replaced with a `&StartPurchaseOptions` struct.
Migration is mechanical:

  // before
  client.start_purchase(slug, None, None).await?;
  // after
  client.start_purchase(slug, &Default::default()).await?;

  // tier-aware
  client.start_purchase(slug, &StartPurchaseOptions {
      policy_slug: Some("pro"),
      buyer_email: Some("buyer@example.com"),
      ..Default::default()
  }).await?;

The struct has fields for buyer_email, buyer_note, redirect_url,
code, and the new policy_slug. New `list_public_policies` method
fetches the buyer-visible tier list (no auth) so an in-app tier
picker can render dynamically.

Lib + tests build clean; the example's anyhow-not-in-deps issue is
pre-existing and unrelated.
2026-05-09 09:08:39 -05:00

42 lines
1.3 KiB
TOML

[package]
name = "keysat-licensing-client"
version = "0.2.0"
edition = "2021"
rust-version = "1.75"
description = "Client library for Keysat. Verifies signed license keys offline and wraps the HTTP API for purchase and revocation checks."
license = "MIT OR Apache-2.0"
repository = "https://github.com/keysat-xyz/keysat-client-rust"
keywords = ["bitcoin", "licensing", "btcpay", "start9"]
categories = ["authentication", "cryptography"]
[features]
# Default is offline-only verification — no network, no async runtime required.
default = ["offline"]
offline = []
# Online verification + purchase via reqwest. Async (tokio).
online = ["reqwest", "tokio", "url"]
[dependencies]
ed25519-dalek = { version = "2", features = ["pkcs8", "pem"] }
sha2 = "0.10"
data-encoding = "2"
thiserror = "1"
# Async / HTTP: only compiled with the `online` feature.
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"], optional = true }
tokio = { version = "1", features = ["rt", "macros"], optional = true }
url = { version = "2", optional = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
[dev-dependencies]
tokio = { version = "1", features = ["full"] }
[[example]]
name = "offline_verify"
required-features = ["offline"]
[[example]]
name = "online_validate"
required-features = ["online"]