spot or perp balance
to HyperEVM using the HyperCore API.
Note: You can only withdraw USDC from HyperCore to the same address on
HyperEVM. It’s not possible to specify a different recipient address.
Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js v22+
- Prepared an EVM wallet with the private key available
-
Funded your HyperCore account with USDC in either
spotorperpbalance -
Created a new Node project and installed dependencies:
-
Created a
.envfile with required environment variables:
Steps
Use the following steps to withdraw USDC from HyperCore to HyperEVM.Step 1. Construct the sendAsset action
Create a sendAsset action object with the following parameters:
type:sendAssethyperliquidChain:Mainnet(orTestnetfor testnet)signatureChainId: An EVM chain ID used for EIP-712 replay protection. Must match between signing and the action payload, but can be any valid chain ID (for example,"0xa4b1"for Arbitrum)destination: The USDC token system address (0x2000000000000000000000000000000000000000)sourceDex:"spot"to withdraw from spot balance, or""for perp balancedestinationDex:"spot"token:USDCamount: The amount of USDC as a human-readable string (for example,"10"for 10 USDC)fromSubAccount: Set to""for main account, or the subaccount addressnonce: Current timestamp in milliseconds
TypeScript
Step 2. Sign the action using EIP-712
Sign the action using the EIP-712 typed data signing standard. The signature proves that you authorize this withdrawal. The signing domain should include:name:"HyperliquidSignTransaction"version:"1"chainId: The chain ID fromsignatureChainId(as a number)verifyingContract:"0x0000000000000000000000000000000000000000"
TypeScript
Step 3. Submit the signed action to the exchange API
Call the exchange endpoint with the action, nonce, and signature.TypeScript
Full example code
The following is a complete example of how to withdraw USDC from HyperCore to HyperEVM. By default, it withdraws 10 USDC from your perp balance to HyperEVM testnet.TypeScript