mirror of https://github.com/lukechilds/vainjs.git
Luke Childs
6 years ago
2 changed files with 11 additions and 6 deletions
@ -1,9 +1,14 @@ |
|||
const bitcoin = require('bitcoinjs-lib'); |
|||
|
|||
const wif = {}; |
|||
const wif = () => { |
|||
const keyPair = bitcoin.ECPair.makeRandom(); |
|||
const {publicKey} = keyPair; |
|||
|
|||
wif.generate = bitcoin.ECPair.makeRandom; |
|||
const format = () => ({ |
|||
wif: keyPair.toWIF() |
|||
}); |
|||
|
|||
wif.format = keyPair => ({wif: keyPair.toWIF()}); |
|||
return {publicKey, format}; |
|||
}; |
|||
|
|||
module.exports = wif; |
|||
|
Loading…
Reference in new issue