feat(wallet): add XBullWallet adapter - #598
Conversation
|
Someone is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@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! 🚀 |
collinsezedike
left a comment
There was a problem hiding this comment.
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.
| const bridge = new xBullWalletConnect(); | ||
| try { | ||
| const publicKey = await bridge.connect(); | ||
| storeXBullPublicKey(publicKey); |
There was a problem hiding this comment.
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.
| async () => { | ||
| const bridge = new xBullWalletConnect(); | ||
| try { | ||
| return await bridge.sign({ |
There was a problem hiding this comment.
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.
|
|
||
| // 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 |
There was a problem hiding this comment.
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.
|
@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. |
6d3550f to
8619e30
Compare
8619e30 to
f7ba7df
Compare
collinsezedike
left a comment
There was a problem hiding this comment.
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.
Summary
Adds XBullWallet as a supported wallet adapter alongside Freighter.
Test plan
Closes #488