Before you start
- The TypeScript project, which provides
src/evm.ts. - A Base wallet with some USDC, and ETH to pay for gas.
- Read Private bridging to understand what private routing does and does not protect.
Script
This script sends 100 USDC from Base to a different wallet on Arbitrum, using only private venues. Replace0xRecipient with the receiving address, save the file as src/bridge-privately.ts, and run npx tsx src/bridge-privately.ts.
src/bridge-privately.ts
Notes
- Several private venues are exchange desks that issue a deposit address. From an EVM or Solana wallet, BRDG turns that deposit into an ordinary transaction in
steps, so the script above handles it like any other route. - Venues that are not private are skipped and listed in
rejectedwith the codeprivacy_venue_required. - Expect fewer quotes, a lower output and a slower transfer than on the open route.
- Husher and SideShift need the end user’s IP address. If you call the API from a server, send
userIpon the quote. See Rate limits.