Skip to content

feat(wallet): restrict connect modal to Vultisig only#677

Closed
Ehsan-saradar wants to merge 39 commits into
ping-pub:masterfrom
Ehsan-saradar:feat/vultisig-only-wallet
Closed

feat(wallet): restrict connect modal to Vultisig only#677
Ehsan-saradar wants to merge 39 commits into
ping-pub:masterfrom
Ehsan-saradar:feat/vultisig-only-wallet

Conversation

@Ehsan-saradar
Copy link
Copy Markdown
Contributor

Summary

  • qBTC is a custom Cosmos chain that only Vultisig (a quantum-safe wallet) supports; the upstream widget's other wallets cannot interact with quantum-proof chains, so the modal is now constrained to Vultisig
  • All wallet entries except the Keplr row are hidden via CSS, and that row is relabeled "Vultisig" — Vultisig impersonates window.keplr for backward compatibility, so it's the one that actually drives the connection
  • Detects install state via window.vultisig; when not installed, the modal's "Connect" button is relabeled "Install" and intercepted in capture phase to open the Chrome Web Store
  • Vultisig's real logo is pulled dynamically via EIP-6963 (eip6963:announceProvider) and applied via a CSS custom property, so no asset is bundled

Why CSS instead of the params prop

The CDN-loaded version of @ping-pub/widget ignores its params filter, so the only reliable way to constrain wallet options today is from the host side. The prop is still passed so a future widget upgrade that honors filtering works natively without further changes here.

Merge-with-upstream notes

All changes are in a single file (NavBarWallet.vue) and almost entirely additive (new functions, new CSS rules, new lifecycle hooks). The only existing lines modified are small: one import line, the fallback return of the params computed, three template text labels, and the wallet-name display expression. Conflict risk on upstream merge is low.

Test plan

  • In a browser with Vultisig installed: open the wallet dropdown, click "Connect Vultisig" — modal opens showing only the Vultisig row (real Vultisig logo, "Vultisig" label) and a "CONNECT" button. Clicking CONNECT connects via Vultisig.
  • In a browser without Vultisig installed: same flow — modal opens with "Vultisig" label (fallback Keplr logo), but the button reads "INSTALL". Clicking it opens the Chrome Web Store search for Vultisig Extension in a new tab.
  • Install Vultisig in the same session, refocus the tab → next modal open shows "CONNECT" again (state refresh happens on window focus).
  • Disconnect flow in the dropdown still works; the connected wallet is labeled "Vultisig" instead of the widget's reported name.

🤖 Generated with Claude Code

Ehsan-saradar and others added 30 commits May 6, 2026 13:15
- add qbtc mainnet and testnet configs pointing to odindex.io endpoints
- add qbtc logo asset
- remove other chains (axelar, cosmos, neutron, nolus, osmosis, xion, bfhevm, crossfi) since this fork is dedicated to qbtc

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rewrite all non-asset paths to / so the Vue Router can handle deep links
like /qbtc directly without Vercel returning 404.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Visiting / now 308-redirects to /qbtc so users land on the qbtc explorer
directly instead of the chain list page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When Keplr lacks a chain in its modular registry, calling enable/getKey
throws "There is no modular chain info for {chainId}" and the connect
modal surfaces the error inline without ever opening a popup. Wire the
ping-connect-wallet keplr-config event to call experimentalSuggestChain
directly so Keplr prompts the user to add the chain, instead of routing
to a separate manual /wallet/keplr page. Falls back to the manual page
if Keplr is missing or the suggestion rejects.

Extracts the ChainInfo builder from modules/wallet/keplr.vue into a
shared libs/keplr.ts helper to avoid duplicating the payload shape.
ping-widget@0.3.8's <ping-connect-wallet> only emits keplr-config when
the user clicks the gear icon, not when CONNECT fails — so the prior
walletStore.suggestChain() patch alone didn't reach the inline error
path. Its built-in "Suggest a chain to Keplr" fallback link is also
gated by error.search('no chain info'), which doesn't match Keplr's
new "no modular chain info" message.

Watch chainStore.current and call experimentalSuggestChain proactively
once Keplr is available. The call is idempotent — Keplr no-ops if the
chain is already registered — so a one-time approval popup eliminates
the inline error for all subsequent visits.
fix: auto-suggest chain to Keplr on connect
Replaces the placeholder ping-dashboard-five.vercel.app logo with the
official qBTC svg from vultisig/vultisig-windows.
chore: update qbtc logo to vultisig-hosted svg
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore: point mainnet qbtc logo to vultisig-hosted svg
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
docs: rewrite README for qbtc-explorer fork
- public/logo.svg → 256×256 qbtc logo (rendered from vultisig-hosted SVG;
  kept .svg extension so index.html reference is unchanged — browsers
  sniff the PNG content)
- public/favicon.ico → multi-size ICO (16/32/48) of the qbtc logo
- .gitattributes pins both files to merge=ours so upstream syncs from
  ping-pub do not silently revert qbtc branding

Note: collaborators must run once per clone for merge=ours to take effect:
  git config merge.ours.driver true

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore: replace logo and favicon with qbtc branding
The default formatToken format string '0,0.[0]' rounds amounts to a
single decimal place, so a 0.989925 QBTC balance rendered as "1 QBTC"
and amounts under 0.05 collapsed to "0". Pass '0,0.[000000]' explicitly
on the account page assets card and the chain home wallet card so
sub-unit balances are displayed accurately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix: show fractional token balances with 6-decimal precision
The coinDecimals lookup matched a denom_unit by symbol against the
runtime-built denom_units list, but for chains where base equals
symbol.toLowerCase() (e.g. QBTC) both entries share the same denom and
.find() returns the base entry with exponent 0 — which then falls
through `0 || 6` to 6. Suggested chains end up registered with 6
decimals while the chain actually uses 8, so balances render 100x off.

Read the asset exponent directly instead. Applied to keplr.ts, the
Keplr/Metamask suggest screens, and the Unisat suggest screen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix: register correct coin decimals when suggesting chain to wallets
…stream

fix: refresh wallet balances when connection state changes
Adds a self-contained `src/style-overrides.css` that hides the
"Ecosystem" NavSectionTitle in the sidebar. The selector targets
heading-style divs without the `pt-2` class, which uniquely matches
the v-for-rendered NavSectionTitle (the hardcoded Tools / Sponsors /
Links headings all use `pt-2`).

Keeping fork-only overrides in a dedicated file minimizes the risk of
merge conflicts with upstream — only the single import line in
`main.ts` touches a shared file.
The `public/logo.svg` file in this fork is actually PNG bytes saved with
a `.svg` extension. Browsers serve it as `image/svg+xml` (based on the
extension/MIME type), so the loading screen and the supply page fallback
rendered a broken image instead of the logo.

Rename the file to `logo.png` and update the two references (`index.html`
loading screen and the supply page fallback) accordingly.
- Make `#loading-bg` fill the viewport with `position: fixed; inset: 0`
  and default to `#171d30` (the dark site background) so the loading
  screen no longer flashes white before Vue mounts.
- Constrain the logo to 120x120 (was rendering at its intrinsic 256x256)
  and re-center horizontally with `calc(50% - 60px)`.
fix: serve loading-screen logo with correct .png extension
Enable rich link previews when sharing the explorer on social media
(Twitter/X, Facebook, LinkedIn, Slack, Discord, Telegram, etc.).
Image is served from /og-image.png and should be uploaded separately
at 1200x630.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Image is 1200x639; update og:image:height meta tag to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat: add Open Graph and Twitter Card meta tags
- Use absolute URLs for og:image and twitter:image so Telegram,
  Discord and Slack crawlers can resolve them.
- Correct og:image:height from 639 to 630 to match the image.
- Add og:url, og:locale, og:image:type and og:image:secure_url.
- Tighten title and description to focus on qBTC.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Ehsan-saradar and others added 9 commits May 13, 2026 13:45
Replaces the prior 1200x639 asset so the file matches the dimensions
declared in og:image:width / og:image:height.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix: absolute OG image URLs and matching dimensions
Extends src/style-overrides.css with four more rules that hide the
remaining default Ping.pub sidebar elements not relevant to this fork:

  - "Favorite" NavGroup (targeted via its unique `text-yellow-500` icon)
  - "All Blockchains" NavLink (targeted via `to: { path: '/' }` → href="/")
  - The bottom hardcoded block — Tools / Wallet Helper / Sponsors /
    Links / Twitter / Discord / FAQ (targeted via the `pt-2` heading
    class used only by the hardcoded section, opposite of the Ecosystem
    selector)
  - The "Ping.pub" logo + title at the top of the sidebar (keeps the
    parent flex wrapper visible so the mobile close button stays
    positioned by `justify-between`)

Each rule uses `:has()` on the wrapper to avoid leftover whitespace,
following the same fork-only override pattern introduced in #9.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
style: hide additional sidebar items via fork-only CSS
Updates the social-preview asset extension from PNG to JPG and adjusts
the three Open Graph / Twitter Card meta tag URLs in index.html, plus
the `og:image:type` value from `image/png` to `image/jpeg`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore: rename og-image.png to og-image.jpg
Validators using /cosmos.crypto.mldsa.PubKey produced an empty hex
address, so signatures in last_commit never matched and every block
rendered as "missed" on the uptime page. Derive the address with
ripemd160(sha256(pubkey)) for mldsa keys.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ress

fix(uptime): derive consensus address for mldsa pubkeys
qBTC is a custom Cosmos chain that requires Vultisig (the only
quantum-safe wallet). Other wallets in the upstream widget cannot
support quantum-proof chains, so they should not be offered.

The @ping-pub/widget CDN version ignores its `params` filter prop,
so the modal is constrained via CSS instead. Vultisig impersonates
window.keplr for backward compatibility, so the Keplr entry is kept
and relabeled.

- Hide all wallet options except the Keplr row (which Vultisig drives)
- Relabel "Keplr" -> "Vultisig" and "Connect Wallet" -> "Connect Vultisig"
- Pull the real Vultisig icon dynamically via EIP-6963 so the modal
  shows the right logo without bundling an asset
- Detect window.vultisig to decide install state; toggle a body class
  that flips the modal's "Connect" button to "Install"
- Intercept the install click in capture phase and redirect to the
  Chrome Web Store instead of running the widget's connect flow
- Keep the `params` prop set so a future widget upgrade that honors
  filtering will work natively without further changes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Ehsan-saradar
Copy link
Copy Markdown
Contributor Author

Wrong base repository — reopening on the fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant