Repository navigation
chore(solana): type the Solana asset services - #632
Open
ulissesferreira wants to merge 2 commits into
Open
ulissesferreira wants to merge 2 commits into
ulissesferreira wants to merge 2 commits into
Conversation
ulissesferreira
temporarily deployed
to
default-branch
November 17, 2026 02:14 — with
GitHub Actions
Inactive
|
This branch was previously deployed
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.



Description
Removes every Oxlint suppression in the Solana snap's asset services. The bulk of the diff is typing, not refactoring:
TokenHelpernow narrows the token-2022 mint extension union with type predicates instead of handlinganyextension objects, the asset service tests describe their mocked RPC/client shapes with real types (andassertfor fixture narrowing) instead ofas any, and three conditionals in test setup becamemockResolvedValueOnce/mockRejectedValueOncechains. Two dead private members inSnapAssetsAdapterwere removed:#getNftsMetadataand#fetchNftAssetswere only ever referenced from commented-out NFT call sites, so their callers, helper types and imports went with them. Behaviour is unchanged: the removed code was unreachable,isIncrementalstill short-circuits the same way, and the assertions removed were no-ops at the type level.Changes
packages/solana-wallet-snap/src/core/services/assets/TokenHelper.ts— type the token-2022Extensionunion withExtract<…>predicates instead ofany; importBigNumberas a named export; drop the unused caughterrorbindings;Number()the bigint effective-timestamp before comparing with the epoch-seconds number (no-explicit-any,no-unsafe-member-access,no-unsafe-argument,no-unsafe-assignment,no-unused-vars,no-named-as-default)packages/solana-wallet-snap/src/core/services/assets/TokenHelper.test.ts— type the interest-bearing extension fixture as the real extension variant (no-explicit-any)packages/solana-wallet-snap/src/core/services/assets/AssetsService.ts— drop the redundantas Record<…>onObject.fromEntries(no-unnecessary-type-assertion)packages/solana-wallet-snap/src/core/services/assets/AssetsService.test.ts— type theglobalThis.snapstub and the mockedgetRpc()return values withunknown+ReturnType<SolanaConnection['getRpc']>; delete the twoit.skipblocks that asserted the removed non-incremental event behaviour (no-explicit-any,no-unsafe-member-access,no-unsafe-argument,no-disabled-tests)packages/solana-wallet-snap/src/core/services/assets/adapters/SnapAssetsAdapter.ts— remove the dead#getNftsMetadata/#fetchNftAssetsand the commented-out call sites that referenced them; run the sync metadata call outsidePromise.all; drop two redundant casts (no-unused-private-class-members,await-thenable,no-unnecessary-type-assertion)packages/solana-wallet-snap/src/core/services/assets/adapters/SnapAssetsAdapter.test.ts— narrow the fixture token account withassertfrom@metamask/utils(no-conditional-in-test)packages/solana-wallet-snap/src/core/services/assets/adapters/CoreAssetsAdapter.test.ts— drop the redundantas Asset; replace scope-branching mock implementations withmockResolvedValueOnce/mockRejectedValueOncechains (no-unnecessary-type-assertion,no-conditional-in-test)packages/solana-wallet-snap/src/core/services/assets/utils/mapControllerAsset.ts— drop the redundantas TokenAsset(no-unnecessary-type-assertion)oxlint-suppressions.json— regenerated with--prune-suppressions(45 violations removed across the 8 files above)The NFT client is no longer stored on
SnapAssetsAdapter; the constructor option stays in the contract becausesnapContext.tsstill builds and passes it (removing the option is a follow-up that touches that caller).Quality gates
yarn lint:oxlint packages/solana-wallet-snap— clean, 45 suppressions entries removedtsc --noEmit— cleanvitest run— 88 files, 1124 passed | 2 skipped | 1 todo (the 2 skips deleted here were theno-disabled-testsblocks)oxfmt --check— cleanyarn lint:misc:check— clean