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 |
11fe525 to
eef1038
Compare
|
@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 |
| 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
|
@cursoragent The changes here are missing a lint run + fix and also have disorganized commits which are hard to review. Fix lint problems and suggest a possible list of commits that make sense for this. Make sure the read assets methods are lean and as logically simple as possible |
|
Fixed lint failures, simplified the read API, and pushed commit Lint fixes
Also ran Read API simplificationThe four read methods are now leaner:
All 95 tests in the affected suites pass. Suggested commit structureThe current history has noise (
The lint cleanup and read-API simplification from this turn fold into commits 1–2 above. Drop To apply: |
… snap-networks-utils Add getAccountAssetByID, getAccountAssetsByIDs, getAccountAssetsByScope, and getAccountAssets on AssetsService, wire accountsService for account lookup, and cover the read helpers with unit tests. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
…rvice read API Switch Keyring asset listing/balances and Send balance lookups to the new read methods, remove unused SendService variables, and prune stale eslint suppressions. Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
541bae1 to
7a154fb
Compare
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
7a154fb to
5d407ac
Compare


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 suppressionKeyringfields (configProvider,traceName) and prune stale eslint suppressionsgetAccountAssetsfetches once and filters by active networks;getAccountAssetsByIDsuses aMapfor lookupsmain(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