pub struct StrikeClient { /* private fields */ }Expand description
The main Strike SDK client.
Provides access to all protocol operations through typed sub-clients:
Implementations§
Source§impl StrikeClient
impl StrikeClient
Sourcepub fn new(config: StrikeConfig) -> StrikeClientBuilder
pub fn new(config: StrikeConfig) -> StrikeClientBuilder
Create a new client builder with the given config.
Sourcepub async fn init_nonce_sender(&mut self) -> Result<()>
pub async fn init_nonce_sender(&mut self) -> Result<()>
Initialize the shared nonce manager.
Call this once at startup before sending any transactions. All subsequent transaction sends (orders, vault approval, redemptions) will route through the NonceSender to avoid nonce collisions.
The nonce manager is shared across clones of this client via Arc.
Sourcepub fn nonce_sender(&self) -> NonceSenderRef
pub fn nonce_sender(&self) -> NonceSenderRef
Get a reference to the shared nonce sender, if initialized.
Sourcepub fn orders(&self) -> OrdersClient<'_>
pub fn orders(&self) -> OrdersClient<'_>
Order placement, cancellation, and replacement.
Sourcepub fn vault(&self) -> VaultClient<'_>
pub fn vault(&self) -> VaultClient<'_>
USDT vault approval and balance queries.
Sourcepub fn redeem(&self) -> RedeemClient<'_>
pub fn redeem(&self) -> RedeemClient<'_>
Outcome token redemption.
Sourcepub fn tokens(&self) -> TokensClient<'_>
pub fn tokens(&self) -> TokensClient<'_>
Outcome token balance and approval queries.
Sourcepub fn markets(&self) -> MarketsClient<'_>
pub fn markets(&self) -> MarketsClient<'_>
On-chain market metadata reads.
Sourcepub async fn events(&self) -> Result<EventStream>
pub async fn events(&self) -> Result<EventStream>
Subscribe to on-chain events via WSS with auto-reconnect.
Returns an EventStream that yields StrikeEvent items.
Sourcepub async fn scan_orders(
&self,
from_block: u64,
owner: Address,
) -> Result<HashMap<u64, (Vec<U256>, Vec<U256>)>>
pub async fn scan_orders( &self, from_block: u64, owner: Address, ) -> Result<HashMap<u64, (Vec<U256>, Vec<U256>)>>
Scan historical events from chain logs.
Finds orders placed by owner that haven’t been cancelled.
Sourcepub fn indexer(&self) -> IndexerClient
pub fn indexer(&self) -> IndexerClient
REST indexer client for startup snapshots.
Sourcepub async fn block_number(&self) -> Result<u64>
pub async fn block_number(&self) -> Result<u64>
Get the current block number.
Sourcepub fn signer_address(&self) -> Option<Address>
pub fn signer_address(&self) -> Option<Address>
The signer address, if a wallet is configured.
Sourcepub fn config(&self) -> &StrikeConfig
pub fn config(&self) -> &StrikeConfig
The active config.
Sourcepub fn provider(&self) -> &DynProvider
pub fn provider(&self) -> &DynProvider
The underlying provider (for advanced usage).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StrikeClient
impl !RefUnwindSafe for StrikeClient
impl Send for StrikeClient
impl Sync for StrikeClient
impl Unpin for StrikeClient
impl UnsafeUnpin for StrikeClient
impl !UnwindSafe for StrikeClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more