encode_spot_send

Documentation for eth_defi.hyperliquid.core_writer.encode_spot_send function.

encode_spot_send(destination, token_id, amount_wei)

Encode a CoreWriter spotSend action (action ID 6).

Sends tokens from HyperCore spot to an address. Used to bridge tokens from Core back to EVM (destination = EVM address).

Parameters
  • destination (Union[eth_typing.evm.HexAddress, str]) – Recipient address (typically the Safe address for bridging back).

  • token_id (int) – HyperCore token index (0 = USDC).

  • amount_wei (int) – Amount in HyperCore wei (uint64).

Returns

Raw action bytes for CoreWriter.sendRawAction().

Return type

bytes