Skip to content

feat: support entropy input formats - #33

Merged
Drincann merged 1 commit into
mainfrom
feat/entropy-option
Jun 10, 2026
Merged

feat: support entropy input formats#33
Drincann merged 1 commit into
mainfrom
feat/entropy-option

Conversation

@Drincann

@Drincann Drincann commented Jun 10, 2026

Copy link
Copy Markdown
Owner

PR Type

Enhancement, Tests


Description

  • Add prefixed entropy input support

  • Support hex entropy during wallet creation

  • Display mnemonic entropy in wallet show

  • Cover entropy flows with E2E tests


Diagram Walkthrough

flowchart LR
  create["wallet create"]
  parse["Parse 0x/0b entropy"]
  mnemonic["Generate mnemonic"]
  show["wallet show --entropy"]
  hex["Display entropy hex"]

  create -- "accepts --entropy" --> parse
  parse -- "feeds buffer" --> mnemonic
  show -- "converts mnemonic" --> hex
Loading

File Walkthrough

Relevant files
Tests
wallet-lifecycle.test.ts
Add E2E coverage for entropy formats                                         

tests/e2e/wallet-lifecycle.test.ts

  • Updates entropy creation tests to use --entropy.
  • Adds binary entropy coverage with 0b prefix.
  • Adds hex entropy coverage with 0x prefix.
  • Verifies wallet show --entropy outputs hex entropy.
+25/-4   
Enhancement
create.mts
Support formatted entropy for wallet creation                       

src/cli/commands/wallet/create.mts

  • Replaces --entropy-bits with --entropy.
  • Accepts entropy in 0x... or 0b... format.
  • Converts validated entropy into a mnemonic buffer.
  • Adds validation and trimming for formatted entropy.
+35/-13 
show.mts
Add entropy display to wallet show                                             

src/cli/commands/wallet/show.mts

  • Adds --entropy option for wallet details.
  • Prints entropy as 0x-prefixed hexadecimal.
  • Supports entropy display for wallet references.
  • Adds typed options for show command handling.
+12/-3   
mnemonic.mts
Expose mnemonic entropy conversion helper                               

src/crypto/mnemonic.mts

  • Adds entropyHexOf helper.
  • Converts mnemonic words back to BIP39 entropy.
  • Exposes entropy conversion for CLI display.
+4/-0     

@Drincann
Drincann merged commit 2925dea into main Jun 10, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

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