@shubhu2002/bc-runes-js
Version:
A package to be able to mint, etch or transfer bitcoin runes very easily.
23 lines (17 loc) • 524 B
JavaScript
const bitcoin = require('bitcoinjs-lib')
const { ECPairFactory } = require('ecpair')
const ecc = require('@bitcoinerlab/secp256k1')
const {testnetNetwork} = require("../config")
// const network = bitcoin.networks.testnet
// const network = bitcoin.networks.bitcoin
const ECPair = ECPairFactory(ecc)
function getRandomWif() {
const wif = ECPair.makeRandom({ testnetNetwork }).toWIF()
return wif
}
if (process.argv[2] === '--log=wif') {
console.log({ WIF: getRandomWif() })
}
module.exports = {
getRandomWif
}