Wallet architecture
PrivyProvider supports google, twitter, and wallet login and exposes only Base Mainnet. embeddedWallets.ethereum.createOnLogin is users-without-wallets, so a social user receives an embedded EVM wallet only when no wallet is already associated with that user. External-wallet users can keep Rabby, MetaMask, or another EVM wallet as their signer.
The provider order is Privy, TanStack Query, Privy’s wagmi provider, ActiveWalletProvider, then application providers. wagmiConfig is built with @privy-io/wagmi, keeps SSR enabled, exposes only Base (8453), and preserves the browser-safe Base RPC transport.
ActiveWalletProvider keeps the existing connected, activeAddress, activeChainId, and walletClient contract and adds explicit readiness and account actions. It matches the current wagmi connector to the exact Privy wallet, requires explicit selection when a multi-wallet session is ambiguous, and withholds transaction readiness unless the displayed address, wallet client signer, and Base chain agree. Authentication restoration and wallet hydration never masquerade as a logged-out state.
NEXT_PUBLIC_PRIVY_APP_ID is required public browser configuration and is validated before Privy renders. A missing or placeholder value produces an actionable development error instead of a broken login control. No Privy secret, delegated signer, server wallet, or backend transaction path is used.
Writes
- Read an onchain quote and balances.
- Derive a minimum output from configured slippage.
- Bind the quote to wallet, token, side, network, state, and deadline.
- Simulate the exact request.
- Append the ERC-8021 Builder Code suffix.
- Ask the connected wallet to send.
- Wait for and validate the receipt.
- Refresh onchain and indexed queries.
8453), active wallet, reviewed amounts, hash, and current phase. BaseScan links use the confirmed or submitted transaction hash.