check if asset is configured for account

This commit is contained in:
Iuri Matias 2020-06-03 14:32:11 -04:00
parent ca82c9d5b2
commit b43d6c7b01
2 changed files with 6 additions and 0 deletions

View File

@ -117,3 +117,6 @@ QtObject:
read = defaultCurrency
write = setDefaultCurrency
notify = defaultCurrencyChanged
proc hasAsset*(self: WalletView, account: string, symbol: string): bool {.slot.} =
self.status.wallet.hasAsset(account, symbol)

View File

@ -49,3 +49,6 @@ proc getFiatValue*(self: WalletModel, eth_balance: string, symbol: string, fiat_
var fiat_balance = parseFloat(eth_balance) * parseFloat(fiat_eth_price)
echo(fmt"balance in usd: {fiat_balance}")
fiat_balance
proc hasAsset*(self: WalletModel, account: string, symbol: string): bool =
(symbol == "DAI") or (symbol == "OMG")