-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/c4 migration #672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mindrunner
wants to merge
16
commits into
main
Choose a base branch
from
feature/c4-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Feature/c4 migration #672
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
6ca4756 to
773f339
Compare
- Update deps: @solana/kit, solana-kite, @staratlas/dev-sage - Remove: @solana/web3.js, @coral-xyz/anchor, @staratlas/sage - Rewrite: connection, wallet, tx sending with Kit patterns - Delete: anchor.ts, programs.ts (no longer needed) - Add: C4 migration plan in docs/
- Add account-registry.ts with discriminator-based decoding - Add account-fetcher.ts with fetchAllAccounts/fetchAccount utils - Add types.ts with AccountWithKey and C4 type re-exports - Rewrite user-account.ts with Profile/Character/KeyPairSigner - Rewrite game.ts to use account-fetcher - Rewrite fleet-state types for __kind discriminators - Update coordinates.ts to use bigint (no more BN) - Update transform-sector/time for bigint - Delete obsolete type-guard files (replaced by __kind)
Rewrote core fleet actions using dev-sage instruction functions: - dock/undock: getIdleToDockedInstruction, getDockedToIdleInstruction - move/end-move/stop-subwarp: getWarpToCoordinateInstruction, getStartSubwarpInstruction, getTheOneFleetStateHandlerInstruction, getStopSubwarpInstruction - mine/end-mine: getStartMiningAsteroidInstruction, getStopMiningAsteroidInstruction - cargo: getTransferCargoToFleetInstruction with cargoId-based transfers Deleted ix/ folder (23 files) - inlined into act layer Removed non-core act files (create-fleet, deposit-cargo, etc.) Patterns: AccountWithKey<T>, KeyPairSigner, Address, fleet.state.__kind Error reduction: 588 -> 392 (33%)
- Rewrite fleet-cargo.ts: cargo now on Fleet struct directly - Rewrite user-fleets.ts: use fetchAllAccounts pattern - Delete cargo-types.ts, cargo-stats-definition.ts, get-fleet-ships.ts: obsolete in C4 - Rewrite starbases.ts: starbase now embedded in StarSystem - Rewrite starbase-by-*.ts: use StarSystem with starbase field - Rewrite starbase-player.ts: use findStarbasePlayerPda pattern - Rewrite planets*.ts: Planet -> CelestialBody - Rewrite resources.ts, mine-items.ts: resource data embedded in CelestialBody - Rewrite world-map.ts: new WorldMap structure for C4 - Stub profile.ts, pod-cleanup.ts, get-random-fleet.ts: TODO for C4 - Fix ships.ts: remove legacy imports - Update util.ts, show-fleet-*.ts, settle-fleet.ts: use C4 types Error count: 433 -> 317 (~27% reduction)
- Migrate all FSM files to C4 types (kind, Docked, coordinates) - Update strategy files: Game → AccountWithKey<Game> - Fix resource refs: game.data.mints → resource config - Remove legacy R4 code: src/lib/, fleetbot/, airdrop/, service/fleet, service/gm - Fix priority fee types: IInstruction → Instruction - Clean compile with 0 errors
- Rewrite airdrop.ts using Kit types (Address, KeyPairSigner) - Use superagent directly for airdrop requests - Integrate with C4 player context for profile checking
Remove deleted fleetbot entry from tsup.config.ts, package.json script, and docker/bin/fleetbot.sh to fix CI/CD build failures.
7a8500c to
a0d9bb9
Compare
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.
No description provided.