Skip to content

Feat/ Closes #333 freighter turn based client - #346

Merged
salazarsebas merged 26 commits into
salazarsebas:mainfrom
Sycosmile:feat/333-freighter-turn-based-client
Sep 26, 2026
Merged

salazarsebas merged 26 commits into
salazarsebas:mainfrom
Sycosmile:feat/333-freighter-turn-based-client

Conversation

@Sycosmile

Copy link
Copy Markdown
Contributor

Closes #333

What this adds

Adds a small web client for the turn-based template that connects to Freighter and interacts directly with the Soroban contract.

Included

  • Freighter wallet connection
  • Stellar Testnet-only network guard
  • Mainnet rejection
  • Direct calls to init_game, make_move, and get_state
  • Freighter-signed make_move transactions
  • Fixed 3×3 game board
  • Loading and error states
  • Move rejection handling
  • Fixture-based winning-state rendering tests
  • Path-scoped GitHub Actions for client tests and builds
  • README with contract configuration and deployment commands

Scope

This stays within the issue scope. It does not add custodial keys, Studio functionality, Godot support, a general component renderer, or configurable board sizes.

Verification

  • Re-checked the branch against main
  • Re-checked the changed files for regressions
  • Verified the turn-based contract methods and state shape
  • Fixed Soroban getter return-value decoding
  • CI runs the client unit tests and production build
  • No live wallet is required for tests

Local npm verification could not be completed because the environment could not resolve GitHub/npm dependencies, so no unverified test results are being claimed.

@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@Sycosmile 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

@salazarsebas salazarsebas left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Sycosmile, the pull request is looking good! You just need to make the following changes:

  1. clients/web/vite.config.ts:6 - import defineConfig from vitest/config instead of vite, since the test key is Vitest config.
  2. clients/web/tsconfig.app.json - add types: [vite/client] to compilerOptions. This fixes both the import.meta.env error in contract.ts:19 and the styles.css import error in main.tsx:4.
  3. clients/web/src/contract.ts:89 - simulation.result is accessed without narrowing the SimulateTransactionResponse union. Use a success type guard before reading .result.
  4. clients/web/src/game.test.ts:21 - the fixture object's status field widens to number instead of the GameStatus union. Type the fixture as GameState or cast the field.

Reproduce with cd clients/web && npm run build.

@Sycosmile

Copy link
Copy Markdown
Contributor Author

thank you so much for the coment i have done it

@salazarsebas salazarsebas left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Clean rewrite on the review feedback - the Vitest config fix, the type guard on the simulation result, and the typed fixture all landed exactly as discussed, and the extra GameBoard render test for the win-lockout case was a nice addition beyond what was asked.

Thanks for the contribution!

If you have a minute, a star on https://github.com/salazarsebas/Cougr helps the project keep growing. Community chat: https://t.me/cougrengine

@salazarsebas
salazarsebas merged commit c5f3b2c into salazarsebas:main Sep 26, 2026
2 checks passed
@Sycosmile
Sycosmile deleted the feat/333-freighter-turn-based-client branch September 26, 2026 09:32
meekmill0010 pushed a commit to meekmill0010/Cougr that referenced this pull request Oct 12, 2026
meekmill0010 pushed a commit to meekmill0010/Cougr that referenced this pull request Oct 13, 2026
meekmill0010 pushed a commit to meekmill0010/Cougr that referenced this pull request Oct 15, 2026
meekmill0010 pushed a commit to meekmill0010/Cougr that referenced this pull request Oct 22, 2026
meekmill0010 pushed a commit to meekmill0010/Cougr that referenced this pull request Nov 10, 2026
meekmill0010 pushed a commit to meekmill0010/Cougr that referenced this pull request Nov 16, 2026
meekmill0010 pushed a commit to meekmill0010/Cougr that referenced this pull request Nov 18, 2026
meekmill0010 pushed a commit to meekmill0010/Cougr that referenced this pull request Nov 27, 2026
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.

feat(client): add a freighter client for the turn-based template

2 participants