Look in these files for example implementations:
/apps/app/bridge/_app.tsx
/apps/app/bridge/pages/index.tsx
The BridgeProvider contains the state for networks, tokens and theme. It also wraps Wagmi and RainbowKit providers to interact with the OptimismSDK.
import "@pgn/react/styles.css";
import { BridgeProvider, tokens, networks } from "@pgn/react";
const config = {
// Optional theme
theme: {},
// Tokens to be shown in the UI
tokens: [tokens.ETH, tokens.TestToken],
// Configs with RPC url and chain IDs
networks: {
l1: networks.supportedChains.sepolia,
l2: networks.supportedChains.pgnTestnet,
},
};
export default ({ Component, pageProps }) => {
return (
<BridgeProvider config={config}>
<Component {...pageProps} />
</BridgeProvider>
);
};
The component for bridging tokens.
This component will fetch all withdrawals and display in a table. The user can Prove or Finalize these transactions.