feat: add XBullWallet adapter implementation (Closes #488) - #579
Open
waterWang wants to merge 1 commit into
Open
feat: add XBullWallet adapter implementation (Closes #488)#579waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
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>
|
Someone is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Implements
XBullWalletinapps/web/src/lib/wallet.ts, a thirdWalletAdapterimplementation alongsideFreighterWalletandLobstrWallet, 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 WalletAdapterwith all four methods:isInstalled()— checks forwindow.xBullSDK(injected by the xBull browser extension)connect()— callssdk.connect({ canRequestPublicKey: true, canRequestSign: true })thensdk.getPublicKey()isAuthorized()— xBull has no passive site-permission query (noisAllowedequivalent; the only grant flow isconnect(), which prompts). Mirrors theLobstrWalletstored-key pattern: a successfulconnect()writes the public key tosessionStorage(meridian-xbull-public-key), andisAuthorized()treats installed + stored key as authorized. This keepsrevalidate()(which runs on mount and focus) non-prompting.sign()— passesnetworkPassphrasethrough tosdk.signXDR(xdr, { network }), throws"Signing cancelled"on falsy returnwithMockWallet()helper, so Playwright e2e tests can exercise the connect/sign paths without a real extension — same pattern asFreighterWallet/LobstrWallet.Tests
New file
apps/web/src/__tests__/lib/xbull-wallet.test.ts(207 lines), mirroring the structure oflobstr-wallet.test.ts: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)Verification
pnpm --filter @meridian/web lint— no new lint errorspnpm --filter @meridian/web test— all wallet tests pass (existing Freighter/LOBSTR + new xBull suite)Closes #488