Skip to content

feat: add XBullWallet adapter implementation (Closes #488) - #579

Open
waterWang wants to merge 1 commit into
drydocs:mainfrom
waterWang:feat/xbull-wallet-adapter
Open

feat: add XBullWallet adapter implementation (Closes #488)#579
waterWang wants to merge 1 commit into
drydocs:mainfrom
waterWang:feat/xbull-wallet-adapter

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Implements XBullWallet in apps/web/src/lib/wallet.ts, a third WalletAdapter implementation alongside FreighterWallet and LobstrWallet, targeting the xBull Stellar wallet.

xBull is mobile-first (unlike Freighter, which is desktop-only), so it is a real path to reaching the low-end Android users the roadmap targets — the issue explicitly scopes this to the adapter implementation only, with a wallet-picker to follow later.

Implementation

  • XBullWallet implements WalletAdapter with all four methods:
    • isInstalled() — checks for window.xBullSDK (injected by the xBull browser extension)
    • connect() — calls sdk.connect({ canRequestPublicKey: true, canRequestSign: true }) then sdk.getPublicKey()
    • isAuthorized() — xBull has no passive site-permission query (no isAllowed equivalent; the only grant flow is connect(), which prompts). Mirrors the LobstrWallet stored-key pattern: a successful connect() writes the public key to sessionStorage (meridian-xbull-public-key), and isAuthorized() treats installed + stored key as authorized. This keeps revalidate() (which runs on mount and focus) non-prompting.
    • sign() — passes networkPassphrase through to sdk.signXDR(xdr, { network }), throws "Signing cancelled" on falsy return
  • Every method short-circuits through the existing withMockWallet() helper, so Playwright e2e tests can exercise the connect/sign paths without a real extension — same pattern as FreighterWallet/LobstrWallet.

Tests

New file apps/web/src/__tests__/lib/xbull-wallet.test.ts (207 lines), mirroring the structure of lobstr-wallet.test.ts:

  • Real xBull path (stubbed window.xBullSDK): isInstalled true/false, isAuthorized stored-key semantics (incl. a "never calls connect/getPublicKey passively" guard), connect success + key storage + permissions payload, connect error paths (SDK missing, empty key), sign success, signXDR receives networkPassphrase, sign error paths (SDK missing, cancel, propagated rejection)
  • E2E mock wallet path: short-circuiting for all four methods and rejection propagation

Verification

  • pnpm --filter @meridian/web lint — no new lint errors
  • pnpm --filter @meridian/web test — all wallet tests pass (existing Freighter/LOBSTR + new xBull suite)

Closes #488

Add XBullWallet to wallet.ts, alongside FreighterWallet and LobstrWallet,
implementing the full WalletAdapter interface (isInstalled, isAuthorized,
connect, sign) for the xBull mobile wallet via window.xBullSDK.

xBull has no passive site-permission query, so isAuthorized mirrors the
LobstrWallet stored-key pattern (sessionStorage signal written on connect).
sign passes the networkPassphrase through to signXDR.

Closes: drydocs#488

Signed-off-by: waterWang <water.wang@users.noreply.github.com>
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

[Feature] Add xBull wallet support via the WalletAdapter interface

1 participant