Skip to content

feat(solana-wallet-snap): add read-only CoreAssetsAdapter and mapControllerAsset - #122

Draft
ulissesferreira wants to merge 4 commits into
ulissesferreira/wpn-1652-snap-assets-adapter-6620from
ulissesferreira/wpn-1652-core-assets-adapter-6620
Draft

feat(solana-wallet-snap): add read-only CoreAssetsAdapter and mapControllerAsset#122
ulissesferreira wants to merge 4 commits into
ulissesferreira/wpn-1652-snap-assets-adapter-6620from
ulissesferreira/wpn-1652-core-assets-adapter-6620

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Explanation

Part of migrating the Solana assets-controller staged migration into this monorepo (PR 3 of 6). Follows the Tron WPN-1497 approach from #144 rather than injecting unused AssetsProvider into AssetsService.

Solana is simpler than Tron: there are no snap-owned assets (no staking/energy/bandwidth equivalents, and NFTs are not Snap-managed). That means Core does not need address monitoring, fetch of snap-owned balances, or keyring-event publishing.

  • Add Core messenger plumbing (endowment:messenger, types/core-messenger.ts, AssetsProvider, RemoteFeatureFlagsProvider)
  • Add mapControllerAsset that maps controller metadata/balances only. It does not derive associated token account (ATA) pubkeys via findAssociatedTokenPda — Core does not store ATAs, Send already computes them with the correct token program (including Token-2022), and hardcoded TOKEN_PROGRAM_ADDRESS would be wrong for Token-2022
  • TokenAsset.pubkey is optional: present on Snap-fetched RPC token accounts, omitted on Core-mapped assets
  • Add a read-only CoreAssetsAdapter (AssetsController reads only). No fetch / saveMany / isSnapOwnedAsset NFT path
  • Wire CoreAssetsAdapter in snapContext and store it on AssetsService unused (eslint-ignored reserved slot)
  • Runtime behavior remains Snap-only — AssetsService stays a thin facade over SnapAssetsAdapter

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
Open in Web Open in Cursor 

@ulissesferreira ulissesferreira changed the title feat(WPN-1652): add Core messenger plumbing for Solana AssetsProvider feat(solana-wallet-snap): add Core messenger plumbing for Solana AssetsProvider Aug 6, 2026
Introduce CoreAssetsAdapter with AssetsController reads and snap-owned
publish helpers, plus mapControllerAsset / isSnapOwnedAsset. Wire Core
messenger plumbing and store the adapter on AssetsService unused pending
routing.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@cursor
cursor Bot force-pushed the ulissesferreira/wpn-1652-core-assets-adapter-6620 branch from 852614d to dc2ee18 Compare August 14, 2026 15:40
@cursor cursor Bot changed the title feat(solana-wallet-snap): add Core messenger plumbing for Solana AssetsProvider feat(solana-wallet-snap): add CoreAssetsAdapter and mapControllerAsset Aug 14, 2026
cursoragent and others added 3 commits August 14, 2026 15:46
…c manifest shasum

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Solana has no snap-owned assets, so CoreAssetsAdapter is read-only
(no fetch/saveMany/NFT publishing) and mapControllerAsset no longer
derives associated token account addresses. TokenAsset.pubkey is
optional for Core-mapped balances.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
…er cleanup

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@cursor cursor Bot changed the title feat(solana-wallet-snap): add CoreAssetsAdapter and mapControllerAsset feat(solana-wallet-snap): add read-only CoreAssetsAdapter and mapControllerAsset Aug 14, 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.

2 participants