Skip to content

refactor: drop dbart01/solana-swift dependency#259

Open
raulriera wants to merge 5 commits intomainfrom
refactor/replace-solana-swift
Open

refactor: drop dbart01/solana-swift dependency#259
raulriera wants to merge 5 commits intomainfrom
refactor/replace-solana-swift

Conversation

@raulriera
Copy link
Copy Markdown
Collaborator

Summary

Replaces the dbart01/solana-swift fork with a small Sendable-clean Solana JSON-RPC client living next to the existing transaction encoder in FlipcashCore. The Phantom external-wallet flow now serializes its own transactions instead of round-tripping through SolanaSwift's encoder, which surfaced and fixed a latent ordering bug in the legacy message account-key sort along the way.

Test plan

  • Connect a Phantom wallet from a fresh install with the keychain entry cleared.
  • Buy an existing launchpad currency end-to-end through Phantom and watch the processing screen complete.
  • Launch a new currency through Phantom and confirm the processing screen reflects the launch context.
  • Cancel from inside Phantom and confirm the cancel dialog appears with no orphaned state.
  • Force a simulation failure and confirm the failure dialog appears without a chain submission.

raulriera added 5 commits May 8, 2026 22:42
A small Sendable-clean Solana JSON-RPC client covering the three RPCs
the app calls today (latest blockhash, send transaction, simulate
transaction). Sets up the seam needed to retire the dbart01/solana-swift
dependency in a follow-up commit on this branch.
The legacy account-key sort grouped programs at the end of the read-only
section based on a heuristic flag that was only true for accounts added
through the program slot, leaving system and sysvar programs sorted
alongside non-program accounts. Replaces it with the canonical
payer/signer/writable/lex ordering and pins the encoder output with a
fixture-based regression test that has been validated as wire-valid.
Cuts the Phantom external-wallet path over to FlipcashCore's own Solana
RPC client and transaction encoder. Removes the @preconcurrency import
plus the @retroactive @unchecked Sendable workaround the dependency
required, and pulls TweetNacl in as a direct package since it was
previously transitive through SolanaSwift.
Caches the JSONEncoder and JSONDecoder on the client so a fresh pair
isn't allocated per call. Hoists the encoded-bytes test fixture decode
to a static, and trims doc comments that restated the name without
adding constraint or rationale.
The init paired an optional rpc parameter with a nil-coalesce to a
default client, which was just a roundabout way of expressing a
default value. There's no scenario where an absent RPC is meaningful,
so the parameter takes the production client as its default directly.
@raulriera raulriera force-pushed the refactor/replace-solana-swift branch from 6bdfb7a to 287ca11 Compare May 9, 2026 02:44
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.

1 participant