Commit de22377
committed
Add ecosystem-specific chain config support (#8147)
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 -->1 parent 7495f46 commit de22377
File tree
6 files changed
+86
-7
lines changed- apps/wallet-ui/src
- app/[ecosystem]/(authed)/wallet/[address]
- components
- lib
6 files changed
+86
-7
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | | - | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
17 | 32 | | |
18 | 33 | | |
19 | 34 | | |
| |||
29 | 44 | | |
30 | 45 | | |
31 | 46 | | |
| 47 | + | |
| 48 | + | |
32 | 49 | | |
33 | 50 | | |
34 | 51 | | |
| |||
46 | 63 | | |
47 | 64 | | |
48 | 65 | | |
49 | | - | |
| 66 | + | |
50 | 67 | | |
51 | 68 | | |
52 | 69 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
28 | 40 | | |
29 | | - | |
| 41 | + | |
30 | 42 | | |
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
35 | | - | |
| 47 | + | |
36 | 48 | | |
37 | 49 | | |
38 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments