fix(@wallet): send a token without balance

fixes #10509
This commit is contained in:
Anthony Laibe 2023-05-03 12:28:41 +02:00 committed by Anthony Laibe
parent d7d58b4933
commit f58bfb97eb

View File

@ -686,7 +686,7 @@ QtObject:
proc getTokenBalanceOnChain*(self: Service, address: string, chainId: int, symbol: string): float64 =
let account = self.getAccountByAddress(address)
for token in account.tokens:
if token.symbol == symbol:
if token.symbol == symbol and token.balancesPerChain.hasKey(chainId):
return token.balancesPerChain[chainId].balance
return 0.0