Here we will implement a class that loads a wallet and is able to do different operations on this wallet.
This class is not entirely necessary. There are other ways to achieve this but we made a class to have everything in one place. Also it allows you to modify some responses as you wish.
When the app starts you should create a WalletWrapper for each wallet the user has and save it in memory. A global map may be a good idea to be able to access the wallet from every component.
We save the mnemonic in the class to not ask it every time to the user. We could also have it protected with a pin.
On some cases we catch the errors. In these catches you could show something on screen to indicate the call failed.
Having a class allows to wrap functions such as getTokensBalance. This function checks the type of a token and maps it to something more understandable for the user..