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

Transfer USD between spot and perp accounts.

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

Summary

Functions

Transfer USD between spot and perp accounts.

Functions

Link to this function

request(amount, to_perp, opts \\ [])

View Source

Transfer USD between spot and perp accounts.

Parameters

  • private_key: Private key for signing (hex string)
  • amount: Amount to transfer as string
  • to_perp: true to transfer to perp, false to transfer to spot
  • opts: Optional parameters

Options

  • :vault_address - Transfer for a vault

Returns

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

Examples

# Transfer to perp
{:ok, result} = UsdClassTransfer.request(private_key, "100.0", true)

# Transfer to spot
{:ok, result} = UsdClassTransfer.request(private_key, "100.0", false)