anonymous No title
No License TypeScript
2021年11月07日
Copy Clone
// 新規アカウントを発行する
(async () => {
  const mnemonic = MnemonicPassPhrase.createRandom(); // hd-wallet向け
  const seed = mnemonic.toSeed("password").toString("hex"); // passphraseにて暗号化(root seed)
  const xkey = ExtendedKey.createFromSeed(seed, Network.SYMBOL);
  const wallet = new Wallet(xkey);
  const masterAccount = wallet.getAccountPrivateKey();
  const defaultAccount = wallet.getChildAccountPrivateKey(Wallet.DEFAULT_WALLET_PATH);
  console.log(mnemonic);
  // console.log(masterAccount);
  // console.log(defaultAccount);
})();
// 新規アカウントを発行する
(async () => {
  const mnemonic = MnemonicPassPhrase.createRandom(); // hd-wallet向け
  const seed = mnemonic.toSeed("password").toString("hex"); // passphraseにて暗号化(root seed)
  const xkey = ExtendedKey.createFromSeed(seed, Network.SYMBOL);
  const wallet = new Wallet(xkey);
  const masterAccount = wallet.getAccountPrivateKey();
  const defaultAccount = wallet.getChildAccountPrivateKey(Wallet.DEFAULT_WALLET_PATH);
  console.log(mnemonic);
  // console.log(masterAccount);
  // console.log(defaultAccount);
})();
No one still commented. Please first comment.