Skip to content

feat(solana-wallet-snap): use shareable state management lib - #294

Open
Julink-eth wants to merge 4 commits into
mainfrom
feat/WPN-2057-solana-shared-state
Open

feat(solana-wallet-snap): use shareable state management lib#294
Julink-eth wants to merge 4 commits into
mainfrom
feat/WPN-2057-solana-shared-state

Conversation

@Julink-eth

Copy link
Copy Markdown
Contributor

Explanation

  • Switch Solana to the shared @metamask/snap-networks-utils state helpers (IStateManager, State, InMemoryState) from #288
  • Delete the local State / IStateManager / InMemoryState implementations and drop the now-unused async-mutex dependency.
  • Keep Solana-only state shape in stateTypes.ts (UnencryptedStateValue / DEFAULT_UNENCRYPTED_STATE).
  • Keep the legacy assets purge outside the shared class: registerStateMigration still runs on onStart / onUpdate / onInstall (old State constructor behavior). That key was replaced by assetEntities; existing installs still need the cleanup.
  • Delete-account now uses one deleteKeys() call instead of three parallel deleteKey()s.

Not client-breaking: JSON-RPC surface and persisted state format are unchanged. deleteKey now unsets the path (same as Tron/Stellar and Solana’s old test double) instead of writing serialized undefined.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@Julink-eth
Julink-eth requested review from a team as code owners September 9, 2026 13:25
@Julink-eth
Julink-eth deployed to default-branch September 9, 2026 13:26 — with GitHub Actions Active
@Julink-eth

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/bitcoin-wallet-snap@2.0.1-preview-d6a148d0
@metamask-previews/snap-networks-utils@1.0.0-preview-d6a148d0
@metamask-previews/solana-wallet-snap@6.0.0-preview-d6a148d0
@metamask-previews/stellar-wallet-snap@0.1.0-preview-d6a148d0
@metamask-previews/tron-wallet-snap@3.2.0-preview-d6a148d0

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant