View Source Hyperliquid.Api.Exchange.SubAccountTransfer (hyperliquid v0.2.2)

Transfer funds between main account and sub-account.

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint

Summary

Functions

Transfer funds between main account and sub-account.

Functions

Link to this function

request(sub_account_user, is_deposit, usd, opts \\ [])

View Source

Transfer funds between main account and sub-account.

Parameters

  • private_key: Private key for signing (hex string)
  • sub_account_user: Sub-account address
  • is_deposit: true for deposit to sub-account, false for withdrawal
  • usd: Amount in USD as integer (raw value)
  • opts: Optional parameters

Returns

  • {:ok, response} - Transfer result
  • {:error, term()} - Error details

Examples

{:ok, result} = SubAccountTransfer.request(private_key, "0x...", true, 1000000)