hyperliquid-rs 0.1.0

A wrapper for the Hyperliquid API.
Documentation
<h1 align="center">
    📈 hyperliquid-sdk
</h1>
<h4 align="center">
A wrapper for the Hyperliquid API.
</h4>
<p align="center">
  <a href="https://github.com/0xhappyboy/trade-sdk/tree/main/hyperliquid-sdk/LICENSE"><img src="https://img.shields.io/badge/License-GPL3.0-d1d1f6.svg?style=flat&labelColor=1C2C2E&color=BEC5C9&logo=googledocs&label=license&logoColor=BEC5C9" alt="License"></a>
</p>
<p align="center">
<a href="./README_zh-CN.md">简体中文</a> | <a href="./README.md">English</a>
</p>

## Examples


### Client initialization


#### Method 1


```shell
# Set environment variables

export HYPERLIQUID_API_KEY=hyperliquid_api_key
export HYPERLIQUID_SECRET_KEY=
```

```rust
let api_key = env::var("HYPERLIQUID_API_KEY").unwrap_or_else(|_| "your api key".to_string());
let secret_key = env::var("HYPERLIQUID_SECRET_KEY").unwrap_or_else(|_| "your secret key".to_string());
let client = HyperliquidClient::new().auth(api_key, secret_key);
```

#### Method 2


```rust
let client = HyperliquidClient::new().auth("your api key".to_string(), "your secret key".to_string());
```

### Get price by symbol


```rust
let client = HyperliquidClient::new().auth("your api key".to_string(), "your secret key".to_string());
match client.get_price_by_symbol(symbol).await {
    Ok(price) => println!("{} current price: ${:.2}", symbol, price),
    Err(e) => println!("error: {}", e),
}
```