Skip to content

fix: #1427 #1428 #1429 #1430 frontend transactions, config, API envelope and paths - #1493

Merged
Ehonrie merged 5 commits into
Netwalls:mainfrom
kaivegascod-a11y:fix/1427-1428-1429-1430-frontend-tx-config-api
Oct 21, 2026
Merged

Ehonrie merged 5 commits into
Netwalls:mainfrom
kaivegascod-a11y:fix/1427-1428-1429-1430-frontend-tx-config-api

Conversation

@kaivegascod-a11y

Copy link
Copy Markdown
Contributor

Summary

Four frontend fixes, one commit per issue.

Notes for review

  • The leaderboard 404 comes from the backend, which uses /api/leaderboard but never imports leaderboardRoutes in app.ts (B-84). This PR does not change that.
  • frontend/package-lock.json is not updated here. It was already out of sync with package.json (see Frontend CI broken on main: package-lock.json out of sync with package.json #1333), so npm ci fails on main. zod is in package.json only.
  • The frontend jest suite already fails on main for unrelated reasons (30 of 34 suites, including syntax errors in hooks/useWallet.ts and hooks/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

…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
@Ehonrie
Ehonrie merged commit 1a3cfa6 into Netwalls:main Oct 21, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment