pub struct ExchangeClient {
    pub http_client: HttpClient,
    pub wallet: LocalWallet,
    pub meta: Meta,
    pub vault_address: Option<H160>,
    pub coin_to_asset: HashMap<String, u32>,
}

Fields§

§http_client: HttpClient§wallet: LocalWallet§meta: Meta§vault_address: Option<H160>§coin_to_asset: HashMap<String, u32>

Implementations§

source§

impl ExchangeClient

source

pub async fn new( client: Option<Client>, wallet: LocalWallet, base_url: Option<BaseUrl>, meta: Option<Meta>, vault_address: Option<H160> ) -> Result<ExchangeClient, Error>

source

pub async fn usdc_transfer( &self, amount: &str, destination: &str ) -> Result<ExchangeResponseStatus, Error>

source

pub async fn order( &self, order: ClientOrderRequest ) -> Result<ExchangeResponseStatus, Error>

source

pub async fn bulk_order( &self, orders: Vec<ClientOrderRequest> ) -> Result<ExchangeResponseStatus, Error>

source

pub async fn cancel( &self, cancel: ClientCancelRequest ) -> Result<ExchangeResponseStatus, Error>

source

pub async fn bulk_cancel( &self, cancels: Vec<ClientCancelRequest> ) -> Result<ExchangeResponseStatus, Error>

source

pub async fn update_leverage( &self, leverage: u32, coin: &str, is_cross: bool ) -> Result<ExchangeResponseStatus, Error>

source

pub async fn update_isolated_margin( &self, amount: f64, coin: &str ) -> Result<ExchangeResponseStatus, Error>

source

pub async fn approve_agent( &self ) -> Result<(String, ExchangeResponseStatus), Error>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more