View Source Hyperliquid.Api.Exchange.AgentSendAsset (hyperliquid v0.3.0)
Transfer an asset between DEXs on behalf of a user, signed by an agent wallet.
The agent-signed counterpart to Hyperliquid.Api.Exchange.SendAsset. Because
it is signed as an L1 action rather than as EIP-712 typed data, an API wallet
can perform the transfer without the master key.
Use "" for the main perps DEX and "spot" for the spot account.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint
Usage
{:ok, result} = AgentSendAsset.request("0xabc...", "", "spot", "USDC", "100")
Summary
Functions
Transfer an asset between DEXs.
Functions
Link to this function
request(destination, source_dex, destination_dex, token, amount, opts \\ [])
View Source@spec request(String.t(), String.t(), String.t(), String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, term()}
Transfer an asset between DEXs.
Parameters
destination: Destination addresssource_dex: Source DEX (""for main perps,"spot"for spot)destination_dex: Destination DEXtoken: Token nameamount: Amount as a decimal stringopts: Optional parameters
Options
:private_key- Private key for signing (falls back to config):from_sub_account- Sub-account address to send from (default:""):vault_address- Act on behalf of a vault
Returns
{:ok, response}- Transfer result{:error, term()}- Error details
Examples
{:ok, result} = AgentSendAsset.request("0xabc...", "", "spot", "USDC", "100")