pub struct StrataClient { /* private fields */ }Implementations§
Source§impl StrataClient
impl StrataClient
pub fn production() -> Result<Self, SdkError>
pub fn new(base_url: impl AsRef<str>) -> Result<Self, SdkError>
pub fn with_timeout( base_url: impl AsRef<str>, timeout: Duration, ) -> Result<Self, SdkError>
Sourcepub async fn connect_order_commands<S: SessionSigner + ?Sized>(
&self,
market_id: &str,
owner_wallet: &str,
signer: &S,
) -> Result<OrderCommandStream, SdkError>
pub async fn connect_order_commands<S: SessionSigner + ?Sized>( &self, market_id: &str, owner_wallet: &str, signer: &S, ) -> Result<OrderCommandStream, SdkError>
Open one authenticated, persistent order-command connection. The external session signer is used for authentication and is not retained.
Sourcepub async fn connect_market_data(
&self,
market_id: &str,
) -> Result<MarketDataStream, SdkError>
pub async fn connect_market_data( &self, market_id: &str, ) -> Result<MarketDataStream, SdkError>
Open the sequenced Strata market-data stream. A sequence gap fails closed so the caller can reconnect and recover from a new snapshot.
Sourcepub async fn connect_executions(
&self,
market_id: &str,
execution_ids: &[String],
) -> Result<ExecutionStream, SdkError>
pub async fn connect_executions( &self, market_id: &str, execution_ids: &[String], ) -> Result<ExecutionStream, SdkError>
Open the sequenced execution stream for one market, watching the opaque
handles issued by execution.prepare. It begins with a snapshot; a gap
fails closed so the caller reconnects and recovers.
Sourcepub async fn connect_twaps(
&self,
market_id: &str,
wallet_address: &str,
) -> Result<TwapStream, SdkError>
pub async fn connect_twaps( &self, market_id: &str, wallet_address: &str, ) -> Result<TwapStream, SdkError>
Open the sequenced TWAP progress stream for a wallet in one market. It begins with a snapshot and then delivers one complete sanitized TWAP row per change; a gap fails closed so the caller reconnects and recovers.
Sourcepub async fn connect_maker_for_wallet(
&self,
market_id: &str,
wallet_address: &str,
) -> Result<MakerStream, SdkError>
pub async fn connect_maker_for_wallet( &self, market_id: &str, wallet_address: &str, ) -> Result<MakerStream, SdkError>
Open the maker stream for one market by wallet address — public, no signature: a maker snapshot followed by sequenced maker fills, product/exposure changes, and heartbeats.
Sourcepub async fn connect_maker<S: AccountSigner + ?Sized>(
&self,
market_id: &str,
signer: &S,
) -> Result<MakerStream, SdkError>
pub async fn connect_maker<S: AccountSigner + ?Sized>( &self, market_id: &str, signer: &S, ) -> Result<MakerStream, SdkError>
Same stream, addressed by a signer’s public key; the server’s compatibility challenge is answered with the signer’s signature.
Sourcepub async fn connect_account<S: AccountSigner + ?Sized>(
&self,
market_id: &str,
signer: &S,
) -> Result<AccountStream, SdkError>
pub async fn connect_account<S: AccountSigner + ?Sized>( &self, market_id: &str, signer: &S, ) -> Result<AccountStream, SdkError>
Open one externally authenticated private account stream. The signer is used only for the server challenge and is not retained by the SDK.
Sourcepub async fn platform_capabilities(
&self,
) -> Result<PlatformDiscoveryResponse, SdkError>
pub async fn platform_capabilities( &self, ) -> Result<PlatformDiscoveryResponse, SdkError>
Read the operations currently enabled through the public 2.0 product contract. This response contains product capabilities only.
Sourcepub async fn platform_action_graph(
&self,
) -> Result<PlatformActionGraphResponse, SdkError>
pub async fn platform_action_graph( &self, ) -> Result<PlatformActionGraphResponse, SdkError>
Read the complete customer-safe entity, operation, and workflow graph projected against the capabilities that are live now.
Sourcepub async fn platform_status(
&self,
) -> Result<PlatformServiceStatusResponse, SdkError>
pub async fn platform_status( &self, ) -> Result<PlatformServiceStatusResponse, SdkError>
Read product-level readiness without exposing internal services.
pub async fn platform_assets( &self, request: PageRequest, ) -> Result<PlatformAssetsResponse, SdkError>
Sourcepub async fn platform_swap_quote(
&self,
request: PlatformSwapQuoteRequest,
) -> Result<PlatformSwapQuoteResponse, SdkError>
pub async fn platform_swap_quote( &self, request: PlatformSwapQuoteRequest, ) -> Result<PlatformSwapQuoteResponse, SdkError>
Request a short-lived exact-input quote between two assets returned by
Self::platform_assets.
pub async fn platform_markets( &self, request: PageRequest, ) -> Result<PlatformMarketsResponse, SdkError>
pub async fn platform_book( &self, market_id: &str, request: PlatformBookRequest, ) -> Result<PlatformBookSnapshotResponse, SdkError>
pub async fn platform_best_bid_ask( &self, market_id: &str, ) -> Result<PlatformBestBidAskResponse, SdkError>
pub async fn platform_fees( &self, market_id: &str, ) -> Result<PlatformFeeScheduleResponse, SdkError>
pub async fn platform_market_status( &self, market_id: &str, ) -> Result<PlatformMarketStatusResponse, SdkError>
pub async fn platform_trades( &self, market_id: &str, request: PlatformTradesRequest, ) -> Result<PlatformTradesResponse, SdkError>
pub async fn platform_candles( &self, market_id: &str, request: PlatformCandlesRequest, ) -> Result<PlatformCandlesResponse, SdkError>
pub async fn platform_mark( &self, market_id: &str, ) -> Result<PlatformMarkResponse, SdkError>
pub async fn platform_execution_status( &self, market_id: &str, execution_id: &str, ) -> Result<PlatformExecutionStatusResponse, SdkError>
pub async fn platform_twaps( &self, market_id: &str, wallet_address: &str, ) -> Result<PlatformTwapsResponse, SdkError>
Sourcepub async fn platform_portfolio(
&self,
wallet_address: &str,
) -> Result<PlatformPortfolioResponse, SdkError>
pub async fn platform_portfolio( &self, wallet_address: &str, ) -> Result<PlatformPortfolioResponse, SdkError>
The whole account in one public read, by wallet address: balances
(total / available / locked, exact USD), positions, open orders, and
recent fills across every live market. No signature, no session key,
no market selection. platform_account is the same read.
Sourcepub async fn platform_account(
&self,
wallet_address: &str,
) -> Result<PlatformPortfolioResponse, SdkError>
pub async fn platform_account( &self, wallet_address: &str, ) -> Result<PlatformPortfolioResponse, SdkError>
Alias of platform_portfolio: the whole account in one public read.
pub async fn platform_portfolio_history( &self, wallet_address: &str, range: PlatformPortfolioHistoryRange, ) -> Result<PlatformPortfolioHistoryResponse, SdkError>
Sourcepub async fn platform_vault_status(
&self,
wallet_address: &str,
request: PlatformVaultStatusRequest,
) -> Result<PlatformVaultStatusResponse, SdkError>
pub async fn platform_vault_status( &self, wallet_address: &str, request: PlatformVaultStatusRequest, ) -> Result<PlatformVaultStatusResponse, SdkError>
Read sealed Vault owner state and, optionally, one external session.
Sourcepub async fn platform_vault_pause_prepare(
&self,
request: PlatformVaultPausePrepareRequest,
) -> Result<PlatformVaultPausePrepareResponse, SdkError>
pub async fn platform_vault_pause_prepare( &self, request: PlatformVaultPausePrepareRequest, ) -> Result<PlatformVaultPausePrepareResponse, SdkError>
Prepare an owner-authorized Vault pause or resume transaction. The external owner verifies, signs, and broadcasts the returned bytes.
Sourcepub async fn platform_vault_setup_prepare(
&self,
request: PlatformVaultSetupPrepareRequest,
) -> Result<PlatformVaultSetupPrepareResponse, SdkError>
pub async fn platform_vault_setup_prepare( &self, request: PlatformVaultSetupPrepareRequest, ) -> Result<PlatformVaultSetupPrepareResponse, SdkError>
Prepare one-signature Vault onboarding (or a further session) for external owner verification, signing, and broadcast. Only the wallet and the session key are required; the policy fields are optional and take the product defaults when absent.
Sourcepub async fn platform_vault_delegate_prepare(
&self,
request: PlatformVaultDelegatePrepareRequest,
) -> Result<PlatformVaultDelegatePrepareResponse, SdkError>
pub async fn platform_vault_delegate_prepare( &self, request: PlatformVaultDelegatePrepareRequest, ) -> Result<PlatformVaultDelegatePrepareResponse, SdkError>
Prepare owner-authorized revocation of one external Vault session. The SDK never signs or broadcasts this destructive action.
Sourcepub async fn platform_vault_policy_prepare(
&self,
request: PlatformVaultPolicyPrepareRequest,
) -> Result<PlatformVaultPolicyPrepareResponse, SdkError>
pub async fn platform_vault_policy_prepare( &self, request: PlatformVaultPolicyPrepareRequest, ) -> Result<PlatformVaultPolicyPrepareResponse, SdkError>
Prepare blocked or restricted Vault withdrawal access. The external owner verifies, signs, and broadcasts the returned transaction.
Sourcepub async fn platform_vault_deposit_prepare(
&self,
request: PlatformVaultDepositPrepareRequest,
) -> Result<PlatformVaultDepositPrepareResponse, SdkError>
pub async fn platform_vault_deposit_prepare( &self, request: PlatformVaultDepositPrepareRequest, ) -> Result<PlatformVaultDepositPrepareResponse, SdkError>
Prepare an exact owner-funded Vault deposit. With session_public_key
set, a first deposit also registers that session in the same
transaction (one owner signature onboards and funds the wallet). The
SDK validates the echoed product intent and leaves signing and
broadcast external.
Sourcepub async fn platform_vault_withdraw_prepare(
&self,
request: PlatformVaultWithdrawPrepareRequest,
) -> Result<PlatformVaultWithdrawPrepareResponse, SdkError>
pub async fn platform_vault_withdraw_prepare( &self, request: PlatformVaultWithdrawPrepareRequest, ) -> Result<PlatformVaultWithdrawPrepareResponse, SdkError>
Prepare an exact owner-authorized Vault withdrawal to one destination wallet. Signing and broadcast remain external.
Sourcepub async fn platform_vault_submit(
&self,
request: PlatformVaultSubmitRequest,
) -> Result<PlatformVaultSubmitResponse, SdkError>
pub async fn platform_vault_submit( &self, request: PlatformVaultSubmitRequest, ) -> Result<PlatformVaultSubmitResponse, SdkError>
Submit an owner-signed prepared Vault transaction. Strata verifies it is
exactly the prepared transaction, pays the fee (and any rent) when the
preparation was sponsored, and broadcasts it. Idempotent per
idempotency_key; read the outcome with platform_vault_submission.
Sourcepub async fn platform_vault_submission(
&self,
preparation_id: &str,
) -> Result<PlatformVaultSubmitResponse, SdkError>
pub async fn platform_vault_submission( &self, preparation_id: &str, ) -> Result<PlatformVaultSubmitResponse, SdkError>
Durable outcome of a Vault submission (submitted → confirmed | failed).
pub async fn platform_rewards( &self, request: PlatformRewardsRequest, ) -> Result<PlatformRewardsResponse, SdkError>
pub async fn platform_referrals( &self, wallet_address: &str, ) -> Result<PlatformReferralsResponse, SdkError>
pub async fn platform_referral_link( &self, request: PlatformReferralLinkRequest, ) -> Result<PlatformReferralLinkResponse, SdkError>
pub async fn platform_referral_claim( &self, request: PlatformReferralClaimRequest, ) -> Result<PlatformReferralClaimResponse, SdkError>
pub async fn platform_bugs( &self, wallet_address: &str, ) -> Result<PlatformBugsResponse, SdkError>
pub async fn platform_bug_submit( &self, request: PlatformBugSubmitRequest, ) -> Result<PlatformBugSubmitResponse, SdkError>
Sourcepub async fn platform_account_market<S: AccountSigner + ?Sized>(
&self,
market_id: &str,
signer: &S,
request: PlatformAccountMarketRequest,
) -> Result<PlatformAccountSnapshotResponse, SdkError>
pub async fn platform_account_market<S: AccountSigner + ?Sized>( &self, market_id: &str, signer: &S, request: PlatformAccountMarketRequest, ) -> Result<PlatformAccountSnapshotResponse, SdkError>
Read one market’s private account state after proving wallet control. The wallet signs an exact, server-time-bound read message outside Strata.
Sourcepub async fn platform_account_snapshot<S: AccountSigner + ?Sized>(
&self,
signer: &S,
request: PlatformAccountRequest,
) -> Result<PlatformAccountSnapshot, SdkError>
pub async fn platform_account_snapshot<S: AccountSigner + ?Sized>( &self, signer: &S, request: PlatformAccountRequest, ) -> Result<PlatformAccountSnapshot, SdkError>
Read private order and fill state across selected markets, or across
every currently discoverable market when market_ids is omitted.
Sourcepub async fn platform_maker_status_for_wallet(
&self,
market_id: &str,
wallet_address: &str,
) -> Result<PlatformMakerStatusResponse, SdkError>
pub async fn platform_maker_status_for_wallet( &self, market_id: &str, wallet_address: &str, ) -> Result<PlatformMakerStatusResponse, SdkError>
A maker’s products, exposure, health, and kill state in one market — public by wallet address, no signature.
Sourcepub async fn platform_maker_status<S: AccountSigner + ?Sized>(
&self,
market_id: &str,
signer: &S,
) -> Result<PlatformMakerStatusResponse, SdkError>
pub async fn platform_maker_status<S: AccountSigner + ?Sized>( &self, market_id: &str, signer: &S, ) -> Result<PlatformMakerStatusResponse, SdkError>
Same read, addressed by a signer’s public key. Reads are public, so the signer is never asked to sign; kept so existing callers keep compiling.
Submit a detached external signature for the maker status read. Reads are public now; a signed request is still accepted (deprecated path).
Sourcepub async fn platform_maker_reputation_for_wallet(
&self,
market_id: &str,
wallet_address: &str,
) -> Result<PlatformMakerReputationResponse, SdkError>
pub async fn platform_maker_reputation_for_wallet( &self, market_id: &str, wallet_address: &str, ) -> Result<PlatformMakerReputationResponse, SdkError>
A maker’s reliability record in one market — public by wallet address, no signature.
Sourcepub async fn platform_maker_reputation<S: AccountSigner + ?Sized>(
&self,
market_id: &str,
signer: &S,
) -> Result<PlatformMakerReputationResponse, SdkError>
pub async fn platform_maker_reputation<S: AccountSigner + ?Sized>( &self, market_id: &str, signer: &S, ) -> Result<PlatformMakerReputationResponse, SdkError>
Same read, addressed by a signer’s public key; the signer is never asked to sign (reads are public). Kept so existing callers keep compiling.
Submit a detached external signature. Reads are public now; a signed request is still accepted (deprecated path).
Sourcepub async fn platform_maker_strand_prepare(
&self,
market_id: &str,
request: PlatformMakerStrandPrepareRequest,
) -> Result<PlatformMakerControlPrepareResponse, SdkError>
pub async fn platform_maker_strand_prepare( &self, market_id: &str, request: PlatformMakerStrandPrepareRequest, ) -> Result<PlatformMakerControlPrepareResponse, SdkError>
Prepare one exact maker-signed Strand transaction. Strata never sees the maker’s private key and the returned packet has one signature slot.
Sourcepub async fn platform_maker_current_prepare(
&self,
market_id: &str,
request: PlatformMakerCurrentPrepareRequest,
) -> Result<PlatformMakerControlPrepareResponse, SdkError>
pub async fn platform_maker_current_prepare( &self, market_id: &str, request: PlatformMakerCurrentPrepareRequest, ) -> Result<PlatformMakerControlPrepareResponse, SdkError>
Prepare one exact maker-signed Current transaction. Upsert fails closed when the market has no verified on-chain reference; cancel stays usable.
pub async fn platform_maker_strand_submit( &self, market_id: &str, request: PlatformMakerControlSubmitRequest, ) -> Result<PlatformMakerControlSubmitResponse, SdkError>
pub async fn platform_maker_current_submit( &self, market_id: &str, request: PlatformMakerControlSubmitRequest, ) -> Result<PlatformMakerControlSubmitResponse, SdkError>
pub async fn capabilities(&self) -> Result<CapabilityCatalog, SdkError>
Sourcepub async fn action_graph(&self) -> Result<ActionGraph, SdkError>
pub async fn action_graph(&self) -> Result<ActionGraph, SdkError>
Return the live operation topology, including capability-gated nodes and the points where the agent owner’s signer acts outside Strata.
pub async fn markets(&self) -> Result<MarketsResponse, SdkError>
Sourcepub async fn quote(
&self,
request: QuoteRequest,
) -> Result<QuoteResponse, SdkError>
pub async fn quote( &self, request: QuoteRequest, ) -> Result<QuoteResponse, SdkError>
Request a short-lived Sonar quote by human market label or market ID.
Give exactly one of amount_in_atoms (spend this much) or
amount_out_atoms (receive this much; Strata resolves the input).
maximum_tolerance_bps is the most you accept below the quoted output
(default 0); it is your choice and unrelated to the measured
price_impact_pct the response reports.
Sourcepub async fn execution_challenge(
&self,
market: &str,
request: ExecutionChallengeRequest,
) -> Result<ExecutionChallengeResponse, SdkError>
pub async fn execution_challenge( &self, market: &str, request: ExecutionChallengeRequest, ) -> Result<ExecutionChallengeResponse, SdkError>
Request canonical authorization bytes for an external signer. This operation accepts public identity only; signing material stays external.
Sourcepub async fn execution_prepare(
&self,
market: &str,
request: ExecutionPrepareRequest,
) -> Result<ExecutionPrepareResponse, SdkError>
pub async fn execution_prepare( &self, market: &str, request: ExecutionPrepareRequest, ) -> Result<ExecutionPrepareResponse, SdkError>
Prepare a quote-bound, partially signed transaction: either exchange
an external authorization signature (Authorized, two-step path) or
bind the quote directly (Direct, one signature — the session’s
transaction signature is the authorization).
Sourcepub async fn execution_submit(
&self,
market: &str,
request: ExecutionSubmitRequest,
) -> Result<ExecutionSubmitResponse, SdkError>
pub async fn execution_submit( &self, market: &str, request: ExecutionSubmitRequest, ) -> Result<ExecutionSubmitResponse, SdkError>
Submit an externally signed transaction. Reusing the same idempotency key cannot create a second execution.
Sourcepub async fn order_challenge(
&self,
market_id: &str,
request: PlatformOrderChallengeRequest,
) -> Result<PlatformOrderChallengeResponse, SdkError>
pub async fn order_challenge( &self, market_id: &str, request: PlatformOrderChallengeRequest, ) -> Result<PlatformOrderChallengeResponse, SdkError>
Request exact authorization bytes for one product-level resting-order operation. Private key material never enters this client or Strata.
Sourcepub async fn order_prepare(
&self,
market_id: &str,
request: PlatformOrderPrepareRequest,
) -> Result<PlatformOrderPrepareResponse, SdkError>
pub async fn order_prepare( &self, market_id: &str, request: PlatformOrderPrepareRequest, ) -> Result<PlatformOrderPrepareResponse, SdkError>
Prepare a backend-partially-signed v0 order-control transaction:
either hand back a signed challenge (Authorized, two-step path) or
send the operation itself (Direct, one signature — Strata builds the
transaction from the operation and the session’s signature over that
transaction is the whole authorization).
Sourcepub async fn order_submit(
&self,
market_id: &str,
request: PlatformOrderSubmitRequest,
) -> Result<PlatformOrderSubmitResponse, SdkError>
pub async fn order_submit( &self, market_id: &str, request: PlatformOrderSubmitRequest, ) -> Result<PlatformOrderSubmitResponse, SdkError>
Submit an externally signed order-control transaction. The same control ID and idempotency key return the same receipt.
Sourcepub async fn order_status(
&self,
market_id: &str,
request: PlatformOrderStatusRequest,
) -> Result<PlatformOrderStatusResponse, SdkError>
pub async fn order_status( &self, market_id: &str, request: PlatformOrderStatusRequest, ) -> Result<PlatformOrderStatusResponse, SdkError>
Recover the durable result for a prior submission. The same opaque control ID and idempotency key are required, so status polling never broadens authority beyond the original external submission.
Sourcepub async fn twap_challenge(
&self,
market_id: &str,
request: PlatformTwapChallengeRequest,
) -> Result<PlatformTwapChallengeResponse, SdkError>
pub async fn twap_challenge( &self, market_id: &str, request: PlatformTwapChallengeRequest, ) -> Result<PlatformTwapChallengeResponse, SdkError>
Request exact authorization bytes for one bounded TWAP placement or cancellation. The session private key remains outside Strata.
Sourcepub async fn twap_prepare(
&self,
market_id: &str,
request: PlatformTwapPrepareRequest,
) -> Result<PlatformTwapPrepareResponse, SdkError>
pub async fn twap_prepare( &self, market_id: &str, request: PlatformTwapPrepareRequest, ) -> Result<PlatformTwapPrepareResponse, SdkError>
Prepare a backend-partially-signed TWAP-control transaction that the
external session must verify: either the exact detached TWAP
authorization (Authorized, two-step path) or the action itself
(Direct, one signature — the transaction signature is the
authorization).
Sourcepub async fn twap_submit(
&self,
market_id: &str,
request: PlatformTwapSubmitRequest,
) -> Result<PlatformTwapSubmitResponse, SdkError>
pub async fn twap_submit( &self, market_id: &str, request: PlatformTwapSubmitRequest, ) -> Result<PlatformTwapSubmitResponse, SdkError>
Submit one externally signed TWAP transaction idempotently.
Sourcepub async fn execute_twap<S, V>(
&self,
market_id: &str,
operation: &TwapExecuteOperation,
signer: &S,
verifier: &V,
idempotency_key: Option<&str>,
) -> Result<PlatformTwapSubmitResponse, SdkError>
pub async fn execute_twap<S, V>( &self, market_id: &str, operation: &TwapExecuteOperation, signer: &S, verifier: &V, idempotency_key: Option<&str>, ) -> Result<PlatformTwapSubmitResponse, SdkError>
Complete the externally signed TWAP flow with one signature: the
action is bound and built in one step (direct prepare), the prepared
bindings are checked against the request, the mandatory verifier runs
(see DefaultTransactionVerifier), and only then is the session’s
transaction signature requested. SessionSigner::sign_message is not
called on this path.
Sourcepub async fn execute_order<S, V>(
&self,
market_id: &str,
operation: &OrderExecuteOperation,
signer: &S,
verifier: &V,
idempotency_key: Option<&str>,
) -> Result<PlatformOrderSubmitResponse, SdkError>
pub async fn execute_order<S, V>( &self, market_id: &str, operation: &OrderExecuteOperation, signer: &S, verifier: &V, idempotency_key: Option<&str>, ) -> Result<PlatformOrderSubmitResponse, SdkError>
Execute one resting-order operation with one signature while all
private keys and signing policy remain in the caller’s signer adapter.
The operation is bound and built in one step (direct prepare), the
prepared bindings are checked against the request, and the mandatory
verifier (see DefaultTransactionVerifier, which decodes the
transaction and requires it to be exactly this operation) runs before
the transaction signature is requested. SessionSigner::sign_message
is not called on this path.
Sourcepub async fn execute_quote<S, V>(
&self,
quote: &QuoteResponse,
owner_wallet: &str,
account_sequence: Option<u64>,
signer: &S,
verifier: &V,
idempotency_key: Option<&str>,
) -> Result<ExecutionSubmitResponse, SdkError>
pub async fn execute_quote<S, V>( &self, quote: &QuoteResponse, owner_wallet: &str, account_sequence: Option<u64>, signer: &S, verifier: &V, idempotency_key: Option<&str>, ) -> Result<ExecutionSubmitResponse, SdkError>
Execute one short-lived Sonar quote with one signature, without giving
the SDK custody of a session private key. The quote is bound and built
in one step (direct prepare), the prepared bindings are checked against
the quote, and the transaction verifier (see
DefaultTransactionVerifier) always runs before the session adapter
is allowed to sign. SessionSigner::sign_message is not called on this
path.
Trait Implementations§
Source§impl Clone for StrataClient
impl Clone for StrataClient
Source§fn clone(&self) -> StrataClient
fn clone(&self) -> StrataClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more