Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cast): add json flag in cast wallet new-mnemonic #9139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

leovct
Copy link
Contributor

@leovct leovct commented Oct 18, 2024

Motivation

Closes #9138

Solution

$ castdev wallet new-mnemonic --entropy 0xdf9bf37e6fcdf9bf37e6fcdf9bf37e3c --accounts 3 --json
[
  {
    "mnemonic": "test test test test test test test test test test test junk",
    "accounts": [
      {
        "address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
        "private_key": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
      },
      {
        "address": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
        "private_key": "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
      },
      {
        "address": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
        "private_key": "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"
      }
    ]
  }
]
$ castdev wallet new-mnemonic --entropy 0xdf9bf37e6fcdf9bf37e6fcdf9bf37e3c --accounts 3 --json | jq '.[0].mnemonic'
"test test test test test test test test test test test junk"
$ castdev wallet new-mnemonic --entropy 0xdf9bf37e6fcdf9bf37e6fcdf9bf37e3c --accounts 3 --json | jq '.[0].accounts[0].address' 
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"

@leovct leovct marked this pull request as ready for review October 18, 2024 12:50
@leovct leovct force-pushed the feat/cast-wallet-new-mnemonic-json-mode branch from 8be4c32 to 2eb9d7a Compare October 19, 2024 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat(cast): add --json flag in cast wallet new-mnemonic
2 participants