Skip to content

feat(wallet): add XBullWallet adapter - #598

Merged
collinsezedike merged 1 commit into
drydocs:mainfrom
karanjadavi:feat/xbull-wallet-adapter
Sep 1, 2026
Merged

feat(wallet): add XBullWallet adapter#598
collinsezedike merged 1 commit into
drydocs:mainfrom
karanjadavi:feat/xbull-wallet-adapter

Conversation

@karanjadavi

@karanjadavi karanjadavi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds XBullWallet as a supported wallet adapter alongside Freighter.

  • Wires the xbull wallet connector into apps/web/src/lib/wallet.ts
  • Adds test coverage in xbull-wallet.test.ts

Test plan

  • pnpm --filter web test passes

Closes #488

@vercel

vercel Bot commented Aug 26, 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.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@karanjadavi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint & Typecheck is failing, see the inline comment on the trailing newline. Two more things need fixing before this can merge, both noted inline.

Separately: #579 already implements this same adapter for #488. Worth checking with the maintainer on which one moves forward before spending more time here.

Comment thread apps/web/src/lib/wallet.ts Outdated
const bridge = new xBullWalletConnect();
try {
const publicKey = await bridge.connect();
storeXBullPublicKey(publicKey);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stores publicKey unconditionally. LobstrWallet.connect() in this same file guards with if (!publicKey) throw new Error("LOBSTR wallet returned no public key") before storing. If xBull's bridge ever resolves with an empty string instead of rejecting (a cancelled or failed pairing), an empty key gets persisted, and isAuthorized()'s readStoredXBullPublicKey() !== null check would then report the wallet as authorized when it never actually connected.

Comment thread apps/web/src/lib/wallet.ts Outdated
async () => {
const bridge = new xBullWalletConnect();
try {
return await bridge.sign({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returns whatever the bridge resolves with, with no check. Both FreighterWallet.sign() and LobstrWallet.sign() in this file guard against a falsy result on cancellation and throw "Signing cancelled". If xBull's bridge ever resolves falsy on cancel instead of rejecting, callers get a falsy "signed" XDR instead of a clear error.

Comment thread apps/web/src/lib/wallet.ts Outdated

// Freighter is the only supported wallet today.
export const wallet: WalletAdapter = new FreighterWallet();
export const wallet: WalletAdapter = new FreighterWallet(); No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing its trailing newline at the end, which is what's failing Lint & Typecheck (Prettier enforces one by default). The diff also removes and re-adds this identical line with no actual change, worth dropping that no-op from the diff too.

@collinsezedike

Copy link
Copy Markdown
Collaborator

@karanjadavi checking in, this has been sitting on REQUEST_CHANGES for over two days with no update. Let me know if you're still working through the feedback or need any help.

@collinsezedike
collinsezedike force-pushed the feat/xbull-wallet-adapter branch from 6d3550f to 8619e30 Compare August 31, 2026 21:17
@collinsezedike
collinsezedike force-pushed the feat/xbull-wallet-adapter branch from 8619e30 to f7ba7df Compare September 1, 2026 05:15

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased onto the post-#611 wallet registry, added the missing empty-public-key and falsy-sign guards matching LobstrWallet's pattern, and de-duplicated the two wallets' sessionStorage helpers into one shared pair after an independent review pass. Typecheck, lint, full test suite, and coverage all pass. Merging now.

@collinsezedike
collinsezedike merged commit 58c229e into drydocs:main Sep 1, 2026
8 of 9 checks passed
@collinsezedike collinsezedike changed the title feat(wallet): add XBullWallet adapter (#488) feat(wallet): add XBullWallet adapter Sep 4, 2026
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

2 participants