Import wallet error
This example show what happens when you enter an incorrect mnemonic.
It is a good practice to surround the creation of a WalletService with a try catch block. This way you can act accordingly if the mnemonic is incorrect.
WalletService contains a static function called validateMnemonic which returns a boolean. This way you can be sure your mnemonic is correct before creating the service. In some situations this may be preferred.
Last updated