Skip to content

refactor(tron-wallet-snap): rename SNAP_SPECIAL_ASSETS to SNAP_OWNED_ASSETS - #92

Draft
ulissesferreira wants to merge 12 commits into
WPN-1497-snap-adapterfrom
WPN-1497-snap-owned-helpers
Draft

refactor(tron-wallet-snap): rename SNAP_SPECIAL_ASSETS to SNAP_OWNED_ASSETS#92
ulissesferreira wants to merge 12 commits into
WPN-1497-snap-adapterfrom
WPN-1497-snap-owned-helpers

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add SNAP_OWNED_ASSETS constant (with deprecated SPECIAL_ASSETS alias)
  • Add isSnapOwnedAsset() helper and unit tests
  • Update price/token API clients to use the new constant name

Jira

Test plan

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

Stacks on #91 (Step 3/3 shared spine). Merge before choosing Fork X or Y.

@ulissesferreira
ulissesferreira requested a review from a team as a code owner July 31, 2026 21:38
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-snap-adapter branch from 53be776 to b517134 Compare July 31, 2026 21:54
@ulissesferreira ulissesferreira changed the title refactor(tron-wallet-snap): add SNAP_OWNED_ASSETS and isSnapOwnedAsset (WPN-1497) refactor(tron-wallet-snap): rename SNAP_SPECIAL_ASSETS to SNAP_OWNED_ASSETS Jul 31, 2026
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-snap-owned-helpers branch from b67ea64 to 8624473 Compare July 31, 2026 22:18
@ulissesferreira
ulissesferreira marked this pull request as draft August 2, 2026 17:39
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-snap-owned-helpers branch 2 times, most recently from d5876a7 to 81eb154 Compare August 2, 2026 23:20
@cursor
cursor Bot force-pushed the WPN-1497-snap-adapter branch 3 times, most recently from da939f6 to cb7a717 Compare August 4, 2026 10:12
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

@cursoragent rebase with the latest base. then confirm linting is good, and finally that the shasum is correct

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

All three items are done.

Rebase

Rebased WPN-1497-snap-owned-helpers onto the latest WPN-1497-snap-adapter (5e27de91). The base already had the adapter/handler commits, so instead of replaying 13 overlapping commits I reset to the base and cherry-picked only the feature work:

  • db7ae1bc — feat: add SNAP_OWNED_ASSETS and isSnapOwnedAsset
  • 98364004 — style: format snapOwnedAssets test
  • e49c38b9 — fix: update manifest shasum after rebase

Lint

yarn lint passed (formatting, depcheck, deduplication, README checks).

Shasum

Built with ENVIRONMENT=production, then verified with mm-snap manifest:

  • Computed shasum: pWpt5wd49gMnNl6HfD0YHVeyYiOomVOuAFhCgUSgncc=
  • Manifest shasum: matches (committed in e49c38b9)
  • mm-snap manifest reports: "The Snap manifest file is valid."

Tests

yarn workspace @metamask/tron-wallet-snap run test passed.

The branch has been force-pushed and PR #92 is updated: #92

Open in Web Open in Cursor 

@cursor
cursor Bot force-pushed the WPN-1497-snap-owned-helpers branch from 81eb154 to e49c38b Compare August 4, 2026 10:39
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

@cursoragent update the shasum for this

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Updated the manifest shasum to match what Linux CI computes.

  • Before: pWpt5wd49gMnNl6HfD0YHVeyYiOomVOuAFhCgUSgncc= (local build)
  • After: TEEXgH0mFwQ1x70iGzw0kNN7P/lPzIiLa+ATCM2v/vY= (Linux CI)

CI was failing because the build step auto-corrects the shasum on Linux, leaving a dirty working tree. The fix is committed in 2242a066 and pushed to PR #92.

Open in Web Open in Cursor 

…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.
Move import suppressions to SnapAssetsAdapter and align test assertions
with jest prefer-strict-equal rules.
ulissesferreira and others added 7 commits August 4, 2026 14:41
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Align test file formatting with lint:misc:check expectations.
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-snap-owned-helpers branch from 2242a06 to 8d95d05 Compare August 4, 2026 13:45
@cursor
cursor Bot force-pushed the WPN-1497-snap-adapter branch 2 times, most recently from a122613 to 772082a Compare August 4, 2026 16:23
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