encode_transfer_usd_class

Documentation for eth_defi.hyperliquid.core_writer.encode_transfer_usd_class function.

encode_transfer_usd_class(amount_wei, to_perp)

Encode a CoreWriter transferUsdClass action (action ID 7).

Moves USDC between spot and perp accounts on HyperCore.

Parameters
  • amount_wei (int) – USDC amount in HyperCore wei (uint64).

  • to_perp (bool) – True to move from spot to perp, False for perp to spot.

Returns

Raw action bytes for CoreWriter.sendRawAction().

Return type

bytes