Skip to content

refactor(bitcoin-wallet-snap): convert enums to as const objects - #216

Merged
ulissesferreira merged 1 commit into
mainfrom
refactor/ban-enums-bitcoin
Aug 27, 2026
Merged

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

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

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

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

Enums converted

  • CronjobMethod, Slip44, Purpose, Sep43ErrorCode, Fiat, CurrencyUnit, AccountFeature, AddressType, BalanceChangeType, ConfirmationStatus, TransactionType

Breaking changes

  • Type signatures change: Enum is now a union of string/number literals instead of a nominal enum type
  • Runtime values unchanged: Member access (Enum.Member) works the same way

Validation

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

Note

The ESLint ban + create-package script conversion previously in this branch have moved to a dedicated infra PR: #219

@ulissesferreira
ulissesferreira force-pushed the refactor/ban-enums-bitcoin branch from 3ee47ba to 64e6c7a Compare August 27, 2026 09:26
@ulissesferreira ulissesferreira changed the title refactor(bitcoin): convert enums to as const objects refactor(bitcoin): convert enums to 1as const` objects Aug 27, 2026
@ulissesferreira ulissesferreira changed the title refactor(bitcoin): convert enums to 1as const` objects refactor(bitcoin): convert enums to as const objects Aug 27, 2026
@ulissesferreira ulissesferreira changed the title refactor(bitcoin): convert enums to as const objects refactor(bitcoin-wallet-snap): convert enums to as const objects Aug 27, 2026
@ulissesferreira
ulissesferreira force-pushed the refactor/ban-enums-bitcoin branch from 64e6c7a to 4409b99 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 deployed to default-branch August 27, 2026 09:34 — with GitHub Actions Active
@ulissesferreira
ulissesferreira force-pushed the refactor/ban-enums-bitcoin branch from 4409b99 to 0d27834 Compare August 27, 2026 09:34
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-bitcoin branch from 0d27834 to bc25772 Compare August 27, 2026 10:08

@Julink-eth Julink-eth 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 added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit 54108ae Aug 27, 2026
53 checks passed
@ulissesferreira
ulissesferreira deleted the refactor/ban-enums-bitcoin branch August 27, 2026 12:55
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