Skip to content

feat: implement adapter architecture phases 1 and 2#446

Draft
fernandomg wants to merge 16 commits intodevelopfrom
feat/adapter-architecture-phases-1-2
Draft

feat: implement adapter architecture phases 1 and 2#446
fernandomg wants to merge 16 commits intodevelopfrom
feat/adapter-architecture-phases-1-2

Conversation

@fernandomg
Copy link
Copy Markdown
Member

@fernandomg fernandomg commented Apr 7, 2026

Description

Implements Phases 1 and 2 of the adapter architecture, transforming dAppBooster from an EVM-only starter template into a chain-agnostic, headless-first SDK.

Phase 1 -- Introduce adapters alongside existing code (no breaking changes):

  • Chain-agnostic primitives: ChainDescriptor, ChainRegistry, getExplorerUrl
  • Adapter interfaces: WalletAdapter, TransactionAdapter, TransactionLifecycle, WalletLifecycle
  • EVM implementations: createEvmWalletAdapter (wagmi/actions), createEvmTransactionAdapter (viem), createEvmServerWallet (private key signer)
  • Three connector wrappers: ConnectKit, RainbowKit, Reown -- each exposing useConnectModal hook with openAccount support
  • Pre-step helpers: createApprovalPreStep, createPermitPreStep
  • wrapAdapter utility for adapter composition (logging, analytics)
  • Typed error hierarchy (14 error classes including AdapterNotFoundError, TransactionNotReadyError, CapabilityNotSupportedError)
  • DAppBoosterProvider with per-adapter connect modal resolution via bridge components
  • React hooks: useWallet, useTransaction, useMultiWallet, useReadOnly, useChainRegistry

Phase 2 -- Migrate internals to adapter-backed hooks:

  • TransactionButton -> useTransaction() + useWallet()
  • SignButton -> useWallet().signMessage() + useChainRegistry()
  • WalletGuard replaces WalletStatusVerifier (accepts chainId and chainType for adapter resolution)
  • ConnectWalletButton is adapter-agnostic (uses useWallet + openConnectModal/openAccountModal, no wagmi imports)
  • Default connect fallbacks scoped to target chain via chainId/chainType
  • Legacy hooks (useWeb3Status, useWalletStatus) marked @deprecated
  • Wallet lifecycle hooks (onSign, onSignComplete, onSignError) dispatched during signing flows
  • Domain folder reorganization: src/wallet/, src/transactions/, src/tokens/, src/contracts/, src/core/, src/data/
  • Shared wagmi config (src/wallet/connectors/wagmi.config.ts) ensures SDK adapter and generated contract hooks use a single config instance
  • useProviderContext removed from public barrel exports (internal-only hook)

Phase 2 pending (tracked in spec, deferred to next PR):

These are sequential — each unblocks the next:

  1. Expand useReadOnly to accept address param and auto-contribute read factories from adapters (currently minimal stub)
  2. Migrate token infrastructure (useTokens, TokenSelect, AddERC20TokenButton) off deprecated useWeb3Status → use useWallet + useReadOnly (blocked by step 1)
  3. Replace TransactionNotificationProvider with createNotificationLifecycle wired as global lifecycle hooks in DAppBoosterProvider config (depends on useWeb3Status removal from step 2)
  4. Migrate demo pages off LegacyTransactionButton → adapter-based TransactionButton with TransactionParams (blocked by step 3 — demos need notifications working)

Review fixes included:

  • connect() validates chainId against supportedChains (ChainNotSupportedError)
  • useTransaction gates submission on prepare.ready (TransactionNotReadyError), dispatches onReplace lifecycle on tx replacement
  • Per-adapter connect modal resolution via bridge components (replaces single global useConnectModal)
  • openAccountModal added to connector hooks for disconnect/account management (RainbowKit uses separate modal, ConnectKit/Reown use single modal for both)
  • AdapterNotFoundError for not-found cases in both useTransaction and useWallet (was incorrectly using AmbiguousAdapterError)
  • CapabilityNotSupportedError for unsupported signTypedData
  • Provider validates adapter chainType vs supportedChains consistency at initialization
  • Registry normalizes chainId string/number for cross-type lookups
  • Structural dedup preserves ChainRegistryConflictError for genuinely conflicting chain descriptors
  • Stale modal registration cleanup on bridge component unmount
  • Provider performance fix (derived walletEntries inside useMemo to avoid unnecessary context rebuilds)
  • Legacy ConnectWalletButton imports repointed from Web3Provider to SDK path (eliminates dual import surface)
  • viem API corrections (replacement.transactionReceipt, privateKeyToAccount from viem/accounts)
  • TransactionNotificationProvider error toast type fix (was showing errors as success) and double-await elimination in watchTx
  • Connector migration from ConnectWalletButton component to useConnectModal hook across all 3 connectors
  • Shared wagmi config between SDK adapter and generated contract hooks (fixes generated hooks reading from wrong chain)
  • Centralized connector choice in wagmi.config.ts as single source of truth
  • react-jazzicon CJS interop fix for Vite 8 double-wrapped default export
  • Design by Contract enforcement: @precondition, @postcondition, @throws, @invariant JSDoc annotations on all public SDK methods matching spec contracts. Added missing runtime precondition checks (switchChain connected guard, execute chain support validation)

Architecture spec updated (docs/architecture/adapter-architecture-spec.md):

  • All interface definitions aligned with implemented code (async getSigner, useConnectModal hook pattern, params-at-execute pattern for useTransaction)
  • Phase 3 markers for: manual pre-step control, multi-chain WalletGuard, transforming adapter hooks, useReadOnly address/explorer, useMultiWallet convenience methods, ConnectWalletButton avatar/ENS, demo dialog z-index fix
  • Use case matrix with status column and agent implementation guide with deterministic resolution rules
  • wagmi config sharing rule documented (single config instance requirement)
  • EVM library coupling constraint explicitly documented (wagmi+viem structural dependency, not swappable)
  • DataAdapter interface noted as Phase 4+ design consideration

Steps

  1. pnpm install
  2. cp .env.example .env.local (set PUBLIC_APP_NAME and PUBLIC_WALLETCONNECT_PROJECT_ID)
  3. pnpm dev -- app runs with DAppBoosterProvider + ConnectKit connector
  4. Connect wallet, verify connection state in header
  5. Navigate to demo pages -- transaction demos use LegacyTransactionButton, signing demos work via new SDK hooks
  6. Verify connector swap: change one import in src/wallet/connectors/wagmi.config.ts (e.g. connectkitConnector to rainbowkitConnector or reownConnector)

Type of change

  • New feature
  • Bug fix
  • Breaking change
  • Enhancement
  • Refactoring
  • Chore

How Has This Been Tested?

  • Manual testing
  • Automated tests
  • Other (explain)

509 tests passing (65 test files). Full tsc --noEmit clean. Biome lint clean. Pre-commit hooks (lint-staged + vitest related) and commitlint pass on all commits. Manual testing of wallet connection, connector swap, and demo page flows.

Remember to check that

  • Your code follows the style guidelines of this project
  • You have performed a self-review of your code
  • You have commented your code in hard-to-understand areas
  • You have made corresponding changes to the documentation
  • Your changes generate no new warnings

Screenshots

N/A -- no visual changes. UI components preserve existing Chakra styling. The adapter architecture is a structural/API change.

Add @precondition, @postcondition, @throws, and @invariant JSDoc
annotations to all public SDK methods matching the spec contracts.

Add missing runtime precondition enforcement:
- switchChain() now checks connected state before chain validation
- execute() now validates params.chainId against supportedChains
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
components.dappbooster Ready Ready Preview, Comment Apr 7, 2026 0:30am
demo.dappbooster Ready Ready Preview, Comment Apr 7, 2026 0:30am
docs.dappbooster Ready Ready Preview, Comment Apr 7, 2026 0:30am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements Phases 1–2 of the adapter architecture, introducing chain-agnostic adapter primitives and migrating key UI flows to adapter-backed hooks while reorganizing domains (wallet/transactions/tokens/core/data/contracts).

Changes:

  • Added chain registry primitives, adapter interfaces, EVM adapter implementations, and adapter composition utilities.
  • Introduced DAppBoosterProvider + React SDK hooks/components (useWallet, useTransaction, WalletGuard, adapter-agnostic connect/sign/tx buttons).
  • Reorganized app domains (core/, wallet/, transactions/, tokens/, data/, contracts/) and updated demo pages/tests accordingly.

Reviewed changes

Copilot reviewed 253 out of 256 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
typedoc.json Updates TypeDoc excludes to match new folder layout (core/contracts/wallet/data).
src/wallet/types.ts Re-exports legacy wallet types for compatibility.
src/wallet/providers/Web3Provider.tsx Reintroduces legacy Wagmi/Query/Web3 provider wrapper for older entrypoints.
src/wallet/providers.ts Re-exports adapter-agnostic ConnectWalletButton from the SDK.
src/wallet/hooks/useWalletStatus.ts Adds deprecated wallet status helper on top of useWeb3Status.
src/wallet/hooks.ts Barrel export for wallet hooks.
src/wallet/connectors/wagmi.config.ts Centralizes shared wagmi config/connector choice for SDK + generated hooks.
src/wallet/connectors/reown.config.tsx Legacy Reown/Web3Modal connector setup (example config).
src/wallet/connectors/rainbowkit.config.tsx Legacy RainbowKit connector setup (commented example).
src/wallet/connectors/portoInit.ts Optional Porto initialization gated by env.
src/wallet/connectors/connectkit.config.tsx Legacy ConnectKit connector config + custom connect button/avatar.
src/wallet/components/WalletStatusVerifier.tsx Deprecated verifier component + connected-status context helper.
src/wallet/components/SwitchChainButton.tsx Adds a styled SwitchChain button.
src/wallet/components/ConnectButton/styles.ts Adds ConnectButton theme styles via CSS variables.
src/wallet/components.ts Wallet UI barrel exports.
src/transactions/providers/TransactionNotificationProvider.test.tsx Adds regression tests for toast error handling and rejection behavior.
src/transactions/providers.ts Barrel export for transaction notification provider/hook.
src/transactions/components/TransactionButton.tsx Migrates to adapter-backed useWallet/useTransaction flow.
src/transactions/components/SignButton.tsx Migrates signing flow to adapter-backed useWallet + registry.
src/transactions/components.ts Transactions UI barrel exports (legacy + new buttons).
src/tokens/utils/tokenListsCache.ts Adds a token list cache utility for startup-loaded token lists.
src/tokens/types/index.ts Introduces Zod schemas + token list typing.
src/tokens/types.ts Token public types + schema re-exports for consumers.
src/tokens/hooks/useTokenSearch.ts Adds deferred token search hook.
src/tokens/hooks/useErc20Balance.ts Adds ERC20 balance hook via wagmi public client + react-query.
src/tokens/hooks.ts Tokens hooks barrel export.
src/tokens/config/tokenLists.ts Adds default token lists configuration.
src/tokens/components/TokenSelect/utils.tsx Adds chainId resolution helper for TokenSelect.
src/tokens/components/TokenSelect/types.ts Defines TokenSelect network selector types.
src/tokens/components/TokenSelect/TopTokens/Item.tsx Adds top-token item UI.
src/tokens/components/TokenSelect/TopTokens/index.tsx Adds top-tokens grid selection.
src/tokens/components/TokenSelect/styles.ts Adds TokenSelect theme styles via CSS variables.
src/tokens/components/TokenSelect/Search/NetworkButton.tsx Adds network dropdown trigger button UI.
src/tokens/components/TokenSelect/Search/Input.tsx Adds TokenSelect search input styling and icon.
src/tokens/components/TokenSelect/Search/index.tsx Adds combined search + network dropdown UI.
src/tokens/components/TokenSelect/List/VirtualizedList.tsx Adds virtualized list helper using @tanstack/react-virtual.
src/tokens/components/TokenSelect/List/TokenBalance.tsx Adds token balance renderer with suspense wrapper.
src/tokens/components/TokenSelect/List/index.tsx Adds TokenSelect list rendering with virtualization + empty state.
src/tokens/components/TokenSelect/List/AddERC20TokenButton.tsx Adds “Add token to wallet” control (legacy/web3Status-based).
src/tokens/components/TokenInput/useTokenInput.tsx Adds TokenInput state/balance management hook.
src/tokens/components/TokenInput/styles.ts Adds TokenInput theme styles via CSS variables.
src/tokens/components.ts Tokens components barrel export.
src/sdk/react/provider/index.ts Exposes provider API for React SDK.
src/sdk/react/provider/context.ts Defines provider context shape + internal useProviderContext.
src/sdk/react/lifecycle/index.ts Exposes notification lifecycle factory/types.
src/sdk/react/lifecycle/createNotificationLifecycle.ts Adds toast-based transaction lifecycle implementation.
src/sdk/react/index.ts React SDK barrel export (components/hooks/lifecycle/provider).
src/sdk/react/hooks/useReadOnly.ts Adds minimal read-only client hook driven by registered factories.
src/sdk/react/hooks/useReadOnly.test.ts Adds tests for read-only hook behavior.
src/sdk/react/hooks/useChainRegistry.ts Adds hook to access ChainRegistry from provider context.
src/sdk/react/hooks/useChainRegistry.test.ts Adds tests for registry hook + adapter-sourced chain data.
src/sdk/react/hooks/index.ts React hooks barrel export.
src/sdk/react/components/WalletGuard.tsx Adds adapter-based wallet gating component (replacement for legacy verifier).
src/sdk/react/components/index.ts React components barrel export.
src/sdk/react/components/ConnectWalletButton.tsx Adds adapter-agnostic connect/account button.
src/sdk/core/utils/wrap-adapter.ts Adds adapter wrapping utility for before/after/error hooks.
src/sdk/core/utils/wrap-adapter.test.ts Adds unit tests for adapter wrapping behavior.
src/sdk/core/utils/index.ts Core utils barrel export.
src/sdk/core/index.ts Core SDK barrel export (adapters/chain/errors/evm/utils).
src/sdk/core/evm/wallet.integration.test.ts Adds integration tests for EVM wallet adapter using wagmi mock connector.
src/sdk/core/evm/types.ts Defines EVM payload/config types shared across core/react layers.
src/sdk/core/evm/pre-steps.ts Adds approval/permit pre-step helpers producing adapter PreSteps.
src/sdk/core/evm/pre-steps.test.ts Adds tests for pre-step helper outputs.
src/sdk/core/evm/index.ts EVM module barrel export (chains/connectors/wallet/tx/presteps/server wallet).
src/sdk/core/evm/connectors/reown.tsx Adds Reown/AppKit connector implementation for SDK.
src/sdk/core/evm/connectors/rainbowkit.tsx Adds RainbowKit connector implementation for SDK.
src/sdk/core/evm/connectors/index.ts EVM connector barrel export.
src/sdk/core/evm/connectors/connectors.test.ts Adds tests validating connector surfaces.
src/sdk/core/evm/connectors/connectkit.tsx Adds ConnectKit connector implementation for SDK.
src/sdk/core/evm/chains.ts Adds viem Chain → ChainDescriptor conversion.
src/sdk/core/chain/registry.ts Adds immutable ChainRegistry with conflict detection and cross-type lookup normalization.
src/sdk/core/chain/index.ts Chain module barrel export (descriptor/registry/explorer).
src/sdk/core/chain/explorer.ts Adds registry-backed explorer URL builder.
src/sdk/core/chain/descriptor.ts Defines chain descriptor types (CAIP-2, explorer, endpoints, address config).
src/sdk/core/adapters/wallet.ts Defines WalletAdapter interface and supporting types.
src/sdk/core/adapters/transaction.ts Defines TransactionAdapter interface and supporting types.
src/sdk/core/adapters/provider.ts Defines provider configuration and adapter bundle types.
src/sdk/core/adapters/lifecycle.ts Defines wallet/transaction lifecycle hook types.
src/sdk/core/adapters/index.ts Adapters module barrel export.
src/sdk/core/adapters/index.test.ts Compile-time export surface test for adapter types.
src/routes/__root.tsx Switches app shell to DAppBoosterProvider + adapter wiring, removes legacy provider usage.
src/lib/wallets/web3modal.config.tsx Updates JSX intrinsic elements for AppKit button.
src/hooks/useWeb3Status.tsx Marks legacy useWeb3Status as deprecated.
src/hooks/useWalletStatus.ts Marks legacy useWalletStatus as deprecated.
src/data/types.ts Adds placeholder export for data domain typing surface.
src/data/adapters/subgraph/queries/uniswap/pools.ts Moves example Uniswap subgraph query under data domain.
src/data/adapters/subgraph/queries/readme.txt Documents example queries usage for subgraph codegen.
src/data/adapters/subgraph/queries/aave/reserves.ts Moves example Aave subgraph query under data domain.
src/data/adapters/subgraph/codegen.ts Moves subgraph codegen config under data domain.
src/core/utils/strings.ts Adds truncation utilities for hashes/strings.
src/core/utils/printAppInfo.ts Adds console app info printer.
src/core/utils/logger.ts Adds basic timing logger gated by dev mode.
src/core/utils/hash.test.ts Updates/relocates tests for hash detection utilities.
src/core/utils/getExplorerLink.ts Relocates explorer link helper under core utils.
src/core/utils/DeveloperError.ts Introduces DeveloperError type for non-retryable errors.
src/core/utils/address.ts Adds env-based native token address matcher.
src/core/utils.ts Creates consolidated core utils barrel export.
src/core/ui/SwitchThemeButton/styles.ts Adds CSS-variable theme styles for theme toggle.
src/core/ui/SwitchThemeButton/assets/Dark.tsx Adds Dark theme icon component.
src/core/ui/Spinner/styles.ts Adds CSS-variable theme styles for spinner.
src/core/ui/Spinner/index.tsx Adds themed Spinner wrapper.
src/core/ui/SecondaryButton/styles.ts Adds themed SecondaryButton styles.
src/core/ui/SecondaryButton/index.tsx Adds SecondaryButton component wrapper.
src/core/ui/PrimaryButton/styles.ts Adds themed PrimaryButton styles.
src/core/ui/PrimaryButton/index.tsx Adds PrimaryButton component wrapper.
src/core/ui/NotificationToast.tsx Adds notification toaster UI (still wired to legacy wallet hook).
src/core/ui/Modal/styles.ts Adds themed modal styles.
src/core/ui/Menu/styles.ts Adds themed menu styles.
src/core/ui/Menu/index.tsx Adds MenuContent/MenuItem wrappers with theme vars.
src/core/ui/Inner.tsx Adds layout container component.
src/core/ui/Header/styles.ts Adds themed header styles.
src/core/ui/Header/MobileMenu/styles.ts Adds themed mobile menu styles.
src/core/ui/Header/index.tsx Migrates header to new core/ui folder and new ConnectWalletButton import path.
src/core/ui/HashInput.test.tsx Updates/relocates HashInput tests.
src/core/ui/Hash.tsx Adds hash display component using new truncation util.
src/core/ui/Hash.test.tsx Adds tests for Hash component rendering behaviors.
src/core/ui/GeneralMessage/styles.ts Adds GeneralMessage theme styling.
src/core/ui/Footer/styles.ts Adds themed footer styles.
src/core/ui/Footer/Socials/index.tsx Adds footer social links list.
src/core/ui/Footer/Socials/assets/Twitter.tsx Adds Twitter/X icon component.
src/core/ui/Footer/Socials/assets/Telegram.tsx Adds Telegram icon component.
src/core/ui/Footer/Socials/assets/LinkedIn.tsx Adds LinkedIn icon component.
src/core/ui/Footer/index.tsx Adds footer component wired to package version.
src/core/ui/ExternalLink/styles.ts Adds themed external link styles.
src/core/ui/ExplorerLink.tsx Adds explorer link UI component using explorer URL utility.
src/core/ui/ExplorerLink.test.tsx Adds tests for ExplorerLink behavior.
src/core/ui/DropdownButton.tsx Adds dropdown button wrapper and chevron icon behavior.
src/core/ui/dev/TanStackRouterDevtools.tsx Migrates router devtools wrapper under core/ui/dev.
src/core/ui/dev/TanStackReactQueryDevtools.tsx Migrates query devtools wrapper under core/ui/dev.
src/core/ui/CopyButton/styles.ts Adds themed copy button styles.
src/core/ui/chakra/tooltip.tsx Adds Chakra tooltip wrapper with portal controls.
src/core/ui/chakra/toaster.tsx Adds Chakra toaster wrapper for general toasts.
src/core/ui/chakra/provider.tsx Adds Chakra provider + theme tokens + next-themes integration.
src/core/ui/chakra/color-mode.tsx Adds next-themes ThemeProvider wrapper.
src/core/ui/Button.tsx Adds base button primitive via chakra() factory.
src/core/ui/BigNumberInput.test.tsx Updates/relocates BigNumberInput tests.
src/core/ui/Avatar.tsx Adds avatar component with react-jazzicon CJS interop handling.
src/core/ui/Avatar.test.tsx Adds tests for Avatar rendering behavior.
src/core/types/utils.ts Adds shared type helper(s).
src/core/types.ts Creates consolidated core types barrel export.
src/core/hooks/useNetworkBlockNumber.ts Adds hook to fetch any-chain block number via viem client.
src/core/hooks.ts Core hooks barrel export.
src/core/config/networks.config.ts Centralizes chain/transports configuration under core/config.
src/core/config/common.ts Adds common flags (isDev, includeTestnets) under core/config.
src/core/components.ts Creates consolidated core UI components barrel export.
src/contracts/wagmi/config.ts Moves wagmi CLI codegen config to contracts domain.
src/contracts/abis/OPL1CrossDomainMessengerProxy.ts Moves ABI definitions to contracts domain.
src/contracts/abis/AaveFaucet.ts Moves ABI definitions to contracts domain.
src/components/sharedComponents/WalletStatusVerifier.tsx Updates legacy verifier to import ConnectWalletButton from new wallet path and adds deprecations.
src/components/sharedComponents/WalletStatusVerifier.test.tsx Updates verifier tests to mock the new ConnectWalletButton path.
src/components/sharedComponents/ui/Header/MobileMenu/MobileMenu.tsx Updates legacy header mobile menu connect button import path.
src/components/sharedComponents/ui/Header/index.tsx Updates legacy header connect button import path.
src/components/sharedComponents/SignButton.tsx Migrates legacy sign button to adapter-backed signing flow.
src/components/pageComponents/NotFound404.tsx Updates imports to new core components barrel.
src/components/pageComponents/NotFound404.test.tsx Fixes router mock to preserve original module exports.
src/components/pageComponents/home/Welcome/index.tsx Updates layout import to new core components barrel.
src/components/pageComponents/home/Examples/Item/index.tsx Updates Modal import to new core components barrel.
src/components/pageComponents/home/Examples/index.tsx Updates Inner import to new core components barrel.
src/components/pageComponents/home/Examples/demos/TransactionButton/NativeToken.tsx Updates imports to new core/transactions/wallet paths while retaining legacy tx demo.
src/components/pageComponents/home/Examples/demos/TransactionButton/index.tsx Updates wallet guard/verifier import path.
src/components/pageComponents/home/Examples/demos/TransactionButton/index.test.tsx Updates mocks to new wallet/sdk hook paths.
src/components/pageComponents/home/Examples/demos/TransactionButton/ERC20ApproveAndTransferButton/MintUSDC.tsx Updates contracts + legacy tx button + wallet context import paths.
src/components/pageComponents/home/Examples/demos/TransactionButton/ERC20ApproveAndTransferButton/index.tsx Updates generated hooks + utils + token type + wallet context imports.
src/components/pageComponents/home/Examples/demos/TransactionButton/ERC20ApproveAndTransferButton/ERC20ApproveAndTransferButton.tsx Updates generated hooks + utils + token types + wallet hook imports.
src/components/pageComponents/home/Examples/demos/TokenInput/index.tsx Updates to new tokens hooks/components + wallet hook paths.
src/components/pageComponents/home/Examples/demos/TokenDropdown/index.tsx Updates TokenDropdown + token types import paths.
src/components/pageComponents/home/Examples/demos/TokenDropdown/index.test.tsx Updates mocks to new tokens components barrel.
src/components/pageComponents/home/Examples/demos/SwitchNetwork/index.tsx Updates wallet components/hooks import paths.
src/components/pageComponents/home/Examples/demos/SwitchNetwork/index.test.tsx Updates mocks to new wallet hooks/providers barrels.
src/components/pageComponents/home/Examples/demos/subgraphs/SubgraphStatus/index.tsx Updates Spinner + suspense util imports to core.
src/components/pageComponents/home/Examples/demos/subgraphs/Subgraph/index.tsx Updates Copy/ExternalLink/toaster + subgraph query import paths.
src/components/pageComponents/home/Examples/demos/SignMessage/index.tsx Updates to new SignButton + WalletStatusVerifier and core button imports.
src/components/pageComponents/home/Examples/demos/SignMessage/index.test.tsx Updates mocks to new wallet hook/provider paths.
src/components/pageComponents/home/Examples/demos/OptimismCrossDomainMessenger/index.tsx Updates contracts/hooks + core utils/components + wallet context import paths.
src/components/pageComponents/home/Examples/demos/HashHandling/index.tsx Updates HashInput/Spinner + wallet hook + utils type import paths.
src/components/pageComponents/home/Examples/demos/HashHandling/index.test.tsx Updates mocks to new wallet hook path + core hash util path.
src/components/pageComponents/home/Examples/demos/HashHandling/Hash.tsx Updates Hash/toaster + explorer link util imports to core.
src/components/pageComponents/home/Examples/demos/EnsName/index.tsx Updates Spinner import path.
src/components/pageComponents/home/Examples/demos/EnsName/index.test.tsx Fixes wagmi mock to preserve original module exports.
src/components/pageComponents/home/Examples/demos/ConnectWallet/index.tsx Updates ConnectWalletButton import path to new wallet providers barrel.
src/components/pageComponents/home/Examples/demos/ConnectWallet/index.test.tsx Updates mock to new wallet providers barrel.
setupTests.ts Adjusts jsdom ResizeObserver stubbing for Chakra/floating-ui dependencies.
resume.txt Adds working notes / status recap file.
pnpm-lock.yaml Updates lockfile for dependency range changes.
package.json Moves scripts/paths to new folders; adjusts dependency semver ranges.
index.html Simplifies font loading and removes extra SEO/prefetch snippets.
.install-files/home/Examples/index.tsx Updates install template import paths to new core components barrel.
.gitignore Updates ignored generated outputs and local folders for new structure.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +48 to +52
justifyContent="center"
overflow="hidden"
width={`${ICON_SIZE}px"`}
>
<TokenLogo
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

width has an extra quote in the template literal (${ICON_SIZE}px"), which will produce an invalid CSS value and may break layout. Remove the stray quote so the computed width is a valid length.

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +65
lineHeight="1.2"
_groupHover={{
color: 'var(--top-token-item-color-hover, var(--top-token-item-color)',
}}
>
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS variable fallback string is missing a closing ) (it ends with var(--top-token-item-color) instead of ...))). This results in invalid CSS and the hover color won’t apply.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +52
paddingX={4}
paddingY={0}
transition="border-color var({durations.slow}), color var({durations.slow}), background-color var({durations.slow})"
_focusWithin={{
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This transition string uses var({durations.slow}), which is not valid CSS and is inconsistent with other transitions in the codebase (which use {durations.*} token placeholders). Fix the transition value so it resolves to a valid duration token.

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +11
'html.dark &': {
'--background-color': '#23048',
'--text-color': '#c5c2cb',
'--line-color': '#5f6178',
},
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dark theme background color #23048 is not a valid hex color (5 digits). This will be ignored by the browser and break footer theming. Use a valid 3/6/8-digit hex value.

Copilot uses AI. Check for mistakes.
Comment thread src/core/ui/Button.tsx
Comment on lines +23 to +26
textDecoration: 'none',
transition:
'background-color {durations.moderate}, border-color {durations.moderate}, color {durations.moderate',
userSelect: 'none',
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transition string is missing the closing }/text for the last duration token (it ends at color {durations.moderate). This produces invalid CSS and may cause transitions to be dropped. Close the token and ensure the full transition string is valid.

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +58
const publicClient = usePublicClient({ chainId: token?.chainId })

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usePublicClient is keyed off token?.chainId (the initial hook param) rather than selectedToken?.chainId. If the selected token changes, native balance reads can use the wrong chain client.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +68
} = useQuery({
queryKey: ['nativeBalance', selectedToken?.address, selectedToken?.chainId, userWallet],
queryFn: () => publicClient?.getBalance({ address: getAddress(userWallet ?? '') }),
enabled: isNative,
})
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This native balance query can run when userWallet is undefined (enabled whenever isNative is true), which will call getAddress('') and throw. Gate enabled on !!userWallet (and ideally !!publicClient) and avoid calling getAddress with an empty string.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +47
const enabled = !!address && !!token && !isNativeToken(token.address)
const publicClient = usePublicClient({ chainId: token?.chainId })

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabled doesn’t include !!publicClient, so the query may run with publicClient undefined and silently resolve balance as undefined. Include !!publicClient in enabled (or throw a clear error) to avoid indeterminate results.

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +26
<ConnectButton
isConnected={status.connected}
onClick={status.connected ? openAccountModal : openConnectModal}
>
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When connected, onClick uses openAccountModal, but that function is optional and may be undefined. In that case the button becomes a no-op; use openAccountModal ?? openConnectModal for the connected case.

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +30
if (networks !== undefined) {
// we prioritze the wallet chainId over the app chainId because it may be valid in this case,
// but not supported by the app to interact with but as a read-only chain.
if (typeof walletChainId === 'number' && networks.some(({ id }) => id === walletChainId)) {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment typo: "we prioritze" should be "we prioritize".

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants