Skip to content

refactor(tron-wallet-snap): extract SnapAssetsAdapter from existing AssetsService logic - #91

Draft
ulissesferreira wants to merge 7 commits into
WPN-1497-handlers-and-renamesfrom
WPN-1497-snap-adapter
Draft

refactor(tron-wallet-snap): extract SnapAssetsAdapter from existing AssetsService logic#91
ulissesferreira wants to merge 7 commits into
WPN-1497-handlers-and-renamesfrom
WPN-1497-snap-adapter

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extract legacy assets logic into adapters/SnapAssetsAdapter.ts
  • Replace AssetsService with a thin facade that delegates all public methods to the snap adapter

Jira

Test plan

  • yarn workspace @metamask/tron-wallet-snap build
  • yarn workspace @metamask/tron-wallet-snap run test

Stacks on #90 (Step 2/3).

…rvice

Move existing assets logic into SnapAssetsAdapter and keep AssetsService as a
thin facade that always delegates to the Snap adapter. Behavior unchanged;
prepares for a later Core adapter / feature-flag routing PR.
Adapter lives one directory deeper than AssetsService; bump client,
constants, and types imports to ../../../ and ../types respectively.
Update the manifest shasum, cover AssetsService facade delegation in tests,
and use SnapAssetsAdapter.isFiat inside the adapter implementation.
Comment thread packages/tron-wallet-snap/src/services/assets/adapters/SnapAssetsAdapter.ts Dismissed
Comment thread packages/tron-wallet-snap/src/services/assets/adapters/SnapAssetsAdapter.ts Dismissed
Comment thread packages/tron-wallet-snap/src/services/assets/adapters/SnapAssetsAdapter.ts Dismissed
Comment thread packages/tron-wallet-snap/src/services/assets/adapters/SnapAssetsAdapter.ts Dismissed
Comment thread packages/tron-wallet-snap/src/services/assets/adapters/SnapAssetsAdapter.ts Dismissed
@ulissesferreira ulissesferreira changed the title refactor(tron-wallet-snap): extract SnapAssetsAdapter behind AssetsService (WPN-1497) refactor(tron-wallet-snap): extract SnapAssetsAdapter from existing AssetsService logic Jul 31, 2026
Move import suppressions to SnapAssetsAdapter and align test assertions
with jest prefer-strict-equal rules.
@ulissesferreira
ulissesferreira requested a review from a team as a code owner July 31, 2026 22:01
The previous shasum was generated on macOS and did not match the bundle
produced by CI on Linux, causing dirty-working-tree failures in build and test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants