feat: discover Solana wallets through the Wallet Standard (P-2416) - #386
Conversation
… are captured with any wallet library Solana capture was opt-in and needed framework-kit's store, so wallet-adapter, Privy, Dynamic, Reown and custom apps produced no connect events. A new SolanaWalletStandardRegistry runs the Wallet Standard handshake inline, emits detect on registration, and diffs each wallet's accounts into connect and disconnect. It is on by default (solana: false opts out); while a framework-kit store is attached it leaves connect/disconnect to the store so each connection is reported once. Also fixes the SolanaClusterState.status type drift, tracks the option in computeOptionsKey, rewrites docs/SOLANA_INTEGRATION.md, and raises the size budget to 61 KB. Fixes P-2416. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015USSsGzRcCswNCNv6eTc8X
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
|
Addressed all nine review findings in 73a332b:
Validation: 1,283 tests pass; lint, build, and size-limit pass. The compressed bundle is 61.19 KB under the updated 61.5 KB budget. |
There was a problem hiding this comment.
All reported issues were addressed across 11 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Addressed all three follow-up findings in 4f346b4:
Added a regression test for each case. Full validation now passes: 1,286 tests, lint, build, and size-limit (61.21 KB / 61.5 KB). |
|
Manual browser validation completed against a locally linked production build and the
The test-only diagnostics and no-store example configuration were removed afterward. The SDK worktree is clean and the full suite still passes: 1,286 tests plus build. |
|
Final compatibility hardening landed in 6182892: the exported cluster state now accepts both framework-kit’s object status union and the pre-1.39 legacy string form, so custom stores/test doubles keep compiling. Added a regression test. Final local validation: 1,287 tests, lint, build, and size-limit (61.21 KB / 61.5 KB). |
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
`setCluster()` moved only the registry's own snapshot when `autocapture.chain` was false, because central state is written inside `FormoAnalytics.chain()`. A devnet switch then left `currentChainId` on mainnet-beta, so later events carried the stale chain and `excludeChains` gated against it. The EVM tracker already separates observing a chain from reporting one; the registry now does the same through `syncWalletState`, and stays silent while a framework-kit store owns wallet events and syncs its own state. Also: name both identities when a late-attached store cannot adopt the connection the registry reported, so the resulting double connect is visible in the logs; drop the unused `connectedAccount` getter; stop claiming `solana: false` in the `setStore` warning, which a cleaned-up SDK also reaches; restore two unrelated whitespace deletions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y4qyDhFa9MTfvvGiA8SEhM
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/solana/SolanaWalletStandardRegistry.ts">
<violation number="1" location="src/solana/SolanaWalletStandardRegistry.ts:472">
P2: When multiple Wallet Standard wallets remain connected and chain autocapture is off, this loop makes the last registered wallet the active wallet even if another connected later. Preserve the active wallet when syncing the cluster instead of syncing every tracked wallet.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
The cluster sync wrote central wallet state for every connected wallet, so two wallets holding an authorized account at once handed the wallet slot to the last REGISTERED one. The SDK's rule is last CONNECTED wins. Central state now follows a single wallet: the one the SDK already treats as active, and otherwise the first connected wallet. Reported by cubic on #386. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y4qyDhFa9MTfvvGiA8SEhM
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Solflare, not Phantom, is the wallet that registers and connects last in that test. `currentAddress` is what pins the active wallet to Phantom, which is the point: registration order must not take the slot from it. Reported by cubic on #386. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y4qyDhFa9MTfvvGiA8SEhM
Fixes P-2416.
Problem
Solana wallet capture required framework-kit's store. Apps using Solana Kit, wallet-adapter, or another integration with a Wallet Standard wallet could produce no Solana
connectevents and no error.Fix
detect,connect, anddisconnectfor compatible wallets registered with the page, including wallets used through Solana Kit, wallet-adapter, and framework-kit.options.solana.cluster(orformo.solana.setCluster()) because Wallet Standard does not expose the app's active cluster.sol.wallet.*identifiers and legacy string cluster-status types.solana: falseis the explicit opt-out.Compatibility
Existing
solana: { store }andsolana: { cluster }integrations remain valid. The implementation is dependency-free and does not issue wallet or RPC requests. Signatures and transactions outside a framework-kit store remain explicit SDK calls.Validation
Companion PRs: docs #153, examples #338.