Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
added to get random mnemonics function
Browse files Browse the repository at this point in the history
  • Loading branch information
Booyoun-Kim committed Jun 4, 2021
1 parent 54af722 commit 0a65761
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export class Cosmos {
this.bech32MainPrefix = "cosmos";
}

// strength(128): 12 words, strength(256): 24 words
getRandomMnemonic(strength = 256) {
return bip39.generateMnemonic(strength);
}

setBech32MainPrefix(value) {
this.bech32MainPrefix = value;
if (!this.bech32MainPrefix) throw new Error("bech32MainPrefix object was not set or invalid");
Expand Down

0 comments on commit 0a65761

Please sign in to comment.