Skip to content

feat(tron-wallet-snap): use shareable state management lib - #295

Merged
Julink-eth merged 6 commits into
mainfrom
feat/WPN-2058-tron-shared-state
Sep 10, 2026
Merged

feat(tron-wallet-snap): use shareable state management lib#295
Julink-eth merged 6 commits into
mainfrom
feat/WPN-2058-tron-shared-state

Conversation

@Julink-eth

Copy link
Copy Markdown
Contributor

Explanation

  • Switch Tron to the shared @metamask/snap-networks-utils state helpers (IStateManager, State, InMemoryState) from #288.
  • Delete the local State / IStateManager / InMemoryState implementations and drop the now-unused async-mutex dependency.
  • Keep Tron-only state shape in stateTypes.ts (UnencryptedStateValue / DEFAULT_UNENCRYPTED_STATE).
  • Wire context.ts with new State({ encrypted: false, defaultState: DEFAULT_UNENCRYPTED_STATE }) and type consumers as IStateManager.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@Julink-eth
Julink-eth requested a review from a team as a code owner September 9, 2026 13:49
@Julink-eth
Julink-eth requested a review from a team as a code owner September 9, 2026 13:49
@Julink-eth
Julink-eth deployed to default-branch September 9, 2026 13:49 — with GitHub Actions Active
@Julink-eth

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@Julink-eth

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/bitcoin-wallet-snap@2.0.1-preview-5ec83160
@metamask-previews/snap-networks-utils@1.0.0-preview-5ec83160
@metamask-previews/solana-wallet-snap@6.0.0-preview-5ec83160
@metamask-previews/stellar-wallet-snap@0.1.0-preview-5ec83160
@metamask-previews/tron-wallet-snap@3.2.0-preview-5ec83160

Comment on lines 202 to 204

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.

Maybe the deleteKeys from the shared lib can be used there?

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.

Good catch, updated.

import type { AssetEntity } from '../../entities/assets';
import type { TronKeyringAccount } from '../../entities/keyring-account';

export type AccountId = string;

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.

May worth to consider Sonar message for this raising with redundant type alias.

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.

Agreed, updated.

@sonarqubecloud

Copy link
Copy Markdown

@Julink-eth
Julink-eth added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit 8d1a4f6 Sep 10, 2026
95 checks passed
@Julink-eth
Julink-eth deleted the feat/WPN-2058-tron-shared-state branch September 10, 2026 09:33
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