strata-public-contract 0.2.3

Shared Rust types for Strata markets and Sonar quotes.
Documentation

strata-public-contract

Shared Rust models for Strata markets, capabilities, and Sonar quotes.

Most applications should start with strata-sdk, which includes these types and the async HTTP client. Use this crate directly when you need the public models without a network client.

Install

[dependencies]
strata-public-contract = "0.1"

What it provides

Model Represents
CapabilityCatalog Features currently available from Strata
MarketsResponse Markets, token decimals, and Sonar quote readiness
QuoteRequest Market, side, exact input amount, and execution tolerance
QuoteResponse Output, fees, minimum output, price impact, and expiry
ErrorResponse Stable public error details

Token amounts are unsigned decimal strings in atomic units so values stay exact across Rust, JSON, JavaScript, and terminal boundaries.

DEFAULT_SLIPPAGE_BPS is 0 for exact read-only quotes. Price impact remains a separate response field because current depth and future execution tolerance answer different questions.

Versioned fixtures

Enable the optional fixtures feature to consume the canonical JSON examples used across the official Strata SDKs:

[dev-dependencies]
strata-public-contract = { version = "0.1", features = ["fixtures"] }

See the workspace README for the complete guide.