ethers.js/docs.wrm/api/utils/wordlists.wrm

64 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2020-02-17 17:56:13 -05:00
_section: Wordlists @<wordlists>
2020-05-08 03:24:40 -04:00
_subsection: Wordlist @<Wordlist>
2020-02-17 17:56:13 -05:00
_property: wordlist.locale => string
The locale for this wordlist.
_property: wordlist.getWord(index) => string
Returns the word at //index//.
_property: wordlist.getWordIndex(word) => number
Returns the index of //word// within the wordlist.
_property: wordlist.split(mnemonic) => Array<string>
Returns the mnemonic split into each individual word, according to a
locale's valid whitespace character set.
_property: wordlist.join(words) => string
Returns the mnemonic by joining //words// together using the
whitespace that is standard for the locale.
2020-05-08 03:24:40 -04:00
_property: Wordlist.check(wordlists) => string<[[DataHexString]]<32>>
2020-02-17 17:56:13 -05:00
Checks that all words map both directions correctly and return the
hash of the lists. Sub-classes should use this to validate the wordlist
is correct against the official wordlist hash.
2020-02-25 14:57:11 -05:00
_property: Wordlist.register(wordlist [ , name ]) => void
2020-02-17 17:56:13 -05:00
Register a wordlist with the list of wordlists, optionally overriding
the registered //name//.
2020-05-08 03:24:40 -04:00
_subsection: Languages @<wordlists--languages>
2020-02-17 17:56:13 -05:00
2020-11-22 23:03:50 -05:00
The [official wordlists](link-bip39-wordlists) available at
2020-10-03 13:30:15 -03:00
`ethers.wordlists`. In the browser, only the english language is
2020-06-12 03:38:55 -04:00
available by default; to include the others (which increases the
size of the library), see the dist files in the `ethers` package.
2020-02-17 17:56:13 -05:00
_property: ethers.wordlists.cz => Wordlist
2020-05-08 03:24:40 -04:00
The Czech [[Wordlist]].
2020-02-17 17:56:13 -05:00
_property: ethers.wordlists.en => Wordlist
2020-05-08 03:24:40 -04:00
The English [[Wordlist]].
2020-02-17 17:56:13 -05:00
_property: ethers.wordlists.es => Wordlist
2020-05-08 03:24:40 -04:00
The Spanish [[Wordlist]].
2020-02-17 17:56:13 -05:00
_property: ethers.wordlists.fr => Wordlist
2020-05-08 03:24:40 -04:00
The French [[Wordlist]].
2020-02-17 17:56:13 -05:00
_property: ethers.wordlists.it => Wordlist
2020-05-08 03:24:40 -04:00
The Italian [[Wordlist]].
2020-02-17 17:56:13 -05:00
2020-02-25 14:57:11 -05:00
_property: ethers.wordlists.ja => Wordlist
2020-05-08 03:24:40 -04:00
The Japanese [[Wordlist]].
2020-02-17 17:56:13 -05:00
_property: ethers.wordlists.ko => Wordlist
2020-05-08 03:24:40 -04:00
The Korean [[Wordlist]].
2020-02-17 17:56:13 -05:00
_property: ethers.wordlists.zh_cn => Wordlist
2020-05-08 03:24:40 -04:00
The Simplified Chinese [[Wordlist]].
2020-02-17 17:56:13 -05:00
_property: ethers.wordlists.zh_tw => Wordlist
2020-05-08 03:24:40 -04:00
The Traditional Chinese [[Wordlist]].