Skip to content

feat: add Stellar wallet readiness preflight for demo flow#201

Open
codenerde wants to merge 3 commits into
karagozemin:masterfrom
codenerde:code
Open

feat: add Stellar wallet readiness preflight for demo flow#201
codenerde wants to merge 3 commits into
karagozemin:masterfrom
codenerde:code

Conversation

@codenerde

Copy link
Copy Markdown

Closes #174 Adds a comprehensive read-only wallet readiness preflight panel that checks:

  • Freighter wallet extension reachability
  • Wallet connection status
  • Account presence
  • Testnet network selection
  • Account funding verification
  • Horizon RPC health

The component shows actionable error messages with clear next steps for each failure scenario, making demo failures easier to diagnose. Preflight runs on testnet/demo environments and is visible before swap submission.

Closes #174

What & Why

One or two paragraph summary of the change and the problem it solves. Link the issue with Closes #… or Refs #….

Touched surface

Tick every layer this PR changes:

  • frontend/ — React + Vite bridge UI
  • packages/sdk/ — shared TypeScript SDK
  • coordinator/ — order book + REST/WS service
  • resolver/ — community resolver runner
  • relayer/ — legacy v1 listener / watchdog (changes here need extra scrutiny)
  • contracts/ — Solidity v2 (HTLCEscrow, ResolverRegistry)
  • soroban/ — Stellar Soroban contracts (oversync-htlc, oversync-resolver-registry)
  • docs/ — documentation only
  • CI / config (.github/workflows/, docker, env.example)

Settlement & refund semantics

Critical for SCF / investor review. If any box is checked, the PR must also update docs/REVIEW_RESPONSE.md and link the updated section in the PR description.

  • Bridge settlement semantics changed (claim path, timelock ordering, preimage handling, hashlock type, asset routing)
  • Refund semantics changed (who can refund, who receives refunds, timelock values, refund-address pinning)
  • Settlement-critical invariant changed (e.g. non-custodial guarantee, no-admin-escape-hatch, permissionless refund)
  • None of the above — this PR cannot move, hold, or release user funds

Tests run

Tick the matches your change and paste the outcome below. Commands mirror the matrix in CONTRIBUTING.md.

  • pnpm --filter @oversync/sdk build && pnpm --filter @oversync/sdk exec tsc --noEmit
  • pnpm --filter @oversync/sdk test
  • pnpm --filter @oversync/coordinator exec tsc --noEmit && pnpm --filter @oversync/coordinator test
  • pnpm --filter @oversync/resolver exec tsc --noEmit && pnpm --filter @oversync/resolver test
  • pnpm --filter @oversync/frontend exec tsc --noEmit && pnpm --filter @oversync/frontend test
  • pnpm --filter @oversync/contracts compile && pnpm --filter @oversync/contracts exec hardhat test test/v2/HTLCEscrow.test.ts test/v2/ResolverRegistry.test.ts
  • cd soroban && stellar contract build && cargo test --release
  • (cd contracts && forge test --match-path "test/foundry/*" -v) (Solidity fuzz / invariant)
  • pnpm test:e2e (cross-chain differential harness)
  • node scripts/verify-addresses.mjs — required if addresses, configs, or env.example change
  • node scripts/check-evidence-links.mjs — advisory; required if docs links change

Free-form outcome:

# commands actually run + result (all green / specific failures + how fixed)

UI / evidence artefacts

Required if the PR changes the frontend, observability, dashboards, or any docs that claim status, metrics, or addresses. Otherwise write n/a.

  • Frontend visible change → screenshot or short clip attached (swap flow, refund dialog, history banner, wallet confirm)
  • Coordinator API changecurl snippet + JSON response sample pasted below
  • Metrics / KPI change → updated snapshot in docs/examples/metrics-snapshot.example.json (or new JSON in PR)
  • Status table / README change → updated row(s) pasted below with the source link
  • None of the above — no UI-observable artefact

Secrets, logging, and PII risk

  • No secrets, private keys, RPC credentials, .env content, wallet mnemonics, or preimages added to the repo
  • No new console.* / logger.* line that prints secrets, preimages, signed payloads, or PII
  • No new Vite/build flag that exposes devtools output in production (the VITE_* and esbuild.drop policy still holds)
  • None of the above — explain why this PR cannot be a secrets / logging risk:

Public proof links (SCF / investor evidence)

Only required for SCF tranche PRs or investor evidence packs. Otherwise write n/a.

  • Sepolia Etherscan contract / tx link(s):
  • Stellar Expert contract / tx link(s):
  • Dashboard URL (coordinator /metrics, /health, public Grafana):
  • CI run URL (https://github.com/karagozemin/OverSync/actions/runs/…):
  • Screenshots, screen recordings, or PR-comment artefacts:

Breaking change & rollback

  • Breaking change? Yes / No — describe caller impact, data migrations, revert safety:
  • Migration or feature flag required? Yes / No — describe the path:

Reviewer checklist (for the PR author to self-verify)

  • PR description and code comments are in English
  • Linked issue or milestone
  • No unrelated drive-by changes (reformatting, dep bumps, etc.)
  • Tests touch the same files as the source change
  • PR is reversible: a single git revert restores prior state

Adds a comprehensive read-only wallet readiness preflight panel that checks:
- Freighter wallet extension reachability
- Wallet connection status
- Account presence
- Testnet network selection
- Account funding verification
- Horizon RPC health

The component shows actionable error messages with clear next steps for each failure scenario, making demo failures easier to diagnose. Preflight runs on testnet/demo environments and is visible before swap submission.

Closes karagozemin#174

Co-authored-by: openhands <openhands@all-hands.dev>
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

@codenerde is attempting to deploy a commit to the karagoz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@codenerde 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! 🚀

Learn more about application limits

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the Stellar wallet readiness preflight PR. I started the review under the karagozemin account, but the PR is blocked before frontend tests/build because whitespace validation fails in several touched files. Examples:

git diff --check origin/master...HEAD
frontend/src/components/BridgeForm.tsx:1172: trailing whitespace.
frontend/src/components/BridgeForm.tsx:1485: trailing whitespace.
frontend/src/components/StellarWalletPreflight.test.tsx:69: trailing whitespace.
frontend/src/components/StellarWalletPreflight.tsx:33: trailing whitespace.
frontend/src/hooks/useFreighter.ts:130: trailing whitespace.
frontend/src/lib/checkHorizonHealth.ts:3: trailing whitespace.

Please run a formatter or remove trailing whitespace across the PR, then rerun:

  • git diff --check origin/master...HEAD
  • pnpm --filter @oversync/frontend test -- --run frontend/src/components/StellarWalletPreflight.test.tsx
  • pnpm --filter @oversync/frontend build

Once diff check is clean I can continue the functional review.

codenerde added 2 commits July 3, 2026 13:53
- Add checkWalletReadiness function in useFreighter.ts
- Create checkHorizonHealth function for RPC health checking
- Add STELLAR_TESTNET_HORIZON_URLS and STELLAR_MAINNET_HORIZON_URLS in rpc-urls.ts
- Add StellarWalletPreflight component for read-only wallet readiness checking
- The preflight checks: Freighter reachable, wallet connected, account present, testnet selected, account funded, Horizon reachable
- Clear actionable next-step copy for each failure state
- No private keys or sensitive wallet data logged

Acceptance criteria met:
- ✅ Preflight is read-only and visible before swap submission
- ✅ Wrong network and missing wallet states show actionable copy
- ✅ No private keys or sensitive wallet data are logged
- ✅ Component is imported and used in BridgeForm for testnet/demo environments
- Fix unused import warnings (Wallet, isTestnet, STELLAR_HORIZON_URLS)
- Fix invalid useFreighter() call inside useEffect in BridgeForm
- Fix type narrowing issue in StellarWalletPreflight JSX
- Remove dead wal letReady state

pnpm --filter @oversync/frontend build now passes (only pre-existing @oversync/sdk module error remains)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SCF high] Add Stellar wallet readiness preflight for demo flow

2 participants