-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Karl Ranna
committed
Jan 28, 2021
1 parent
b12a01e
commit 8007801
Showing
16 changed files
with
1,851 additions
and
796 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Arguments } from 'yargs'; | ||
import { GetMnemonicRequest, GetEthMnemonicResponse } from '../../proto/xudrpc_pb'; | ||
import { callback, loadXudClient } from '../command'; | ||
import { ethers } from 'ethers'; | ||
|
||
const formatOutput = (response: GetEthMnemonicResponse.AsObject) => { | ||
const { seedMnemonic } = response; | ||
console.log(`Your Ethereum account mnemonic seed is: "${seedMnemonic}"`); | ||
const wallet = ethers.Wallet.fromMnemonic(seedMnemonic); | ||
console.log(`\nAlternatively, you can also use the following private key to import account with MetaMask: "${wallet.privateKey}"`); | ||
console.log('\nHow to import an account: https://metamask.zendesk.com/hc/en-us/articles/360015489331-How-to-import-an-Account'); | ||
}; | ||
|
||
export const command = 'getethmnemonic'; | ||
|
||
export const describe = 'show the Ethereum seed mnemonic'; | ||
|
||
export const handler = async (argv: Arguments) => { | ||
(await loadXudClient(argv)).getETHMnemonic(new GetMnemonicRequest(), callback(argv, formatOutput)); | ||
}; |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.