<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
```
#### 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),
}
```