Created
March 11, 2018 01:22
-
-
Save hm0429/83694f9faef83cc234c8ff0504544ccf to your computer and use it in GitHub Desktop.
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
var Wallet = require('ethereumjs-wallet'); | |
// 新たなウォレットを生成 | |
const wallet = Wallet.generate(); | |
// ウォレットの秘密鍵を取得 | |
const privateKey = wallet.getPrivateKeyString(); | |
console.log(privateKey); | |
// ウォレットの公開鍵を取得 | |
const publicKey = wallet.getPublicKeyString(); | |
console.log(publicKey); | |
// ウォレットのアドレスを取得 | |
const address = wallet.getAddressString(); | |
console.log(address); | |
// keystore の名前を取得 | |
const keystoreFilename = wallet.getV3Filename(); | |
console.log(keystoreFilename); | |
// keystore (JSONフォーマット) を取得 | |
const keystore = wallet.toV3("PASSWORD"); | |
console.log(keystore); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment