Creates a keypair from the provided Mnemonic, or from a newly generated one. Defaults to a wordCount of 12 and netType of MainNet.
list of bip39 words to create the keypair with
either 12 or 24 to indicate how many seed words to use
the NetType to use for the keypair (Mainnet / Testnet)
Generate a list of 12 bip39 words, one being the targetWord. You can use this to confirm the user knows their word out of a list or words.
Get an {@link Address} from a b58 string.
Get a Keypair from a SodiumKeyPair
Get the list of bip39 words that match a given substring.
Generated using TypeDoc
Use this module to interact with Helium crypto accounts.
For example create an account with createKeypair, generateChallengeWords to confirm users have written down their words, and getMatchingWords to get a list of possible account words that match a given substring.
Import the module
Create a Keypair
createKeypair creates a keypair from a random mnemonic. A mnemonic, or seed phrase, is a list of 12 BIP 39 words. The Mnemonic can be used to restore the account keypair. Creating the keypair returns its private key (keypairRaw), public key (address), and its mnemonic.
You could also use a mnemonic to restore a keypair. The word order is important and needs to remain the same to generate the same keypair.
Generate Challenge Words
If you need to confirm a user knows their words, you can use generateChallengeWords to challenge each of their 12 words. It will generate a list of words to challenge the target word.
words
would contain an array of BIP 39 words one of which being the target word.Get Matching Words
If you want to auto complete a list of words as a user types you can use getMatchingWords. For example when restoring a users 12 words you may want to use this as they type their words so that they can select the word as they type.
words
would contain an array of BIP 39 words that contain the substring "coll".