feat(solana-wallet-snap): add read-only CoreAssetsAdapter and mapControllerAsset - #122
Draft
ulissesferreira wants to merge 4 commits into
Conversation
4 tasks
4 tasks
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
Bot
force-pushed
the
ulissesferreira/wpn-1652-core-assets-adapter-6620
branch
from
August 14, 2026 15:40
852614d to
dc2ee18
Compare
…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>
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
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.
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
AssetsProviderintoAssetsService.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.
endowment:messenger,types/core-messenger.ts,AssetsProvider,RemoteFeatureFlagsProvider)mapControllerAssetthat maps controller metadata/balances only. It does not derive associated token account (ATA) pubkeys viafindAssociatedTokenPda— Core does not store ATAs, Send already computes them with the correct token program (including Token-2022), and hardcodedTOKEN_PROGRAM_ADDRESSwould be wrong for Token-2022TokenAsset.pubkeyis optional: present on Snap-fetched RPC token accounts, omitted on Core-mapped assetsCoreAssetsAdapter(AssetsController reads only). Nofetch/saveMany/isSnapOwnedAssetNFT pathCoreAssetsAdapterinsnapContextand store it onAssetsServiceunused (eslint-ignored reserved slot)AssetsServicestays a thin facade overSnapAssetsAdapterReferences
ifrouting through Core (#123)Checklist