Expand description
EIP-712 wallet for signing Hypercall operations.
Every write operation on Hypercall requires an EIP-712 signature. This module
provides HypercallWallet which wraps a private key and exposes typed
signing methods for each action type.
§Two Wallet Types
- Manager wallet: owns the account. Signs public Hypercall write
requests such as
set_margin_mode,place_order, andcancel_order.
§Example
use hypercall_client::{HypercallWallet, PlaceOrderSignature};
let wallet = HypercallWallet::from_private_key(
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
998,
)?;
println!("Address: {}", wallet.address);
// Sign an options order
let sig = wallet.sign_place_order_payload(PlaceOrderSignature {
wallet: wallet.address,
symbol: "BTC-20260501-76000-C",
side: "Buy",
size: "5",
price: "2000",
tif: "ioc",
route: hypercall_sdk_types::OrderRoute::BestExecution,
client_id: "order_1",
reduce_only: false,
nonce: wallet.next_nonce(),
}).await?;§Nonce Management
Nonces are seeded from epoch-ms at construction time and increment atomically.
Each next_nonce() call returns a unique value. Signed on-chain actions
require each (signer, nonce) pair to be used at most once.
Structs§
- AcceptRFQ
Quote - Account
Address - Hypercall account address used by the public client API.
- Atomic
Nonce Provider - Authorize
RfqRead V2 - Must match the RFQ service’s AuthorizeRfqReadV2 EIP-712 type exactly.
- Cancel
Order - Cancel
Order ByCloid - Cancel
Order ByOid - Cancel
Order Signature - Cancel
Pool Redemptions - Cancel queued PM lending pool share redemptions
(
POST /v1/pm-pool/redemptions/cancel).requestIdsis the id list, in request order, joined with,. - Connect
Quote Provider - HCUpdate
ApiWallet - HLCancel
- HLCancel
ByCloid - HLOrder
- HLSend
Asset - HLSet
Abstraction - Hypercall
Wallet - Wallet for signing Hypercall operations with EIP-712.
- Limit
Order - Perp
Cancel ByCloid Signature - Perp
Cancel ByOid Signature - Perp
Limit Order Signature - Place
Order - Place
Order Reduce Only - Place
Order Signature - Portfolio
Usdc Withdrawal Signature - Exact Portfolio Margin
HLSendAssetEIP-712 payload. - Redeem
Pool Shares - Queue a withdrawal of PM lending pool shares, paid to
wallet(POST /v1/pm-pool/redemptions). - Replace
Order - Replace
Order Reduce Only - Replace
Order Signature - Send
Asset - SetAbstraction
- SetAccount
Abstraction Signature - SetMargin
Mode - Standard
Margin Liquidation Order - Standard
Margin Liquidation Signature - Standard
Usdc Withdrawal Signature - Exact Standard Margin
WithdrawUsdcEIP-712 payload. - Submit
Auto Execute Rfq - SubmitRFQ
- SubmitRFQ
Response - Update
ApiWallet - Update
ApiWallet Signature - Withdraw
Usdc
Traits§
- ApiWallet
Directive Signer - Hypercall
Signer - Manager
Directive Signer - Nonce
Provider - Perp
Directive Signer - Usdc
Withdrawal Signer - Signs the two USDC withdrawal schemas without expanding existing signer traits.