refactor(snap-solana-wallet): align Solana AssetsService read API with snap-networks-utils - #120
Conversation
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
f5ec399 to
ed3340c
Compare
515bebf to
0f8d17f
Compare
|
@cursoragent rebase latest main and make sure the CI is green |
…ks-utils Add getAccountAssetByID, getAccountAssetsByIDs, getAccountAssetsByScope, and getAccountAssetsForAllActiveScopes. Update Keyring, Send, send render, and refreshSend to use the new API. No behavior change — still reads from Snap-owned assetEntities via AssetsRepository. Migrated from MetaMask/snap-solana-wallet#635. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Drop unused catch binding and account assignment left after the AssetsService read API migration, and prune the stale suppression. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Remove getAccountAssetsForAllActiveScopes and use Promise.all with getAccountAssetsByScope per active scope in Keyring. Refactor getAccountAssetsByIDs to resolve assets via getAccountAssetsByScope. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
11fe525 to
eef1038
Compare
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
|
@cursoragent in this migration make sure the calls to the AssetsService are all one of the following method names: getAccountAssetByID, getAccountAssetsByIDs, getAccountAssetsByScope, getAccountAssets where the return types follow a similar logic to the AssetsProvider first 3 methods. Not the same return type, but similar takes on single element, map, array and array |
|
Aligned the migration with the four-method read API you specified. Changes
The previous |
Route Keyring asset listing through AssetsService.getAccountAssets instead of calling getAccountAssetsByScope per active scope. Keeps the four-method read surface: single, map-by-ID, scoped array, and full array. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
| let mockKeyringAccountMonitor: KeyringAccountMonitor; | ||
| let mockConfigProvider: ConfigProvider; | ||
|
|
||
| beforeEach(() => { |
There was a problem hiding this comment.
This, in the future, will probably be removed in favour of a setup function


Explanation
Part of migrating the Solana assets-controller staged migration from snap-solana-wallet#635 into this monorepo (PR 1 of 6, Lane A / feature-flag path only).
AssetsService:getAccountAssetByID,getAccountAssetsByIDs,getAccountAssetsByScope,getAccountAssetsaccountsServiceintoAssetsService(needed for account lookup by ID)assetEntitiesviaAssetsRepositorymain(includes chore(solana-wallet-snap): deprecate pre-Unified Send Flow code #130 removal of legacy send UI /refreshSendcron — those paths are no longer updated here)Read API surface
Migration call sites use only these four methods, with return shapes aligned to
AssetsProvider/ AssetsController patterns (single element, map-by-ID, scoped array, full array):getAccountAssetByIDAssetEntity | nullgetAccountAssetsByIDsRecord<string, AssetEntity | null>getAccountAssetsByScopeAssetEntity[]getAccountAssetsAssetEntity[]CI babysit fixes
SendServiceand prune the stale suppressionmain(Release/6.0.0 + chore(solana-wallet-snap): deprecate pre-Unified Send Flow code #130 send-flow deprecation)snap.manifest.jsonshasum with the CI production build after rebaseReferences
#90)WPN-1652-snap-assets-adapter(extractSnapAssetsAdapter)Checklist