-
Notifications
You must be signed in to change notification settings - Fork 619
Add ecosystem-specific chain config support #8147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
4 Skipped Deployments
|
WalkthroughAdds ecosystem-aware chain configuration: new ecosystemConfig module and use of its functions across wallet layout, page, connect components, and NftGallery so chains, wallets, and token queries can be constrained by an ecosystem identifier. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Router as App Router
participant Page as Wallet Page
participant Config as ecosystemConfig
participant Gallery as NftGallery
participant API as Token API
User->>Router: Navigate /[ecosystem]/wallet/[address]?chainId=...
Router->>Page: params { ecosystem, address }, searchParams { chainId }
Page->>Config: getEcosystemChainIds(ecosystem)
Config-->>Page: allowedChainIds | undefined
Page->>Gallery: props { owner, chainId, allowedChainIds }
Note over Gallery: compute resolvedChainId and chainIdsToQuery
Gallery->>API: getErc721Tokens({ owner, chainIds: chainIdsToQuery })
API-->>Gallery: Tokens
Gallery-->>User: Render tokens or empty state (resolvedChainId)
sequenceDiagram
autonumber
actor User
participant Connect as ConnectButton/ConnectEmbed
participant Config as ecosystemConfig
participant Thirdweb as Thirdweb UI
Connect->>Config: getEcosystemChains(ecosystem)
Config-->>Connect: chains[] | undefined
Connect->>Thirdweb: props { chain: chains[0], chains, wallets? }
Thirdweb-->>User: Ecosystem-scoped connect UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8147 +/- ##
=======================================
Coverage 56.28% 56.28%
=======================================
Files 906 906
Lines 59208 59208
Branches 4176 4176
=======================================
Hits 33324 33324
Misses 25779 25779
Partials 105 105
🚀 New features to boost your workflow:
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (5)
apps/wallet-ui/src/components/ConnectButton.tsx (1)
9-16: Add explicit return type and memoize wallets for referential stability.
- Annotate the component return type for clarity.
- Memoize the wallets array to avoid new array instances on every render.
Apply:
-export default function ConnectButton({ +export default function ConnectButton({ ecosystem, }: { ecosystem: `ecosystem.${string}`; -}) { +}): JSX.Element { const { theme } = useTheme(); const chains = useMemo(() => getEcosystemChains(ecosystem), [ecosystem]); + const wallets = useMemo(() => [ecosystemWallet(ecosystem)], [ecosystem]);- wallets={[ecosystemWallet(ecosystem)]} + wallets={wallets}As per coding guidelines.
Also applies to: 23-24
apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/layout.tsx (1)
49-54: Use a Set for membership checks to reduce per-request work.Tiny optimization when filtering many chains.
- const allowedChainIds = specialChainIds ?? SIMPLEHASH_NFT_SUPPORTED_CHAIN_IDS; + const allowedChainIds = + specialChainIds ?? SIMPLEHASH_NFT_SUPPORTED_CHAIN_IDS; + const allowedChainIdSet = new Set(allowedChainIds); - const simpleHashChains = thirdwebChains.filter((chain) => - allowedChainIds.includes(chain.chainId), - ); + const simpleHashChains = thirdwebChains.filter((chain) => + allowedChainIdSet.has(chain.chainId), + );Optional: add an explicit return type to
Layoutfor consistency:
export default async function Layout(...): Promise<JSX.Element> {(outside hunk). As per coding guidelines.apps/wallet-ui/src/components/ConnectEmbed.tsx (1)
47-49: LGTM overall; consider memoizing wallets and usingecosystemSlugin navigation.
- Passing
chainandchainslooks correct.- Memoize wallets for stable identity; prefer
ecosystemSlugoverparams.ecosystem(which can bestring[]).- const ecosystemId = ecosystemSlug + const ecosystemId = ecosystemSlug ? (`ecosystem.${ecosystemSlug}` as `ecosystem.${string}`) : undefined; + const wallets = useMemo( + () => (ecosystemId ? [ecosystemWallet(ecosystemId)] : undefined), + [ecosystemId], + );- wallets={ecosystemId ? [ecosystemWallet(ecosystemId)] : undefined} + wallets={wallets}Additionally, perform navigation in an effect and use
ecosystemSlug:// outside hunk useEffect(() => { if (userAddress) { router.push( `/wallet/${userAddress}?${searchParams.toString()}`, ecosystemSlug || "", ); } }, [userAddress, searchParams, ecosystemSlug, router]);Please confirm
router.push(url, ecosystem)is the intended signature for your custom router hook. If not, we should adjust accordingly. Based on learnings.Also applies to: 66-66
apps/wallet-ui/src/lib/ecosystemConfig.ts (2)
6-8: Freeze mapping and keep types precise.Lock down the config and get stricter compile-time checks.
-const SPECIAL_ECOSYSTEM_CHAIN_IDS: Record<string, readonly number[]> = { - "mon-id": [1, 43114] as const, -}; +const SPECIAL_ECOSYSTEM_CHAIN_IDS = { + "mon-id": [1, 43114], +} as const satisfies Record<string, readonly number[]>;Optionally narrow the identifier type to avoid diluting the template-literal type:
type EcosystemIdentifier = \ecosystem.${string}` | string | undefined;→ considerstring | undefinedor export a dedicatedEcosystemSlug = string` and keep the template form only at call sites. As per coding guidelines.
29-34: Potential ESLint rule: directdefineChainusage.Some workspaces restrict direct
defineChain. If that rule exists here, add a localized override.export function getEcosystemChains( ecosystem?: EcosystemIdentifier, ): Chain[] | undefined { const chainIds = getEcosystemChainIds(ecosystem); - return chainIds?.map((chainId) => defineChain(chainId)); + // eslint-disable-next-line no-restricted-syntax + return chainIds?.map((chainId) => defineChain(chainId)); }Based on learnings.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/layout.tsx(2 hunks)apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/page.tsx(2 hunks)apps/wallet-ui/src/components/ConnectButton.tsx(1 hunks)apps/wallet-ui/src/components/ConnectEmbed.tsx(3 hunks)apps/wallet-ui/src/components/NftGallery.tsx(1 hunks)apps/wallet-ui/src/lib/ecosystemConfig.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Files:
apps/wallet-ui/src/lib/ecosystemConfig.tsapps/wallet-ui/src/components/ConnectButton.tsxapps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/layout.tsxapps/wallet-ui/src/components/NftGallery.tsxapps/wallet-ui/src/components/ConnectEmbed.tsxapps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/page.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/wallet-ui/src/lib/ecosystemConfig.tsapps/wallet-ui/src/components/ConnectButton.tsxapps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/layout.tsxapps/wallet-ui/src/components/NftGallery.tsxapps/wallet-ui/src/components/ConnectEmbed.tsxapps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/page.tsx
🧠 Learnings (6)
📓 Common learnings
Learnt from: joaquim-verges
PR: thirdweb-dev/js#7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
📚 Learning: 2025-06-06T23:46:08.795Z
Learnt from: MananTank
PR: thirdweb-dev/js#7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of `defineChain`. When it's necessary to use `defineChain` directly, it's acceptable to disable the rule with `// eslint-disable-next-line no-restricted-syntax`.
Applied to files:
apps/wallet-ui/src/lib/ecosystemConfig.ts
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Applied to files:
apps/wallet-ui/src/components/ConnectButton.tsxapps/wallet-ui/src/components/ConnectEmbed.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Applied to files:
apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/layout.tsx
📚 Learning: 2025-09-23T19:56:43.668Z
Learnt from: MananTank
PR: thirdweb-dev/js#8106
File: packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx:482-485
Timestamp: 2025-09-23T19:56:43.668Z
Learning: In packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx, the EmbedContainer uses width: "100vw" intentionally rather than "100%" - this is by design for the bridge widget embedding use case.
Applied to files:
apps/wallet-ui/src/components/ConnectEmbed.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from `tanstack/react-query` or thirdweb SDKs.
Applied to files:
apps/wallet-ui/src/components/ConnectEmbed.tsx
🧬 Code graph analysis (4)
apps/wallet-ui/src/components/ConnectButton.tsx (1)
apps/wallet-ui/src/lib/ecosystemConfig.ts (1)
getEcosystemChains(29-34)
apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/layout.tsx (1)
apps/wallet-ui/src/lib/ecosystemConfig.ts (1)
getEcosystemChainIds(21-27)
apps/wallet-ui/src/components/ConnectEmbed.tsx (1)
apps/wallet-ui/src/lib/ecosystemConfig.ts (1)
getEcosystemChains(29-34)
apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/page.tsx (2)
apps/wallet-ui/src/lib/ecosystemConfig.ts (1)
getEcosystemChainIds(21-27)apps/wallet-ui/src/components/NftGallery.tsx (1)
NftGallery(20-60)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Unit Tests
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/wallet-ui/src/components/ConnectButton.tsx (1)
15-21: LGTM: ecosystem-aware preselect and chain list are correctly wired.Memoized chains, passing chains and default chain looks good.
apps/wallet-ui/src/components/NftGallery.tsx (1)
35-42: Nice fallback to allowed chains.Switching to a derived
chainIdsToQuerykeeps the gallery scoped to the ecosystem’s allowed list while still defaulting to the SimpleHash set when no filter is supplied. This keeps the fetch path consistent with the new config.
| const parsedChainId = chainId ? Number(chainId) : undefined; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: NaN chainId can leak into NftGallery and break token queries.
Number(chainId) yields NaN for invalid inputs; current logic passes it through.
Use a guarded parse (and optionally gate by allowedChainIds):
- const parsedChainId = chainId ? Number(chainId) : undefined;
+ const parsedChainId = (() => {
+ if (!chainId) return undefined;
+ const n = Number(chainId);
+ if (!Number.isInteger(n) || n <= 0) return undefined;
+ // Optional: also ensure it's allowed by the current ecosystem
+ if (allowedChainIds && !allowedChainIds.includes(n)) return undefined;
+ return n;
+ })();Also consider annotating the component return type:
export default async function Page(...): Promise<JSX.Element> (outside hunk). As per coding guidelines.
🤖 Prompt for AI Agents
In apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/page.tsx around
lines 18-19, Number(chainId) can produce NaN and that NaN is passed into
NftGallery breaking token queries; replace the direct Number conversion with a
guarded parse that returns undefined for invalid/non-numeric inputs (e.g.,
parseInt/Number then isFinite check) and optionally validate against an
allowedChainIds whitelist before passing to NftGallery; additionally add an
explicit return type annotation to the component signature (export default async
function Page(...): Promise<JSX.Element>) as per coding guidelines.
| type EcosystemIdentifier = `ecosystem.${string}` | string | undefined; | ||
|
|
||
| const SPECIAL_ECOSYSTEM_CHAIN_IDS: Record<string, readonly number[]> = { | ||
| "mon-id": [1, 43114] as const, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine for now, but we could totally put this in the ecosystem config. right now we have only 'default chain', but we could let ppl add all the chains they care about
Merge activity
|
Introduces ecosystemConfig utility to define allowed chains per ecosystem. Updates ConnectButton, ConnectEmbed, NftGallery, and wallet pages to use ecosystem-specific chain lists, enabling dynamic filtering and selection of chains based on the current ecosystem context.
<!-- start pr-codex -->
---
## PR-Codex overview
This PR introduces ecosystem-specific chain handling in the wallet UI, allowing for dynamic chain selection based on the ecosystem parameter. It enhances components to utilize ecosystem chains and improves the overall functionality of NFT galleries and connection buttons.
### Detailed summary
- Added `getEcosystemChainIds` and `getEcosystemChains` functions in `ecosystemConfig.ts`.
- Updated `Layout` to use `allowedChainIds` based on the ecosystem.
- Modified `NftGallery` to accept `allowedChainIds` and handle resolved chain IDs.
- Enhanced `ConnectButton` to utilize ecosystem-specific chains.
- Adjusted `Page` to retrieve and pass `allowedChainIds` for NFT galleries.
- Updated `ConnectEmbed` to manage ecosystem chains and wallet connections dynamically.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Ecosystem-aware chain selection across wallet pages, with automatic filtering to supported chains.
* NFT Gallery now respects ecosystem-specific allowed chains and selects the most relevant chain for queries and empty states.
* Connect Button and Connect Embed preselect and display chains based on the current ecosystem, improving onboarding.
* Ecosystem-aware wallet option shown when applicable.
* Wallet page routing now supports ecosystem in the URL, enabling context-aware views.
* **Refactor**
* Centralized ecosystem-to-chain mapping to ensure consistent behavior across components.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
bb78223 to
de22377
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/wallet-ui/src/components/ConnectEmbed.tsx (1)
66-67: Memoize the ecosystem wallet config
ecosystemWalletcreates a fresh config object, and wrapping it in an inline array givesThirdwebConnectEmbeda brand-newwalletsreference on every render. The embed reinitializes connectors whenever that prop changes, so even unrelated state updates (theme toggles, query refetches) can churn the wallet list and interrupt the flow. Cache the array off auseMemokeyed onecosystemIdand pass that stable reference instead.Apply this diff:
@@ - const ecosystemId = ecosystemSlug - ? (`ecosystem.${ecosystemSlug}` as `ecosystem.${string}`) - : undefined; + const ecosystemId = ecosystemSlug + ? (`ecosystem.${ecosystemSlug}` as `ecosystem.${string}`) + : undefined; + + const wallets = useMemo( + () => (ecosystemId ? [ecosystemWallet(ecosystemId)] : undefined), + [ecosystemId], + ); @@ - wallets={ecosystemId ? [ecosystemWallet(ecosystemId)] : undefined} + wallets={wallets}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/layout.tsx(2 hunks)apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/page.tsx(2 hunks)apps/wallet-ui/src/components/ConnectButton.tsx(1 hunks)apps/wallet-ui/src/components/ConnectEmbed.tsx(3 hunks)apps/wallet-ui/src/components/NftGallery.tsx(1 hunks)apps/wallet-ui/src/lib/ecosystemConfig.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- apps/wallet-ui/src/lib/ecosystemConfig.ts
- apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/layout.tsx
- apps/wallet-ui/src/components/NftGallery.tsx
- apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/page.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Files:
apps/wallet-ui/src/components/ConnectEmbed.tsxapps/wallet-ui/src/components/ConnectButton.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/wallet-ui/src/components/ConnectEmbed.tsxapps/wallet-ui/src/components/ConnectButton.tsx
🧠 Learnings (3)
📚 Learning: 2025-09-23T19:56:43.668Z
Learnt from: MananTank
PR: thirdweb-dev/js#8106
File: packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx:482-485
Timestamp: 2025-09-23T19:56:43.668Z
Learning: In packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx, the EmbedContainer uses width: "100vw" intentionally rather than "100%" - this is by design for the bridge widget embedding use case.
Applied to files:
apps/wallet-ui/src/components/ConnectEmbed.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from `tanstack/react-query` or thirdweb SDKs.
Applied to files:
apps/wallet-ui/src/components/ConnectEmbed.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Applied to files:
apps/wallet-ui/src/components/ConnectEmbed.tsxapps/wallet-ui/src/components/ConnectButton.tsx
🧬 Code graph analysis (2)
apps/wallet-ui/src/components/ConnectEmbed.tsx (1)
apps/wallet-ui/src/lib/ecosystemConfig.ts (1)
getEcosystemChains(29-34)
apps/wallet-ui/src/components/ConnectButton.tsx (1)
apps/wallet-ui/src/lib/ecosystemConfig.ts (1)
getEcosystemChains(29-34)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/wallet-ui/src/components/ConnectButton.tsx (1)
3-21: Ecosystem-aware chain memoization looks solidMemoizing
getEcosystemChains(ecosystem)keeps the chain objects stable per ecosystem switch, and wiring both the defaultchainandchainsarray intoThirdwebConnectButtonaligns with the new config utility.
Introduces ecosystemConfig utility to define allowed chains per ecosystem. Updates ConnectButton, ConnectEmbed, NftGallery, and wallet pages to use ecosystem-specific chain lists, enabling dynamic filtering and selection of chains based on the current ecosystem context.
PR-Codex overview
This PR focuses on enhancing the ecosystem-related functionality in the wallet UI by integrating ecosystem-specific chain IDs, allowing for more dynamic handling of chains based on the selected ecosystem.
Detailed summary
getEcosystemChainIdsandgetEcosystemChainsfunctions inecosystemConfig.ts.Layoutto useallowedChainIdsfor filtering chains.NftGalleryto acceptallowedChainIdsand handle resolved chain IDs.ConnectButtonto use ecosystem-specific chains.Pageto retrieve ecosystem from params and pass allowed chain IDs toNftGallery.ConnectEmbedto utilize ecosystem-specific chains and wallets.Summary by CodeRabbit
New Features
Refactor