Skip to content

Instantly share code, notes, and snippets.

@totiz
Last active July 28, 2019 18:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save totiz/57ba02f45d51295d344223efe44386e6 to your computer and use it in GitHub Desktop.
Create libra wallet with npm i kulap-libra
async function createWallet() {
const { LibraWallet } = require('kulap-libra')
// Generate an account
const wallet = new LibraWallet() // create new wallet with BIP39
const account = wallet.newAccount() // Derivation paths to "LIBRA WALLET: derived key$0"
return {
address: account.getAddress().toHex(), // Get full address
mnemonic: wallet.config.mnemonic // Your super secret key
}
}
(async () => {
const wallet = await createWallet()
console.log('wallet', wallet)
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment