Open rosmcmahon opened 4 months ago
This can be imported from wallet
. I'll be sure to update the docs and add types for this in the future
Might have closed this prematurely, does this answer your question ?
well, i was able to do it this way:
import Xian from '../src'
import * as bip39 from 'bip39'
/* create wallet from mnemonic */
const createWalletFromMnemonic = async () => {
console.info('Create wallet from mnemonic...')
const mnemonic = 'document energy must purpose coach viable student dragon domain catalog list price garden tongue keen exile beauty young token celery lumber board eye bind'
const seed = (await bip39.mnemonicToSeed(mnemonic)).toString('hex')
//@ts-ignore
const mnemonicWallet = Xian.Wallet.new_wallet_bip39(seed)
console.log(JSON.stringify(mnemonicWallet, null, 2))
}
createWalletFromMnemonic()
happy to create a PR for a new wallet function so that folks don't have to use bip39 directly, i've actually got a fork going already
Awesome, you figured it out. PR's welcome <3
as per title!