Shared Alpaca client library for st0x services. One transport core plus feature-gated API surfaces, so each consumer compiles only the endpoints it uses:
| Feature | Surface | Consumer |
|---|---|---|
issuer |
ITN issuer callbacks: mint callback, redeem, request polling | st0x.issuance |
broker |
Broker API trading: orders, conversions, journals, positions, account, activities, market hours | st0x.liquidity |
wallet |
Crypto wallet: transfers, whitelists, wallet addresses, status polling | st0x.liquidity |
market-data |
Latest-trade price lookups | st0x.liquidity |
[dependencies]
st0x-alpaca = { git = "ssh://git@github.com/ST0x-Technology/st0x.alpaca", features = ["broker", "wallet"] }- Shared transport (
core):AlpacaClientcarries the base URL, account id, Alpaca's dual authentication (HTTP Basic plus theAPCA-API-KEY-ID/APCA-API-SECRET-KEYheaders), and the exponential-backoff retry policy.AlpacaErroris the shared error taxonomy; surface modules add their own invariant variants on top. - Neutral wire types: quantities and money are
rust_decimal::Decimalexactly as Alpaca encodes them (JSON strings, numbers accepted on deserialization). Consumers convert to their own domain newtypes at the boundary; domain policy (positivity, precision truncation, telemetry) stays in the consuming service. - Telemetry-free: no
tracingdependency; consumers wrap calls with their own instrumentation.
nix develop
cargo check --all-features
cargo test --all-features
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --checkEvery feature must also compile standalone
(cargo check --no-default-features --features <feature>).