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

Commit 0a65761

Browse files
author
Booyoun-Kim
committed
added to get random mnemonics function
1 parent 54af722 commit 0a65761

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export class Cosmos {
2020
this.bech32MainPrefix = "cosmos";
2121
}
2222

23+
// strength(128): 12 words, strength(256): 24 words
24+
getRandomMnemonic(strength = 256) {
25+
return bip39.generateMnemonic(strength);
26+
}
27+
2328
setBech32MainPrefix(value) {
2429
this.bech32MainPrefix = value;
2530
if (!this.bech32MainPrefix) throw new Error("bech32MainPrefix object was not set or invalid");

0 commit comments

Comments
 (0)