Skip to content

feat(tron-wallet-snap): use shareable permissions helpers in Tron snap - #204

Open
Julink-eth wants to merge 6 commits into
mainfrom
feat/WPN-1923-use-shared-origin-permissions-in-tron-snap
Open

feat(tron-wallet-snap): use shareable permissions helpers in Tron snap#204
Julink-eth wants to merge 6 commits into
mainfrom
feat/WPN-1923-use-shared-origin-permissions-in-tron-snap

Conversation

@Julink-eth

Copy link
Copy Markdown
Contributor

Explanation

Replace the Tron snap’s local origin-permission map wiring and validateOrigin with the shared helpers from @metamask/snap-networks-utils, matching the pattern introduced in #193.

  • permissions.ts still owns the method lists and ENVIRONMENT !== 'production' toggle. The map is built with createOriginPermissions: localhost + dapp methods in non-prod, Portfolio + empty dapp set in prod.
  • Keyring and RPC handlers call validateOrigin(origin, method, originPermissions) from the shared package. The local wrapper in validators.ts is removed.
    Permission surface is unchanged.

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 August 26, 2026 13:41
@Julink-eth
Julink-eth deployed to default-branch August 26, 2026 13:41 — with GitHub Actions Active
@Julink-eth Julink-eth changed the title feat: use shareable permissions helepers in Tron snap feat(tron-wallet-snap): use shareable permissions helepers in Tron snap Aug 26, 2026
@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-523ffa46
@metamask-previews/snap-networks-utils@1.0.0-preview-523ffa46
@metamask-previews/solana-wallet-snap@6.0.0-preview-523ffa46
@metamask-previews/stellar-wallet-snap@0.1.0-preview-523ffa46
@metamask-previews/tron-wallet-snap@3.1.0-preview-523ffa46

@Julink-eth Julink-eth changed the title feat(tron-wallet-snap): use shareable permissions helepers in Tron snap feat(tron-wallet-snap): use shareable permissions helpers in Tron snap Aug 26, 2026
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.

1 participant