wallet-create
Version:
Wallet generate .
19 lines (13 loc) • 425 B
JavaScript
// bin/wallet-create.js
import { generateMnemonic } from "bip39";
import { Wallet } from "ethers";
const args = process.argv.slice(2);
const showWallet = args.includes("wallet");
const mnemonic = generateMnemonic();
const wallet = Wallet.fromMnemonic(mnemonic);
if (showWallet) {
console.log("Private Key:", wallet.privateKey);
} else {
console.log("Mnemonic:", mnemonic);
}