pub struct HyperliquidClient { /* private fields */ }Implementations§
Source§impl HyperliquidClient
impl HyperliquidClient
pub fn new() -> Result<Self, String>
pub fn auth(self, api_key: String, secret_key: String) -> Self
Sourcepub async fn place_limit_order(
&self,
symbol: &str,
side: Side,
size: f64,
price: f64,
reduce_only: bool,
) -> Result<OrderStatusResponse, ()>
pub async fn place_limit_order( &self, symbol: &str, side: Side, size: f64, price: f64, reduce_only: bool, ) -> Result<OrderStatusResponse, ()>
limit order
Sourcepub async fn place_current_market_price_order(
&self,
symbol: &str,
side: Side,
size: f64,
reduce_only: bool,
) -> Result<OrderStatusResponse, ()>
pub async fn place_current_market_price_order( &self, symbol: &str, side: Side, size: f64, reduce_only: bool, ) -> Result<OrderStatusResponse, ()>
current market price order
Sourcepub async fn open_long_position(
&self,
symbol: &str,
size: f64,
price: f64,
order_type: OrderType,
) -> Result<OrderStatusResponse, ()>
pub async fn open_long_position( &self, symbol: &str, size: f64, price: f64, order_type: OrderType, ) -> Result<OrderStatusResponse, ()>
open long position
Sourcepub async fn open_short_position(
&self,
symbol: &str,
size: f64,
price: f64,
order_type: OrderType,
) -> Result<OrderStatusResponse, ()>
pub async fn open_short_position( &self, symbol: &str, size: f64, price: f64, order_type: OrderType, ) -> Result<OrderStatusResponse, ()>
open short position
Sourcepub async fn get_account_info(&self) -> Result<AccountInfo, ()>
pub async fn get_account_info(&self) -> Result<AccountInfo, ()>
get current account information
Sourcepub async fn get_positions(&self) -> Result<Vec<AssetPosition>, ()>
pub async fn get_positions(&self) -> Result<Vec<AssetPosition>, ()>
get the current position
Sourcepub async fn cancel_order(
&self,
order_id: u64,
) -> Result<OrderStatusResponse, ()>
pub async fn cancel_order( &self, order_id: u64, ) -> Result<OrderStatusResponse, ()>
cancel order
Sourcepub async fn modify_order(
&self,
order_id: u64,
new_size: Option<f64>,
new_price: Option<f64>,
) -> Result<OrderStatusResponse, ()>
pub async fn modify_order( &self, order_id: u64, new_size: Option<f64>, new_price: Option<f64>, ) -> Result<OrderStatusResponse, ()>
modify order
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HyperliquidClient
impl !RefUnwindSafe for HyperliquidClient
impl Send for HyperliquidClient
impl Sync for HyperliquidClient
impl Unpin for HyperliquidClient
impl !UnwindSafe for HyperliquidClient
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