Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ NEXT_PUBLIC_CONTRACT_ADDRESS=
# -----------------------------------------------------------------------------
DEPLOYER_PRIVATE_KEY=

# -----------------------------------------------------------------------------
# WalletConnect (RainbowKit multi-wallet modal)
# -----------------------------------------------------------------------------
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=

# -----------------------------------------------------------------------------
# App Config
# -----------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions e2e/navigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ test.describe("Navigation", () => {
await page.goto("/create");
await page.locator("body").waitFor();

// Filter browser-level network errors (not app-level JS errors).
// "Failed to load resource" is emitted by the browser for HTTP 4xx/5xx
// on external fetches (e.g. WalletConnect/RainbowKit metadata).
const realErrors = errors.filter(
(e) =>
!e.includes("Failed to fetch") &&
!e.includes("Failed to load resource") &&
!e.includes("net::ERR") &&
!e.includes("Hydration") &&
!e.includes("RPC") &&
Expand Down
35 changes: 33 additions & 2 deletions lib/wagmi.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
import { http, createConfig } from "wagmi";
import { base, baseSepolia } from "wagmi/chains";
import { injected } from "wagmi/connectors";
import { farcasterMiniApp } from "@farcaster/miniapp-wagmi-connector";
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
import {
metaMaskWallet,
baseAccount,
trustWallet,
rainbowWallet,
walletConnectWallet,
} from "@rainbow-me/rainbowkit/wallets";
import { createFallbackTransport } from "./rpc";
import { DATA_SUFFIX } from "./builder-code";

const IS_MAINNET = process.env.NEXT_PUBLIC_CHAIN_ID === "8453";
const projectId = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || "placeholder";

// RainbowKit wallet list
const walletConnectors = connectorsForWallets(
[
{
groupName: "Recommended",
wallets: [
metaMaskWallet,
baseAccount,
trustWallet,
rainbowWallet,
walletConnectWallet,
],
},
],
{
appName: "PlotLink",
projectId,
},
);

// Farcaster miniapp connector first for auto-connect in Warpcast
const connectors = [farcasterMiniApp(), ...walletConnectors];

export const config = createConfig({
chains: [base, baseSepolia],
connectors: [farcasterMiniApp(), injected()],
connectors,
transports: {
[base.id]: IS_MAINNET ? createFallbackTransport() : http(),
[baseSepolia.id]: IS_MAINNET ? http() : createFallbackTransport(),
Expand Down
Loading
Loading