pub struct Client { /* private fields */ }Expand description
Top-level convenience bundle.
Holds a single RestClient and a base URL re-used to construct WS
clients on demand. The fields are owned and Cloneable cheaply so a
long-lived Client instance is the recommended pattern.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn submit_gas_auction_bid(
&self,
wallet: &Wallet,
bid: AuctionBid,
) -> Result<BidReceipt, ClientError>
pub async fn submit_gas_auction_bid( &self, wallet: &Wallet, bid: AuctionBid, ) -> Result<BidReceipt, ClientError>
Submit a bid for the current gas auction round.
The wallet signs an EIP-712 submit_gas_auction_bid action; the
gateway verifies the signer matches the bidder field (set internally
by the SDK to wallet.address()).
§Errors
ClientError::Http/ClientError::ProtocolErroron transport.ClientError::Signatureon signing failure.
Sourcepub async fn check_deploy_credit(
&self,
address: Address,
) -> Result<u32, ClientError>
pub async fn check_deploy_credit( &self, address: Address, ) -> Result<u32, ClientError>
Query the L1 for address’s outstanding deploy credits.
Returns the count of pending credits — 0 means “no credit yet
awarded”, non-zero means “you may run a deploy sequence”.
§Errors
HTTP / decode / protocol errors per ClientError.
Sourcepub async fn await_deploy_credit(
&self,
wallet: &Wallet,
max_wait: Duration,
) -> Result<(), ClientError>
pub async fn await_deploy_credit( &self, wallet: &Wallet, max_wait: Duration, ) -> Result<(), ClientError>
Block (async-sleep) until wallet’s address has at least one pending
deploy credit, or max_wait elapses.
Uses exponential backoff capped at 5 seconds. max_wait must be
Some(d) — there is intentionally no infinite-wait variant; long-
running auctions are caller’s job to compose.
§Errors
ClientError::Validationifmax_wait≤Duration::ZEROor if the wait elapses without seeing a credit.- Bubbles up
Client::check_deploy_crediterrors.
Source§impl Client
impl Client
Sourcepub fn new(base_url: impl Into<String>) -> Result<Self, ClientError>
pub fn new(base_url: impl Into<String>) -> Result<Self, ClientError>
Build a client targeting the given base URL.
base_url should be of the form https://devnet-gateway.mtf.exchange (no trailing
path). The REST client will append /info, /exchange, etc.; the WS
client derives a wss:// URL from this base.
§Errors
Returns ClientError::Builder if the URL is malformed or the
underlying reqwest::Client cannot be constructed.
Sourcepub fn rest(&self) -> &RestClient
pub fn rest(&self) -> &RestClient
Access the REST sub-client.