Transfer tokens between Ethereum mainnet and Relay using Hyperlane.
npm installnpx tsx index.ts withdraw <amount> <recipient> <privateKey> <rpcUrl>amount- Amount in weirecipient- Ethereum address to receive tokensprivateKey- Relay account private keyrpcUrl- Relay URL
npx tsx index.ts deposit <amount> <recipient> <privateKey> <rpcUrl>amount- Amount in ETH (e.g.,0.1)recipient- Relay address to receive tokensprivateKey- Ethereum account private keyrpcUrl- Ethereum RPC URL
Note: Transfer amounts are in ETH for deposits (EVM → Relay) but in wei for withdrawals (Relay → EVM).
To confirm a transfer completed, check your balance on Relay:
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["<address>"]}' <rpcUrl>/rpc
Note: This token ID is the gas token (bridged EVM mainnet token).
For withdrawals you can check your Ethereum balance using your preferred method (e.g., Etherscan, web3, etc.).