pub async fn market_buy(&self, product: &str, size: f64) -> Result<Order> {
        let params = OrderRequest {
            product_id: product.into(),
            client_oid: None,
            side: OrderSide::Buy,
            _type: OrderRequestType::Market {
                _type: OrderRequestMarketType::Size { size },
            },
            stop: None,
        };

        println!("{:?}", params);

        let transaction = self.transport.signed_post("/orders", Some(&params)).await?;

        Ok(transaction)
    }
// TODO: refactor buy and sell in order creation in commun function
refactor buy and sell in order creation in commun function
refactor buy and sell in order creation in commun function
pub async fn market_buy(&self, product: &str, size: f64) -> Result<Order> {
        let params = OrderRequest {
            product_id: product.into(),
            client_oid: None,
            side: OrderSide::Buy,
            _type: OrderRequestType::Market {
                _type: OrderRequestMarketType::Size { size },
            },
            stop: None,
        };
        println!("{:?}", params);
        let transaction = self.transport.signed_post("/orders", Some(&params)).await?;
        Ok(transaction)
    }
pub async fn market_buy ( & self , product : & str , size : f64 ) -> Result < Order > { let params = OrderRequest { product_id : product . into ( ) , client_oid : None , side : OrderSide :: Buy , _type : OrderRequestType :: Market { _type : OrderRequestMarketType :: Size { size } , } , stop : None , } ; println ! ( " " params ) ; let transaction = self . transport . signed_post ( " " , Some ( & params ) ) . await ? ; Ok ( transaction ) }
TODO: refactor buy and sell in order creation in commun function
TODO : refactor buy and sell in order creation in commun function
&self
product
&str
size
f64
&self
product
&str
size
f64