Skip to main content

Module bridge

Module bridge 

Source
Expand description

USDC in and out of Hyperliquid through the Arbitrum bridge. In: a USDC transfer to the bridge on Arbitrum, credited to the same address on Hyperliquid in about a minute; under MINIMUM_DEPOSIT it is lost. Out: withdraw3 on the venue (crate::transfer::Withdraw3). The reads before a deposit are crate::client::evm::rpc queries, sent by the caller.

Enums§

BadDeposit

Constants§

MAINNET_BRIDGE
The Hyperliquid bridge on Arbitrum One.
MAINNET_USDC
Native USDC on Arbitrum One.
MINIMUM_DEPOSIT
Below this the bridge credits nothing and the USDC is gone.
TESTNET_BRIDGE
Testnet’s bridge, on Arbitrum Sepolia.
TESTNET_USDC
The USDC testnet’s bridge takes, on Arbitrum Sepolia.

Functions§

bridge
The bridge a deposit on network goes to.
deposit_calldata
usdc_transfer_calldata to the network’s bridge, refusing what it would lose. The transaction goes to usdc on Network::arbitrum_chain_id with no value.
eth_amount
An eth_balance_request answer as ETH, exactly.
eth_balance_request
The owner’s ETH, for gas, at the latest block. Its answer reads with eth_amount.
rpc_url
A public JSON-RPC for the Arbitrum chain the bridge is on (Network::arbitrum_chain_id).
usdc
The USDC contract a deposit on network is a transfer of.
usdc_amount
A usdc_balance_request answer as USDC, exactly.
usdc_balance_request
The owner’s USDC on the network’s Arbitrum chain: balanceOf through eth_call at the latest block. Its answer reads with usdc_amount.
usdc_transfer_calldata
0x calldata for USDC transfer(to, amount) (erc20::transfer). The amount is scaled to six decimals exactly; a seventh place is refused, never rounded.