Skip to content

feat(tron-wallet-snap): add CoreAssetsAdapter and mapControllerAsset - #144

Merged
ulissesferreira merged 9 commits into
mainfrom
WPN-1497-implement-core-assets-adapter
Aug 14, 2026
Merged

feat(tron-wallet-snap): add CoreAssetsAdapter and mapControllerAsset#144
ulissesferreira merged 9 commits into
mainfrom
WPN-1497-implement-core-assets-adapter

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add CoreAssetsAdapter and mapControllerAsset for AssetsController integration
  • Wire CoreAssetsAdapter in context.ts and store it on AssetsService unused (eslint-ignored reserved slot)
  • Runtime behavior remains Snap-only

Part of WPN-1497. Stack:

  1. refactor(tron-wallet-snap): extract shared asset utils and inject SnapAssetsAdapter #143
  2. feat(tron-wallet-snap): add CoreAssetsAdapter and mapControllerAsset #144 (this PR)
  3. feat(tron-wallet-snap): route asset reads through Core when migration is on #145

Test plan

  • yarn workspace @metamask/tron-wallet-snap run build
  • yarn workspace @metamask/tron-wallet-snap run jest --no-coverage src/services/assets/AssetsService.test.ts src/services/assets/utils/mapControllerAsset.test.ts
  • Confirm Core adapter is constructed but no read/write path uses it yet

Comment thread packages/tron-wallet-snap/src/services/assets/adapters/CoreAssetsAdapter.ts Outdated
Comment thread packages/tron-wallet-snap/src/services/assets/adapters/CoreAssetsAdapter.ts Outdated
Comment thread packages/tron-wallet-snap/src/services/assets/adapters/CoreAssetsAdapter.ts Outdated
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-implement-core-assets-adapter branch 3 times, most recently from c075319 to 69e150f Compare August 14, 2026 12:49
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-implement-core-assets-adapter branch from 69e150f to cc94a88 Compare August 14, 2026 12:49

@stanleyyconsensys stanleyyconsensys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just minor nit pick, can choose to fix or fix later

this.#getAddressStakingRewards(scope, account.address),
]);

if (addressInfoRequest.status === 'rejected') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is super nit:

i didnt go detail
but when we say reject, is it a http temporary fail issue, or it is a error saying account not found?
may be we can consider to check the reason

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thinking! Opening a PR with this!

const stakedData = buildStakedData(addressInfoRequest);
const resources = buildAccountResources(addressResourcesRequest);
const stakingRewards =
addressStakingRewardsRequest.status === 'fulfilled'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100%

@ulissesferreira
ulissesferreira added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit 38466dd Aug 14, 2026
49 checks passed
@ulissesferreira
ulissesferreira deleted the WPN-1497-implement-core-assets-adapter branch August 14, 2026 13:50
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.

3 participants