Skip to content
Start on Wormhole

Customising the Bridge

Wormhole Connect isn’t just powerful; it’s also incredibly flexible! You can tailor it to your specific needs, choosing which networks to connect and which tokens to accept. 🛠️🌈

Here’s a sample configuration that sets up a bridge exclusively for Ethereum, Solana, and Polygon, and only accepts ETH, wETH, MATIC, and wMATIC:

import WormholeBridge, { WormholeConnectConfig } from '@wormhole-foundation/wormhole-connect';

const config: WormholeConnectConfig = {
  env: "mainnet",
  networks: ["ethereum", "polygon", "solana"],
  tokens: ["ETH", "WETH", "MATIC", "WMATIC"],
  rpc: {
    ethereum: "https://rpc.ankr.com/eth",
    solana: "https://rpc.ankr.com/solana",
  }
}

function App() {
  return (
    <WormholeBridge config={config} />
  );
}

export default App;

After implementing this, your output will be displayed as

bridge-config

Feel free to tweak the config object to include other networks or tokens as per your project’s needs. 🔄🎛️

That wraps up this section! Coming up next, we’ll delve into some Solidity code and explore how to bridge messages across various blockchains. 🌉📝