Last active
July 28, 2019 18:31
Star
You must be signed in to star a gist
Create libra wallet with npm i kulap-libra
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
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