Repository navigation
fix: #1427 #1428 #1429 #1430 frontend transactions, config, API envelope and paths - #1493
Merged
Ehonrie merged 5 commits intoOct 21, 2026
Conversation
…errors while polling - Re-send on TRY_AGAIN_LATER with exponential backoff, bounded by the timeout - Treat DUPLICATE as already submitted and poll by hash - Decode the result code from errorResult on ERROR - Tolerate transient getTransaction errors until the timeout - Restore the contract error helpers imported by lib/stellar.ts Closes Netwalls#1427
…nd fix the contract-id variable mismatch - Declare every NEXT_PUBLIC_* variable in the zod schema and read it only via config - Rename the factory contract id to NEXT_PUBLIC_MARKET_FACTORY_CONTRACT_ID, matching .env.example and the README - Require the mainnet passphrase and an HTTPS RPC URL when the network is mainnet - Add scripts/check-env-example.mjs and run it in frontend CI to keep .env.example and the schema in sync Closes Netwalls#1428
…api.ts and validate responses with zod - Unwrap `data` from the backend envelope and expose page, limit and nextCursor on list responses (fetchMarkets now resolves to Paginated<Market[]>) - Validate every response with a zod schema; a mismatch throws ApiResponseError - Read `estimatedPayout` from the payout estimate, matching the backend - Serve the real envelope from the Playwright mock API Closes Netwalls#1429
…nd (admin resolve, leaderboard) - POST /api/admin/markets/resolve with marketId and outcome in the body, matching the backend route instead of /api/admin/markets/:id/resolve - Contract tests pin the method, path and body for resolveMarket and the /api/leaderboard request. The admin and leaderboard pages already render an error state when these calls fail. Closes Netwalls#1430
Combine the PR's validated config schema (passphrase, admin, e2e) with main's market contract id, factory id regex and site url; keep both transaction timeout handling (PR's retry loop and main's expired-transaction message); keep the PR's paginated fetchMarkets with main's stale-response guard. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
Four frontend fixes, one commit per issue.
submitTransaction: handlesTRY_AGAIN_LATER(re-send with backoff),DUPLICATE(poll by hash), andERROR(decodeerrorResult). TransientgetTransactionerrors are tolerated until the timeout. Also restores the contract error helpers thatlib/stellar.tsimports butlib/errors.tsno longer exported.NEXT_PUBLIC_*variable is declared in the zod schema inlib/config.tsand read only through it. The factory id isNEXT_PUBLIC_MARKET_FACTORY_CONTRACT_IDeverywhere. Mainnet requires the mainnet passphrase and an HTTPS RPC URL.scripts/check-env-example.mjsruns in frontend CI to keep.env.exampleand the schema in sync. Addszodtopackage.json.lib/api.tsunwraps{ data, ... }, exposespage/limit/nextCursor, and validates every response with a zod schema. A mismatch throwsApiResponseError.fetchMarketsnow resolves toPaginated<Market[]>. The payout estimate readsestimatedPayout, matching the backend. The Playwright mock API serves the real envelope.resolveMarketposts to/api/admin/markets/resolvewith{ marketId, outcome }. Contract tests cover that call and/api/leaderboard.Notes for review
/api/leaderboardbut never importsleaderboardRoutesinapp.ts(B-84). This PR does not change that.frontend/package-lock.jsonis not updated here. It was already out of sync withpackage.json(see Frontend CI broken on main: package-lock.json out of sync with package.json #1333), sonpm cifails onmain.zodis inpackage.jsononly.mainfor unrelated reasons (30 of 34 suites, including syntax errors inhooks/useWallet.tsandhooks/usePayoutEstimate.ts). The new suites pass:__tests__/lib/submitTransaction.test.ts,__tests__/lib/config.test.ts,__tests__/api.test.ts.Closes #1427
Closes #1428
Closes #1429
Closes #1430