Skip to content

[NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController - #78

Closed
ulissesferreira wants to merge 17 commits into
mainfrom
ASSETS-2-non-feature-flagged
Closed

[NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController#78
ulissesferreira wants to merge 17 commits into
mainfrom
ASSETS-2-non-feature-flagged

Conversation

@ulissesferreira

Copy link
Copy Markdown
Contributor

Summary

  • Adds Core messenger types and endowment so the Tron snap can call AssetsController actions from MetaMask Core.
  • Routes fungible asset reads through AssetsController unconditionally (no feature flag), using SNAP_OWNED_ASSETS and mapControllerAsset to map controller state into snap-owned assets.
  • Simplifies AssetsService and tests by removing the migration-mode / feature-flag branching path.

Test plan

  • yarn workspace @metamask/tron-wallet-snap build
  • yarn workspace @metamask/tron-wallet-snap run test
  • Verify fungible assets resolve via AssetsController in all environments

Made with Cursor

ulissesferreira and others added 8 commits July 31, 2026 00:55
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Derived from ASSETS-2-feature-flagged. Strips the remote-feature-flag and TRON_ASSETS_MIGRATION_STAGE env surface. Fungibles always read via AssetsController:getAsset. Protocol assets remain Snap-owned via isSnapOwnedAsset. Removed: assetsMigrationMode.ts, its test, and RemoteFeatureFlagController:getState messenger action.
@ulissesferreira
ulissesferreira requested review from a team as code owners July 31, 2026 00:17
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

@cursoragent Do the following

  • Move each set of handlers into their own folders for better readability assets, cronjob, keyring, user-input
  • Rename the AssetsService main functions that are used throughout the code to be getAccountAssetByID, getAccountAssetsByIDs, getAccountAssets

@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

I applied both review requests on ASSETS-2-non-feature-flagged and pushed to #78.

Handler folders

  • handlers/assets/
  • handlers/cronjob/
  • handlers/keyring/ (includes keyring-types)
  • handlers/user-input/

AssetsService renames

  • getAssetByAccountIdgetAccountAssetByID
  • getAssetsByAccountIdgetAccountAssetsByIDs
  • getAllAssetsByAccountIdgetAccountAssets

Imports/usages and changelog were updated. Full package suite: 895 tests passed.

Open in Web Open in Cursor 

Move assets, cronjob, keyring, and user-input handlers into dedicated
folders, and rename AssetsService account asset readers to
getAccountAssetByID, getAccountAssetsByIDs, and getAccountAssets.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@ulissesferreira ulissesferreira changed the title feat: ASSETS-2 — always-on AssetsController for fungibles [NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController as much as possible Jul 31, 2026
@ulissesferreira ulissesferreira changed the title [NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController as much as possible [NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController Jul 31, 2026
@ulissesferreira
ulissesferreira marked this pull request as draft July 31, 2026 10:32
Expose instant fungible asset listing via AssetsController so snap flows
can read controller-backed balances by network without on-chain sync.
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

Superseded by the WPN-1497 chain (#90#91#92#95#96), which ends in two optional tails (direct core vs feature-flagged core). Closing per discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants