feat: add 0G network icon and native-asset icon - #34205
Conversation
Wires 0G (16661/0x4115) into NETWORK_CHAIN_ID and
CustomNetworkImgMapping (network-picker icon) -- not the PopularList
additional-network entry, which stays out of scope per the standing
additional-network-is-optional ruling (same treatment as Somnia).
Also wires app/images/image-icons.js's imageIcons map, keyed by
ticker symbol ('0G'), since the native-asset row in the wallet's
asset list resolves its icon via NetworkAssetLogo -> Base/TokenIcon
through that map, not through CustomNetworkImgMapping.
Core package bump (@metamask/assets-controllers) deferred to a
follow-up commit once MetaMask/core#9760 merges and publishes.
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
The previous commit imported app/images/0g-mainnet-logo.png (the purple-background network logo) as ZERO_G_NATIVE for image-icons.js's native-asset row, reasoning "no separate native-token asset" -- that was wrong. chain-input.yaml tracks two distinct assets: branding.networkLogoSvgPath (purple background, white mark -- the network icon, correctly used by CustomNetworkImgMapping) and nativeToken.logoSvgPath (white background, purple mark -- the native-token icon). Same brand mark, inverted colors, genuinely different files (confirmed via checksum, not just visual inspection). Adds app/images/0g-native-logo.png (from the enablement's own branding/native/0g.png) and repoints image-icons.js's '0G' entry at it. CustomNetworkImgMapping.ZERO_G (the network-picker icon) is unaffected and stays on the purple network logo.
# Conflicts: # app/images/image-icons.js # app/util/networks/customNetworks.tsx
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These are purely additive, non-breaking changes. No controller logic, transaction flows, Engine, or critical paths are modified. The changes affect the network management layer (adding a new custom network entry) and asset display (network badge/token icon). SmokeNetworkAbstractions covers network management UI including adding networks and viewing available networks, which is the most relevant test suite for validating this change. No dependent tags are required since this doesn't touch dApp chain permissions, multi-chain sessions, or transaction confirmations. Performance Test Selection: |
|



Wires 0G (16661/0x4115) into NETWORK_CHAIN_ID and
CustomNetworkImgMapping (network-picker icon) -- not the PopularList additional-network entry, which stays out of scope per the standing additional-network-is-optional ruling (same treatment as Somnia).
Also wires app/images/image-icons.js's imageIcons map, keyed by ticker symbol ('0G'), since the native-asset row in the wallet's asset list resolves its icon via NetworkAssetLogo -> Base/TokenIcon through that map, not through CustomNetworkImgMapping.
Description
Changelog
CHANGELOG entry: add 0G network icon and native-asset icon
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Display-only asset and mapping additions with no RPC, auth, or transaction logic changes.
Overview
Adds 0G (chain
0x4115/ 16661) to the custom-network icon plumbing so the network picker and wallet UI can show branded artwork when users are on that chain.NETWORK_CHAIN_IDgainsZERO_G, andCustomNetworkImgMappingpoints it at0g-mainnet-logo.png. Separately,image-icons.jsmaps the native ticker'0G'to0g-native-logo.pngso the asset list resolves the native token logo viaNetworkAssetLogo/TokenIcon, not the chain-id mapping.PopularList is unchanged (same optional treatment as Somnia).
Reviewed by Cursor Bugbot for commit 10a2368. Bugbot is set up for automated code reviews on this repo. Configure here.