parent
e41bfe843c
commit
3cb596b59d
@ -0,0 +1,29 @@ |
||||
const { Harmony } = require('@harmony/core'); |
||||
|
||||
const harmony = new Harmony('https://localhost:9128'); |
||||
|
||||
async function createAndEncrypt(words, index, password) { |
||||
for (let i = 0; i < index; i++) { |
||||
const newAcc = harmony.wallet.addByMnemonic(words, i); |
||||
await harmony.wallet.encryptAccount(newAcc.address, password); |
||||
} |
||||
} |
||||
|
||||
async function main() { |
||||
// const mne = harmony.wallet.generateMnemonic();
|
||||
const mne = |
||||
'food response winner warfare indicate visual hundred toilet jealous okay relief tornado'; |
||||
const password = '1234567890123'; |
||||
console.log('---hint: please write these down'); |
||||
console.log(`${mne}`); |
||||
|
||||
console.log('---hint: we use simple password to encrypt your wallet'); |
||||
console.log(`${password}`); |
||||
|
||||
await createAndEncrypt(mne, 10, password); |
||||
console.log('---hint:we added 10 accounts for you'); |
||||
|
||||
console.log(harmony.wallet.accounts); |
||||
} |
||||
|
||||
main(); |
Loading…
Reference in new issue