pub async fn market_buy(&self, symbol: &str, qty: f64) -> Result<Transaction> {
        let buy: OrderRequest = OrderRequest {
            symbol: symbol.into(),
            qty: qty,
            price: 0.0,
            order_side: ORDER_SIDE_BUY.to_string(),
            order_type: ORDER_TYPE_MARKET.to_string(),
            time_in_force: TIME_IN_FORCE_GTC.to_string(),
        };
        let params = self.build_order(buy);
        let transaction = self
            .transport
            .signed_post(API_V3_ORDER, Some(&params))
            .await?;

        Ok(transaction)
    }
// Place a MARKET order - BUY
Place a MARKET order - BUY
Place a MARKET order - BUY
pub async fn market_buy(&self, symbol: &str, qty: f64) -> Result<Transaction> {
        let buy: OrderRequest = OrderRequest {
            symbol: symbol.into(),
            qty: qty,
            price: 0.0,
            order_side: ORDER_SIDE_BUY.to_string(),
            order_type: ORDER_TYPE_MARKET.to_string(),
            time_in_force: TIME_IN_FORCE_GTC.to_string(),
        };
        let params = self.build_order(buy);
        let transaction = self
            .transport
            .signed_post(API_V3_ORDER, Some(&params))
            .await?;
        Ok(transaction)
    }
pub async fn market_buy ( & self , symbol : & str , qty : f64 ) -> Result < Transaction > { let buy : OrderRequest = OrderRequest { symbol : symbol . into ( ) , qty : qty , price : 0.0 , order_side : ORDER_SIDE_BUY . to_string ( ) , order_type : ORDER_TYPE_MARKET . to_string ( ) , time_in_force : TIME_IN_FORCE_GTC . to_string ( ) , } ; let params = self . build_order ( buy ) ; let transaction = self . transport . signed_post ( API_V3_ORDER , Some ( & params ) ) . await ? ; Ok ( transaction ) }
Place a MARKET order - BUY
Place a MARKET order - BUY
&self
symbol
&str
qty
f64
&self
symbol
&str
qty
f64