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 11 commits 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; |
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>
…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>
…apter After rebasing onto main, CoreAssetsAdapter still imported the removed createPrefixedLogger/ILogger API. Align it with SnapAssetsAdapter and the shared snap-networks-utils Logger. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
bd729d6 to
f448913
Compare
Match SnapAssetsAdapter after the shared logger migration so tests can pass mockLogger instead of constructing ConfigProvider at import time. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
…y types Skip signature fetches when a token asset has no pubkey, type the adapter scope mocks, and map only defined controller assets. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
The production bundle hashes secrets that are only available in GitHub Actions, so the committed shasum has to match the CI-computed value. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
|
@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). |
Transaction history looks up signatures by token-account address, so Core-mapped SPL tokens need a pubkey. Derive each associated token account from the mint's token program (including Token-2022) and keep TokenAsset.pubkey required. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
… null-asset paths Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>


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