pub struct ExchangeClient {
pub http_client: HttpClient,
pub wallet: PrivateKeySigner,
pub meta: Meta,
pub vault_address: Option<Address>,
pub coin_to_asset: HashMap<String, u32>,
pub asset_id_offset: u32,
pub dex: String,
}Fields§
§http_client: HttpClient§wallet: PrivateKeySigner§meta: Meta§vault_address: Option<Address>§coin_to_asset: HashMap<String, u32>§asset_id_offset: u32§dex: StringImplementations§
Source§impl ExchangeClient
impl ExchangeClient
pub async fn new( client: Option<Client>, wallet: PrivateKeySigner, base_url: Option<BaseUrl>, meta: Option<Meta>, vault_address: Option<Address>, asset_id_offset: Option<u32>, dex: Option<String>, ) -> Result<ExchangeClient, Error>
pub async fn enable_big_blocks( &self, using_big_blocks: bool, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn usdc_transfer( &self, amount: &str, destination: &str, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn class_transfer( &self, usdc: f64, to_perp: bool, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn send_asset( &self, destination: &str, source_dex: &str, destination_dex: &str, token: &str, amount: f64, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn vault_transfer( &self, is_deposit: bool, usd: u64, vault_address: Option<Address>, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn market_open( &self, params: MarketOrderParams<'_>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn market_open_with_builder( &self, params: MarketOrderParams<'_>, builder: BuilderInfo, ) -> Result<ExchangeResponseStatus, Error>
pub async fn market_close( &self, params: MarketCloseParams<'_>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn order( &self, order: ClientOrderRequest, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn order_with_builder( &self, order: ClientOrderRequest, wallet: Option<&PrivateKeySigner>, builder: BuilderInfo, ) -> Result<ExchangeResponseStatus, Error>
pub async fn bulk_order( &self, orders: Vec<ClientOrderRequest>, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn bulk_order_with_builder( &self, orders: Vec<ClientOrderRequest>, wallet: Option<&PrivateKeySigner>, builder: BuilderInfo, ) -> Result<ExchangeResponseStatus, Error>
pub async fn cancel( &self, cancel: ClientCancelRequest, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn bulk_cancel( &self, cancels: Vec<ClientCancelRequest>, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn modify( &self, modify: ClientModifyRequest, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn bulk_modify( &self, modifies: Vec<ClientModifyRequest>, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn cancel_by_cloid( &self, cancel: ClientCancelRequestCloid, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn bulk_cancel_by_cloid( &self, cancels: Vec<ClientCancelRequestCloid>, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn update_leverage( &self, leverage: u32, coin: &str, is_cross: bool, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn update_isolated_margin( &self, amount: f64, coin: &str, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn approve_agent( &self, wallet: Option<&PrivateKeySigner>, ) -> Result<(B256, ExchangeResponseStatus), Error>
pub async fn withdraw_from_bridge( &self, amount: &str, destination: &str, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn spot_transfer( &self, amount: &str, destination: &str, token: &str, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn set_referrer( &self, code: String, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn approve_builder_fee( &self, builder: Address, max_fee_rate: String, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn schedule_cancel( &self, time: Option<u64>, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
pub async fn claim_rewards( &self, wallet: Option<&PrivateKeySigner>, ) -> Result<ExchangeResponseStatus, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExchangeClient
impl !RefUnwindSafe for ExchangeClient
impl Send for ExchangeClient
impl Sync for ExchangeClient
impl Unpin for ExchangeClient
impl !UnwindSafe for ExchangeClient
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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