Currently, exceptions thrown during transactions or gas estimation that were spawned in another thread are not being propagated, due to a limitation in nim (see https://nim-lang.org/docs/manual_experimental.html#parallel-amp-spawn).
This means any exceptions from status-go were not propagated correctly and would cause the app to crash. This includes entering the wrong password when trying to send a transaction.
The issue was addressed by passing a `success` variable by reference, which is set to false if an exception was thrown by status-go.
Fixes#788.
Fixes#853.
Fixes#856.
refactor: gas estimation and transaction sends have been abstracted to allow calling `estimateGas`, `send`, and `call` on the contract method (similar to the web3 API).
Moved sticker pack gas estimation and purchase tx over to the new API
*Sticker purchase:*
- gas estimate is done using new API and debounced using a timer
*Wallet send transaction:*
- tokens can now be sent
- gas is estimated correctly for a token tx, and debounced using a timer
***NOTE***
1. If attempting to send tokens on testnet, you must use a custom token as the token addresses in the pre-built list are for mainnet and will not work on testnet.
2. The new API should support all existing gas estimates, send txs, and calls. The loading of sticker pack data, balance, count, purchased sticker packs, etc, can be moved over to the new API. Almost all of the `eth_sendTransaction`, `eth_gasEstimate`, and `eth_call` could be move over as well (that's the idea at least).
This commit extends the AddressInput to perform ENS lookups when valid
ENS values are entered. The lookup happens asynchronously, so we show a loading
indicator as the request is happening.
Closes#790
The problem was that the BigInt lib did not handle decimals at all. `divMod` only let the remainder be what is after the dot. So I created my own divde and multiply methods to move the dot depending on the number of decimals