Skip to content

refactor(tron-wallet-snap): convert enums to as const objects - #218

Merged
ulissesferreira merged 1 commit into
mainfrom
refactor/ban-enums-tron
Aug 28, 2026
Merged

refactor(tron-wallet-snap): convert enums to as const objects#218
ulissesferreira merged 1 commit into
mainfrom
refactor/ban-enums-tron

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Convert locally-declared TypeScript enums in tron-wallet-snap to as const objects with derived union types.

Refs: MetaMask/utils#280, MetaMask/eslint-config#417

Enums converted

  • Network, KnownCaip19Id, FeeType, ClientRequestMethod, SendErrorCodes, TransactionScanType, TransactionStatus, TransactionType, AnalyticsEventType, SnapFunction, ResourceType

Validation

  • tsc --noEmit passes (only pre-existing baseline errors)
  • ✅ ESLint clean
  • ✅ Zero enum declarations remaining in tron-wallet-snap

@ulissesferreira ulissesferreira changed the title refactor(tron): convert enums to as const objects refactor(tron): convert enums to as const objects Aug 27, 2026
@ulissesferreira ulissesferreira changed the title refactor(tron): convert enums to as const objects refactor(tron-wallet-snap): convert enums to as const objects Aug 27, 2026
@ulissesferreira
ulissesferreira force-pushed the refactor/ban-enums-tron branch from 6129f03 to 0f390c1 Compare August 27, 2026 09:32
@ulissesferreira
ulissesferreira marked this pull request as ready for review August 27, 2026 09:34
@ulissesferreira
ulissesferreira requested a review from a team as a code owner August 27, 2026 09:34
@ulissesferreira
ulissesferreira force-pushed the refactor/ban-enums-tron branch from 0f390c1 to d2afb01 Compare August 27, 2026 09:34
@ulissesferreira
ulissesferreira force-pushed the refactor/ban-enums-tron branch 5 times, most recently from 9ac7299 to c28bcd9 Compare August 27, 2026 13:05
taran-a
taran-a previously approved these changes Aug 27, 2026

@taran-a taran-a 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

@ulissesferreira
ulissesferreira force-pushed the refactor/ban-enums-tron branch 3 times, most recently from 5ca7fde to 6193a43 Compare August 27, 2026 13:27
Comment thread packages/tron-wallet-snap/src/services/send/types.ts
@ulissesferreira
ulissesferreira force-pushed the refactor/ban-enums-tron branch 2 times, most recently from 3c4f517 to 1be8660 Compare August 27, 2026 16:26
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
ulissesferreira force-pushed the refactor/ban-enums-tron branch from 08182de to c2d87d4 Compare August 27, 2026 16:55
@Battambang

Copy link
Copy Markdown
Contributor

nit: it's mentioned BREAKING in commit so may have a CHANGELOG update.

@ulissesferreira

Copy link
Copy Markdown
Contributor Author

nit: it's mentioned BREAKING in commit so may have a CHANGELOG update.

It was a mistake, it's not a breaking change. Changed to make sure it's right

@ulissesferreira
ulissesferreira added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit 9b6fab3 Aug 28, 2026
53 checks passed
@ulissesferreira
ulissesferreira deleted the refactor/ban-enums-tron branch August 28, 2026 10:11
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.

4 participants