feat(solana-wallet-snap): add read-only CoreAssetsAdapter and mapControllerAsset - #122
feat(solana-wallet-snap): add read-only CoreAssetsAdapter and mapControllerAsset#122ulissesferreira wants to merge 1 commit into
Conversation
852614d to
dc2ee18
Compare
|
@cursoragent rebase with latest main and then make sure the CI is green |
|
Rebased After rebase, Main CI is green — lint, build, and all package tests passed. The PR is mergeable; |
bd729d6 to
f448913
Compare
|
@cursoragent this PR is almost perfect but we are missing an essential part, |
|
It fetches the mint (cached) and uses that mint’s token program with Main CI is green on #122 (lint, build, and Solana package tests). |
a41425b to
6808311
Compare
6808311 to
d3c53ff
Compare


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