Skip to main content

Module http

Module http 

Source
Expand description

HTTP client for HyperCore API interactions.

This module provides the HTTP client for placing orders, querying balances, managing positions, and performing asset transfers on Hyperliquid.

§Examples

§Query User Balances

use hypersdk::hypercore;
use hypersdk::Address;

let client = hypercore::mainnet();
let user: Address = "0x...".parse()?;
let balances = client.user_balances(user).await?;

for balance in balances {
    println!("{}: {}", balance.coin, balance.total);
}

§Place Orders

use hypersdk::hypercore::{self, types::*, PrivateKeySigner};

let client = hypercore::mainnet();
let signer: PrivateKeySigner = "your_key".parse()?;

// Note: This example shows the structure but cannot run without
// the rust_decimal_macros::dec!() macro and chrono clock feature.
// In real usage, replace with actual decimal values and timestamp.

Structs§

Client
HTTP client for HyperCore API.
MultiSig
Builder for constructing and executing multisig transactions on Hyperliquid.