You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
connectWallet() can return undefined typed as string #369
exportasyncfunctionconnectWallet(): Promise<string>{constresult=awaitrequestAccess();if(result.error){thrownewWalletError(result.error.message??'Could not connect to Freighter');}returnresult.address;}
Only result.error is checked. currentWalletAddress two functions down
(:38-42) checks both — if (result.error || !result.address) return null —
which shows the API can return a success with no address (user closes the
Freighter popup without choosing an account, a locked wallet that resolves
without erroring, an account list that comes back empty).
In that case connectWallet returns undefined through a Promise<string>
signature, and src/components/wallet-connect-button.tsx:44-45 PATCHes it
straight to the backend:
JSON.stringify({ stellarPublicKey: undefined }) drops the key entirely, so
the request body is {} — the user gets whatever the backend's validator says
about a missing field, with no hint that the wallet never handed over an
address.
Fix: mirror currentWalletAddress's guard and throw a WalletError ("No
account was selected in Freighter") when result.address is falsy. Add the case
to src/lib/wallet.test.ts.
@Lebmont8 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hello, I'm interested in taking this issue on.
I'm a full-stack developer with 4+ years of experience, working with TypeScript and frontend integrations. I'll build this to match the patterns already used elsewhere in the project, with tests covering the new behavior.
Planned approach, based on the acceptance criteria:
Reject a missing or empty Freighter address with a clear WalletError, matching currentWalletAddress's guard
Keep successful connections and existing wallet error messages unchanged
Extend wallet.test.ts to cover no account selected, a valid address, and an extension error
Verify the failed connection cannot proceed to the wallet-update request, then run the frontend checks
Looking forward to contributing — please assign this issue to me.
Activity
Lebmont8 commentedon Nov 21, 2026
@Lebmont8 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Lebmont8 to this issue.
hameedx01 commentedon Nov 25, 2026
@hameedx01 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @hameedx01 to this issue.