mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-24 21:39:24 +00:00
fix(@desktop/wallet): (tokens) unknown RPC method wallet_updateVisibleTokens
fixes #12405
This commit is contained in:
parent
7b24a398b0
commit
246f58ef94
@ -49,7 +49,6 @@ proc getTokensByAddresses*(self: Service, addresses: seq[string]): seq[WalletTok
|
||||
|
||||
proc onAllTokensBuilt*(self: Service, response: string) {.slot.} =
|
||||
try:
|
||||
var visibleSymbols: seq[string]
|
||||
let chainIds = self.networkService.getNetworks().map(n => n.chainId)
|
||||
|
||||
let responseObj = response.parseJson
|
||||
@ -82,13 +81,7 @@ proc onAllTokensBuilt*(self: Service, response: string) {.slot.} =
|
||||
if storeResult:
|
||||
self.storeTokensForAccount(wAddress, tokens, hasBalanceCache, hasMarketValuesCache)
|
||||
self.tokenService.updateTokenPrices(tokens) # For efficiency. Will be removed when token info fetching gets moved to the tokenService
|
||||
# Gather symbol for visible tokens
|
||||
for token in tokens:
|
||||
if token.getVisibleForNetworkWithPositiveBalance(chainIds) and find(visibleSymbols, token.symbol) == -1:
|
||||
visibleSymbols.add(token.symbol)
|
||||
self.events.emit(SIGNAL_WALLET_ACCOUNT_TOKENS_REBUILT, data)
|
||||
if visibleSymbols.len > 0:
|
||||
discard backend.updateVisibleTokens(visibleSymbols)
|
||||
except Exception as e:
|
||||
error "error: ", procName="onAllTokensBuilt", errName = e.name, errDesription = e.msg
|
||||
|
||||
@ -175,4 +168,4 @@ proc allAccountsTokenBalance*(self: Service, symbol: string): float64 =
|
||||
for token in self.accountsTokens[walletAccount.address]:
|
||||
if token.symbol == symbol:
|
||||
totalTokenBalance += token.getTotalBalanceOfSupportedChains()
|
||||
return totalTokenBalance
|
||||
return totalTokenBalance
|
||||
|
@ -138,9 +138,6 @@ rpc(getWalletToken, "wallet"):
|
||||
rpc(startWallet, "wallet"):
|
||||
discard
|
||||
|
||||
rpc(updateVisibleTokens, "wallet"):
|
||||
symbols: seq[string]
|
||||
|
||||
rpc(getTransactionEstimatedTime, "wallet"):
|
||||
chainId: int
|
||||
maxFeePerGas: float
|
||||
@ -303,4 +300,4 @@ rpc(fetchAllCurrencyFormats, "wallet"):
|
||||
discard
|
||||
|
||||
rpc(hasPairedDevices, "accounts"):
|
||||
discard
|
||||
discard
|
||||
|
Loading…
x
Reference in New Issue
Block a user