fix: address #1268, #1269, #1270, #1271 - #1319
Merged
Merged
Conversation
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
fix: address #1268, #1269, #1270, #1271
What was solved
#1268 — F-50: Persist wallet connection across reloads
Persist the Freighter wallet connection across page reloads by silently restoring wallet state on mount in frontend/hooks/useWallet.ts, and clearing the persisted flag on disconnect, without triggering a Freighter popup on load.
Addressed:
#1269 — F-51: Share wallet state via a WalletProvider context
Introduce a WalletProvider React context that owns wallet state and the single polling interval, mount it in the root layout, and refactor useWallet to consume that context so Navbar, BetForm, and Portfolio share consistent state.
Addressed:
#1270 — F-52: Map contract error codes to user-facing messages
Add a frontend error-mapping layer that decodes numeric Soroban
ContractErrorcodes returned by contract simulations/submissions into friendly user-facing copy, and wire it intosubmitTransaction/simulate error paths so toasts display the mapped messages.Addressed:
frontend/lib/errors.tswith a table mapping everyContractErrorvariant to friendly user-facing copysubmitTransactionand simulation failures infrontend/lib/stellar.ts#1271 — F-53: Wait for transaction confirmation with timeout
Implement bounded transaction confirmation polling in the frontend:
submitTransactioninfrontend/lib/stellar.tsshould pollgetTransactionwith backoff up to 30s, distinguishing pending/success/failed/timeout states, andcomponents/TransactionStatusModal.tsxshould surface those states and link to stellar.expert for the tx hash.Addressed:
getTransactionwith backoff until SUCCESS/FAILED, bounded to a 30s timeoutTransactionStatusModalChanges
frontend/hooks/useWallet.ts(modify)frontend/app/layout.tsx(modify)frontend/lib/errors.ts(create)frontend/lib/stellar.ts(modify)components/TransactionStatusModal.tsx(create)Approach
Issues
Closes #1268
Closes #1269
Closes #1270
Closes #1271