Expand description
Official Rust client for Strata markets and Sonar quotes.
It provides typed requests and responses and validates compatibility, quote binding, and economic fields before returning data to the application.
Re-exports§
pub use transaction_verifier::decode_transaction;pub use transaction_verifier::verify_execution_transaction;pub use transaction_verifier::verify_maker_transaction;pub use transaction_verifier::verify_order_transaction;pub use transaction_verifier::verify_signed_transaction_message;pub use transaction_verifier::verify_twap_transaction;pub use transaction_verifier::DecodedInstruction;pub use transaction_verifier::DecodedTransaction;pub use transaction_verifier::DefaultTransactionVerifier;pub use transaction_verifier::TransactionVersion;
Modules§
- transaction_
verifier - Built-in transaction verification for one-signature order control.
Structs§
- Account
Stream - One externally authenticated private account stream. The SDK retains no signer and fails closed on any identity or sequence mismatch.
- Action
Authority Model - Action
Edge - Action
Graph - Action
Node - Action
Operation - Capability
Catalog - Capability
Descriptor - Dead
ManGuard - Keeps the durable dead-man deadline alive. Drop is deliberately fail-closed: it stops heartbeats and leaves the pre-signed cancel-all armed.
- Execution
Authorization - A parsed two-step execution authorization: the exact bytes to sign and the blockhash lease they bind.
- Execution
Challenge Request - Ask Strata for a one-time payload authorizing preparation of an existing Sonar quote. The session key signs locally; no private signing material is accepted by this contract.
- Execution
Challenge Response - Execution
Prepare Authorization - A prepared execution challenge, signed: the two-step path.
- Execution
Prepare Response - Execution
Stream - Sequenced state for the executions an agent prepared in one market. The
stream opens with a
watchframe for the requested handles and begins with a snapshot; laterwatchcalls add handles on the same stream. Any market or sequence mismatch fails closed so the caller reconnects. - Execution
Submit Request - Execution
Submit Response - Execution
Verification Context - Everything a verifier needs to decide whether the session may sign one prepared immediate execution.
- Live
Platform Capability - One operation currently callable through the live v2 gateway.
- Maker
Stream - One externally authenticated owner-only maker stream. The SDK retains no signer and fails closed on any identity or sequence mismatch.
- Maker
Verification Context - Market
- Market
Data Stream - One sequenced connection to Strata’s product-level market stream.
- Markets
Response - NoSigner
- Type-level placeholder for “no signer” (public reads).
- Order
Authorization - A parsed two-step order authorization: the exact bytes to sign and the blockhash lease they bind.
- Order
Challenge Result - Order
Command Stream - Cloneable handle to one authenticated persistent order-command socket. Commands from clones are sequenced by a single writer task, so concurrent strategies cannot produce sequence gaps on the wire.
- Order
Verification Context - Everything a verifier needs to decide whether the session may sign one prepared resting-order transaction.
- Page
Info - Page
Request - Platform
Account Fill - Platform
Account Market Request - Platform
Account Order - Platform
Account Request - Platform
Account Snapshot - Platform
Account Snapshot Response - Platform
Action Graph Response - Complete customer-safe product graph. Static package support is projected against live capability discovery before this response is served.
- Platform
Asset - Asset identity used by ordinary SDK operations.
- Platform
Assets Response - Platform
Authority - Platform
Best BidAsk Response - Platform
Book Change - Platform
Book Level - Platform
Book Request - Platform
Book Snapshot Response - Platform
BugReport - Platform
BugSubmit Request - Platform
BugSubmit Response - Platform
Bugs Response - Platform
Candle - Decimal prices are strings so no SDK boundary silently rounds money.
- Platform
Candles Request - Platform
Candles Response - Platform
Dead ManState - Platform
Discovery Response - Operations currently available to the client.
- Platform
Execution Row - One watched immediate execution as the stream sees it: the same fields as the recoverable HTTP receipt without the envelope.
- Platform
Execution Status Response - Recoverable immediate-execution receipt. Confirmed rows are journalled and survive a market-service restart.
- Platform
FeeSchedule Response - Platform
Graph Module - Platform
Graph Relation - Platform
Maker Control Prepare Response - Platform
Maker Control Submit Request - Platform
Maker Control Submit Response - Platform
Maker Fill - One maker-side fill: the same sanitized settlement view as an account fill plus the maker product that produced it. No counterparty or venue.
- Platform
Maker Quickstart Prepared - Platform
Maker Quickstart Request - Human-facing maker configuration.
spread_bpsis the distance from the Strata mark to the first quote on each side.sizeis an exact decimal base amount, optionally suffixed by its symbol (for example0.01 SOL). - Platform
Maker Quickstart Result - Platform
Maker Reputation Authorized Request - Platform
Maker Reputation Response - Authenticated, privacy-preserving reliability and participation record for the requesting maker. All potentially large counters and atomic quantities are decimal strings so JavaScript agents never lose integer precision.
- Platform
Maker Status Response - Authenticated, owner-scoped view of the maker’s Strata products in one market: firm orders, intent, Strands, Currents, the signed-quote lane, live exposure, health, and kill state. Nothing about other makers, takers, or liquidity sources crosses this boundary.
- Platform
Maker Stop Result - Platform
Maker Tier Progress - Platform
Mark Response - Platform
Market - Stable market metadata for public SDK operations.
- Platform
Market Status Response - Platform
Markets Response - Platform
Operation - Platform
Operation Transport - Platform
Order Challenge Response - Platform
Order Prepare Authorization - A prepared challenge, signed: the two-step path.
- Platform
Order Prepare Response - Platform
Order Status Request - Platform
Order Status Response - Platform
Order Submit Request - Platform
Order Submit Response - Platform
Owner Rewards - Platform
Portfolio History Point - Platform
Portfolio History Response - Stored account-equity history. It never fabricates data before collection began and keeps all currency values in exact USD micros.
- Platform
Portfolio Response - The owner’s whole account in one public read, by wallet address: balances, per-market positions, open orders, and recent fills across every live market, plus USD totals. No signature and no market selection is needed. Amounts are exact atomic strings; USD totals are null whenever any held asset lacks a fresh public mark, so a partial valuation is never presented as complete.
- Platform
Referral Claim Request - Platform
Referral Claim Response - Platform
Referral Link Request - Platform
Referral Link Response - Platform
Referrals Response - Platform
Reward Standing - Platform
Rewards Request - Platform
Rewards Response - Platform
Service Status Response - Product-level readiness without leaking private implementation details.
- Platform
Swap Quote Request - Exact-input asset swap request. Asset identifiers come from
PlatformAssetsResponse; implementation-specific identifiers are not part of this contract. - Platform
Swap Quote Response - Short-lived customer economics for an exact-input asset swap.
- Platform
Trade - Platform
Trades Request - Platform
Trades Response - Platform
Twap - Platform
Twap Challenge Response - Platform
Twap Fill - Platform
Twap Prepare Authorization - A prepared TWAP challenge, signed: the two-step path.
- Platform
Twap Prepare Response - Platform
Twap Submit Request - Platform
Twap Submit Response - Platform
Twaps Response - Platform
Vault Delegate Prepare Request - Platform
Vault Delegate Prepare Response - Unsigned session-lifecycle control. The owner verifies both identities and the destructive action before signing and broadcasting it externally.
- Platform
Vault Deposit Prepare Request - Platform
Vault Deposit Prepare Response - Exact owner-funded deposit transaction. Asset construction and custody identities remain internal; the public intent is echoed for verification.
- Platform
Vault Pause Prepare Request - Platform
Vault Pause Prepare Response - An unsigned owner transaction. The external owner must verify its wallet and requested state before signing and broadcasting it.
- Platform
Vault Policy Prepare Request - Platform
Vault Policy Prepare Response - An owner-bound withdrawal-access change. Unrestricted access is a status state rather than a preparable action in this contract.
- Platform
Vault Session Status - Sanitized state for the requested external session key. It intentionally omits all construction accounts and price-source identities.
- Platform
Vault Setup Prepare Request - One-signature onboarding: only the wallet and the external session key are required. One session then trades every market. Everything else is an optional policy on top; absent values take the product defaults.
- Platform
Vault Setup Prepare Response - Owner-bound onboarding or session-replacement transaction. Product inputs are echoed exactly so an external verifier can reject changed intent.
- Platform
Vault Spending Limit - One asset-specific execution limit. A null maximum means that the session is permitted to use the asset without a per-execution amount ceiling.
- Platform
Vault Status Request - Platform
Vault Status Response - Product-level Vault state for an owner and, when requested, one external session key. Chain construction identities never cross this boundary.
- Platform
Vault Submit Request - Submit an owner-signed prepared Vault transaction. Strata verifies it is
exactly the prepared transaction, adds its own fee-payer signature when
the preparation was sponsored, and broadcasts it. Idempotent per
idempotency_key. - Platform
Vault Submit Response - Durable outcome of a Vault submission, also returned by the status read.
- Platform
Vault Withdraw Prepare Request - Platform
Vault Withdraw Prepare Response - Exact owner-authorized withdrawal transaction. The destination is a wallet identity; account construction and private balance routing remain internal.
- Platform
Vault Withdrawal Access - Platform
Workflow - Platform
Workflow Edge - Platform
Workflow Node - Quote
Request - Quote
Response - Strata
Client - Twap
Authorization - A parsed two-step TWAP authorization: the exact bytes to sign and the blockhash lease they bind.
- Twap
Stream - One sequenced wallet-scoped TWAP progress stream for one market. The
first event is the snapshot; later events are
twap_update, heartbeat, or recovery snapshots on the same stream identity. Any identity or sequence mismatch fails closed so the caller reconnects and recovers from a fresh snapshot. - Twap
Verification Context - Everything a verifier needs to decide whether the session may sign one prepared TWAP-control transaction.
Enums§
- Action
Node Kind - Capability
Risk - Capability
Stability - Execution
Prepare Request - Prepare a quote-bound execution transaction: a signed challenge
(
Authorized) or the quote binding itself (Direct, one signature — the session’s transaction signature is the authorization). The response is identical. - Execution
Status - McpExposure
- Order
Execute Operation - Permission
Source - Platform
Account Event - Platform
Book Side - Platform
BugStatus - Platform
Dead ManStatus - Platform
Execution Command - Client frame for the execution stream: watch one or more opaque execution
handles issued by
execution.preparein this market. - Platform
Execution Event - Sequenced execution stream (
execution.stream) for one market. The client opens the socket and sends awatchframe; the server answers with oneexecutions_snapshotfor the watched handles, thenexecution_updatewhenever a watched execution is prepared, confirmed on chain, or expires unconfirmed,execution_unknownfor handles this market never issued or no longer remembers, and heartbeats. Laterwatchframes add handles and produce update/unknown events for them. - Platform
Execution State - Platform
Maker Control Action - Platform
Maker Control Product - Platform
Maker Control Submission Status - Platform
Maker Current Prepare Request - One maker-owned Current mutation. Current is parameterized around the market’s live Strata mark and therefore has no recenter action.
- Platform
Maker Event - Authenticated, sequenced owner-only maker stream (
mm.fills.stream). After the signed challenge the server sends onemaker_snapshot, then sequencedmaker_fill,maker_status(exposure/product change), andheartbeatevents; a recovery snapshot advances the sequence on the same stream identity. - Platform
Maker Product - Which Strata maker product produced a maker-side fill.
- Platform
Maker Quickstart Operation - Platform
Maker Quickstart Side - Platform
Maker Reputation Tier - Platform
Maker Strand Prepare Request - One maker-owned Strand mutation. Amounts that may exceed JavaScript’s safe integer range remain canonical unsigned decimal strings on the wire.
- Platform
Market Action - Platform
Market Data Event - Platform
Market State - Platform
Order Action - Externally authorized resting-order operation. The public contract exposes product intent only; private construction details never cross the SDK boundary.
- Platform
Order Batch Operation - One operation inside an atomic order-control batch. Owner and session identity live on the enclosing challenge so no item can widen authority.
- Platform
Order Challenge Request - Request canonical bytes for one externally signed order-control operation. Variant-specific fields are sealed so an authorization cannot be widened between challenge and transaction preparation.
- Platform
Order Command - One command on the persistent order-control connection. Challenge results may contain an effective request that differs from the requested one only by the explicitly selected self-trade prevention transformation.
- Platform
Order Command Batch Event - One result inside a compact event batch. Shared stream identity, time and sequence metadata live on the enclosing frame; request correlation and command-specific results remain independent.
- Platform
Order Command Batch Format - Platform
Order Command Client Frame - Frames sent by an external agent. Authentication proves possession of the declared session key; individual order authorizations and transactions keep their existing exact external-signing boundaries. Authentication is a singleton frame. After authentication, the transport accepts either one command or a bounded array of commands; every command retains its own request ID and contiguous sequence.
- Platform
Order Command Event - One sequenced event emitted by the persistent order-control connection. After authentication, the transport carries bounded arrays of these events so concurrent results share frame overhead without weakening per-event sequence or request correlation. Terminal chain status may arrive later without blocking command submission.
- Platform
Order Command Server Frame - Platform
Order Control Status - Platform
Order Prepare Request - Prepare an order-control transaction. Either hand back a signed challenge
(
Authorized, two signatures per action) or send the operation itself (Direct, one signature per action): Strata builds the transaction from the operation immediately and the session’s signature over that transaction is the whole authorization. The response is identical. - Platform
Order State - Platform
Order Submission Status - Platform
Order Type - Platform
Portfolio History Range - Platform
Self Trade Prevention - Collision policy for an incoming order that would cross the owner’s own resting liquidity. Every mode still preserves Strata’s matcher and on-chain self-fill prohibition; this only controls which order is cancelled first.
- Platform
Service State - Platform
Settlement State - Platform
Trade Side - Platform
Transport - Platform
Twap Challenge Request - Request exact authorization bytes for one Vault-owned TWAP action. The external owner chooses the session signer; Strata never receives its key.
- Platform
Twap Control Action - Platform
Twap Event - Sequenced wallet-scoped TWAP progress stream (
algos.twap.stream) for one market. It starts with atwaps_snapshot, then sends onetwap_updatecarrying the complete sanitized TWAP row whenever a schedule is created, executes a slice, or reaches a terminal state, plus heartbeats. Every event carries the stream identity and previous sequence; a recovery snapshot advances the sequence on the same identity. - Platform
Twap Prepare Request - Prepare a TWAP-control transaction: a signed challenge (
Authorized) or the action itself (Direct, one signature — the transaction signature is the authorization). The response is identical. - Platform
Twap State - Platform
Vault Action - Which prepared Vault action a submission carries.
- Platform
Vault Delegate Action - Platform
Vault Session State - Platform
Vault Setup Mode - Platform
Vault State - Platform
Vault Submission Status - Platform
Vault Withdrawal Mode - Quote
Side - Quote
Target - Which amount a quote request fixes.
- SdkError
- Signing
Location - Twap
Execute Operation
Constants§
- ACCOUNT_
STREAM_ AUTH_ DOMAIN - DEFAULT_
API_ BASE - DEFAULT_
MAXIMUM_ TOLERANCE_ BPS - Default maximum tolerance: zero, so a quote is exact unless the caller opts into a lower floor. Tolerance is the caller’s choice; it is not price impact.
- DEFAULT_
SLIPPAGE_ BPS - Legacy name for
DEFAULT_MAXIMUM_TOLERANCE_BPS. - MAKER_
STREAM_ AUTH_ DOMAIN - MAX_
WATCHED_ EXECUTIONS - ORDER_
STREAM_ AUTH_ DOMAIN - PLATFORM_
SESSION_ DEFAULT_ MAXIMUM_ TOLERANCE_ BPS - PLATFORM_
SESSION_ DEFAULT_ MINIMUM_ INTERVAL_ SECONDS - Session policy applied when onboarding does not state one: at most one execution per second per session, and a 1% maximum tolerance.
- PLATFORM_
SESSION_ MAX_ SPENDING_ LIMITS - A session carries at most this many spending limits.
Traits§
- Account
Signer - Execution
Verifier - Maker
Transaction Signer - External maker-wallet adapter. Strata never accepts or stores its key.
- Order
Verifier - Session
Signer - Twap
Verifier
Functions§
- account_
http_ auth_ message - account_
stream_ auth_ message - bug_
authorization_ payload - exact_
output_ floor - The output floor an exact-output quote must carry: the requested amount
lowered by
maximum_tolerance_bps(truncating), zero tolerance meaning the requested amount itself. - maker_
reputation_ auth_ message - maker_
status_ auth_ message - maker_
stream_ auth_ message - quote_
target - Exactly one of
amount_in_atoms/amount_out_atoms, canonical and > 0. - referral_
claim_ authorization_ payload - referral_
link_ authorization_ payload - validate_
execution_ authorization - Two-step path helper: check a challenge’s authorization payload binds
exactly this quote, owner, and session before signing it. The one-call
StrataClient::execute_quoteno longer needs it (one signature over the transaction). - validate_
execution_ challenge - Two-step path helper: check an execution challenge is bound to this quote and still inside its lifetime.
- validate_
execution_ prepare - Two-step path helper: check a prepared execution preserved the signed challenge bindings.
- validate_
order_ authorization - Two-step path helper: check an order challenge’s authorization payload
binds exactly this operation (every field, opaque order identity, and
replay value) before signing it. The one-call
StrataClient::execute_orderno longer needs it (one signature over the transaction); the order command channel still uses it to bind the challenge without a message signature. - validate_
order_ prepare_ binding - Two-step path helper: check a prepared order control preserved the signed challenge bindings.
- validate_
twap_ authorization - Two-step path helper: check a TWAP challenge’s authorization payload
binds exactly this request before signing it. The one-call
StrataClient::execute_twapno longer needs it (one signature over the transaction). - validate_
twap_ prepare_ binding - Two-step path helper: check a prepared TWAP control preserved the signed challenge bindings.
Type Aliases§
- Platform
Maker Status Authorized Request - Detached external authorization for the owner-scoped maker status read.