refactor(tron-wallet-snap): convert enums to as const objects - #218
Merged
Conversation
as const objects
as const objectsas const objects
ulissesferreira
force-pushed
the
refactor/ban-enums-tron
branch
from
August 27, 2026 09:32
6129f03 to
0f390c1
Compare
ulissesferreira
marked this pull request as ready for review
August 27, 2026 09:34
ulissesferreira
force-pushed
the
refactor/ban-enums-tron
branch
from
August 27, 2026 09:34
0f390c1 to
d2afb01
Compare
ulissesferreira
force-pushed
the
refactor/ban-enums-tron
branch
5 times, most recently
from
August 27, 2026 13:05
9ac7299 to
c28bcd9
Compare
ulissesferreira
force-pushed
the
refactor/ban-enums-tron
branch
3 times, most recently
from
August 27, 2026 13:27
5ca7fde to
6193a43
Compare
Julink-eth
reviewed
Aug 27, 2026
ulissesferreira
force-pushed
the
refactor/ban-enums-tron
branch
2 times, most recently
from
August 27, 2026 16:26
3c4f517 to
1be8660
Compare
Convert locally-declared TypeScript enums to `as const` objects with derived union types. BREAKING: Type signatures change - Enum is now a union of string/number literals instead of a nominal enum type. Runtime member access is unchanged.
ulissesferreira
force-pushed
the
refactor/ban-enums-tron
branch
from
August 27, 2026 16:55
08182de to
c2d87d4
Compare
Contributor
|
nit: it's mentioned BREAKING in commit so may have a CHANGELOG update. |
Battambang
approved these changes
Aug 27, 2026
Contributor
Author
It was a mistake, it's not a breaking change. Changed to make sure it's right |
Julink-eth
approved these changes
Aug 28, 2026
Battambang
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Convert locally-declared TypeScript enums in tron-wallet-snap to
as constobjects with derived union types.Refs: MetaMask/utils#280, MetaMask/eslint-config#417
Enums converted
Network,KnownCaip19Id,FeeType,ClientRequestMethod,SendErrorCodes,TransactionScanType,TransactionStatus,TransactionType,AnalyticsEventType,SnapFunction,ResourceTypeValidation
tsc --noEmitpasses (only pre-existing baseline errors)enumdeclarations remaining in tron-wallet-snap