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

Transfer spot tokens between main account and sub-account.

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

Summary

Functions

Transfer spot tokens between main account and sub-account.

Functions

Link to this function

request(sub_account_user, is_deposit, token, amount, opts \\ [])

View Source

Transfer spot tokens 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
  • token: Token index
  • amount: Amount as string
  • opts: Optional parameters

Returns

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

Examples

{:ok, result} = SubAccountSpotTransfer.request(private_key, "0x...", true, 1, "100.0")