|
|
|
@ -5,6 +5,7 @@ module.exports = {
|
|
|
|
|
mn_encode,
|
|
|
|
|
mn_decode,
|
|
|
|
|
sc_reduce32,
|
|
|
|
|
get_languages,
|
|
|
|
|
};
|
|
|
|
|
class MnemonicError extends Error {}
|
|
|
|
|
|
|
|
|
@ -127,14 +128,14 @@ function mn_decode(str, wordset_name) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var mn_words = {
|
|
|
|
|
'electrum': {
|
|
|
|
|
prefix_len: 0,
|
|
|
|
|
words: require('../mnemonic_languages/electrum'),
|
|
|
|
|
},
|
|
|
|
|
'english': {
|
|
|
|
|
prefix_len: 3,
|
|
|
|
|
words: require('../mnemonic_languages/english'),
|
|
|
|
|
},
|
|
|
|
|
'electrum': {
|
|
|
|
|
prefix_len: 0,
|
|
|
|
|
words: require('../mnemonic_languages/electrum'),
|
|
|
|
|
},
|
|
|
|
|
'spanish': {
|
|
|
|
|
prefix_len: 4,
|
|
|
|
|
words: require('../mnemonic_languages/spanish'),
|
|
|
|
@ -149,6 +150,10 @@ var mn_words = {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function get_languages() {
|
|
|
|
|
return Object.keys(mn_words);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (var i in mn_words) {
|
|
|
|
|
if (mn_words.hasOwnProperty(i)) {
|
|
|
|
|
if (mn_words[i].prefix_len === 0) {
|
|
|
|
|