feat(portal-framework-auth): deterministic wallet logos with validated fallbacks - #1155
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
pcfreak30
force-pushed
the
feat/portal-framework-auth-wallet-logos
branch
from
September 4, 2026 06:07
5a3d595 to
d68b041
Compare
…d fallbacks - add a curated wallet brand map keyed by EIP-6963 rdns (EVM) and the solana probe ids, with brand-colour monogram discs + an inline-SVG mark where one is archived (CoinbaseC) - new WalletLogo component resolves: curated SVM -> validated announced icon -> curated monogram -> neutral disc, replacing the private WalletGlyph; fixes solana rows that previously had no branding - sanitizeWalletIcon validates the EIP-6963 info.icon before render: base64 raster data-uri only, 32KiB cap, rejects svg (xss) and remote urls (unvetted fetch) - unit + browser coverage for the map, validation, and resolution chain
pcfreak30
force-pushed
the
feat/portal-framework-auth-wallet-logos
branch
from
September 4, 2026 06:08
d68b041 to
fb32b4b
Compare
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds deterministic logo treatment for detected wallets in the wallet-login
picker (
WalletLogin), replacing the ad-hoc announced-icon-or-initial chip.A curated brand map keyed by EIP-6963 rdns (EVM) and the Solana probe ids
gives known wallets a brand-colour monogram disc, with an archived inline-SVG
mark where the official vector is vendorable (Coinbase Wallet). The new
WalletLogocomponent resolves curated SVG → validated announced icon →curated monogram → neutral disc, which also gives Solana wallets a logo row
for the first time.
The EIP-6963
info.iconpath is hardened before render: base64 rasterdata-URI only, 32 KiB cap, rejecting SVG (XSS) and remote URLs. Brand colours
were audited against public sources; unverified hues are omitted rather than
invented.
Summary
Introduces deterministic, secure logo rendering for the wallet login picker, replacing the previous ad-hoc "announced icon or generic initial" logic with a curated prioritization order and input validation.
Changes
Deterministic logo resolution (
WalletLogo.tsx): Renders wallet logos in a fixed priority:Icon sanitization (
wallet/logos.ts): NewsanitizeWalletIconfunction validates wallet-provided icon URIs before rendering. It accepts only small base64 raster data URIs (PNG/JPEG/WebP/GIF/AVIF) and rejects:Curated wallet registry (
wallet/logos.ts): A newwalletLogosmap defines brand colours (and optional SVG icons) for common wallets across EVM (EIP-6963 rdns ids) and Solana (probe ids) — MetaMask, Coinbase, Trust, Phantom, Rainbow, OKX, Brave, Exodus, Zerion, Solflare, Backpack. Entries are hand-verified; unconfirmed colours (e.g., Rabby) intentionally fall back to neutral.Coinbase Wallet SVG icon (
walletLogos/CoinbaseC.tsx): Vendored official Coinbase Wallet inline SVG (blue tile + white mark) to serve as the curated brand icon.Integration & tests: The
WalletLoginpicker now usesWalletLogodirectly. Added browser and unit tests covering resolution priority, sanitization rejection cases, and fallback behaviour.Impact
This change makes wallet logos in the login picker consistent and trustworthy: