Skip to content

Sovereign-Labs/relay-hyperlane-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relay Hyperlane Example

Transfer tokens between Ethereum mainnet and Relay using Hyperlane.

Install

npm install

Withdraw (Relay → Ethereum)

npx tsx index.ts withdraw <amount> <recipient> <privateKey> <rpcUrl>
  • amount - Amount in wei
  • recipient - Ethereum address to receive tokens
  • privateKey - Relay account private key
  • rpcUrl - Relay URL

Deposit (Ethereum → Relay)

npx tsx index.ts deposit <amount> <recipient> <privateKey> <rpcUrl>
  • amount - Amount in ETH (e.g., 0.1)
  • recipient - Relay address to receive tokens
  • privateKey - Ethereum account private key
  • rpcUrl - Ethereum RPC URL

Note: Transfer amounts are in ETH for deposits (EVM → Relay) but in wei for withdrawals (Relay → EVM).

Check Balance

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.).

About

Example showing how to bridge funds to & from Ethereum+Relay

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •