mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-03 18:25:33 +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.} =
|
proc onAllTokensBuilt*(self: Service, response: string) {.slot.} =
|
||||||
try:
|
try:
|
||||||
var visibleSymbols: seq[string]
|
|
||||||
let chainIds = self.networkService.getNetworks().map(n => n.chainId)
|
let chainIds = self.networkService.getNetworks().map(n => n.chainId)
|
||||||
|
|
||||||
let responseObj = response.parseJson
|
let responseObj = response.parseJson
|
||||||
@ -82,13 +81,7 @@ proc onAllTokensBuilt*(self: Service, response: string) {.slot.} =
|
|||||||
if storeResult:
|
if storeResult:
|
||||||
self.storeTokensForAccount(wAddress, tokens, hasBalanceCache, hasMarketValuesCache)
|
self.storeTokensForAccount(wAddress, tokens, hasBalanceCache, hasMarketValuesCache)
|
||||||
self.tokenService.updateTokenPrices(tokens) # For efficiency. Will be removed when token info fetching gets moved to the tokenService
|
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)
|
self.events.emit(SIGNAL_WALLET_ACCOUNT_TOKENS_REBUILT, data)
|
||||||
if visibleSymbols.len > 0:
|
|
||||||
discard backend.updateVisibleTokens(visibleSymbols)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error "error: ", procName="onAllTokensBuilt", errName = e.name, errDesription = e.msg
|
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]:
|
for token in self.accountsTokens[walletAccount.address]:
|
||||||
if token.symbol == symbol:
|
if token.symbol == symbol:
|
||||||
totalTokenBalance += token.getTotalBalanceOfSupportedChains()
|
totalTokenBalance += token.getTotalBalanceOfSupportedChains()
|
||||||
return totalTokenBalance
|
return totalTokenBalance
|
||||||
|
@ -138,9 +138,6 @@ rpc(getWalletToken, "wallet"):
|
|||||||
rpc(startWallet, "wallet"):
|
rpc(startWallet, "wallet"):
|
||||||
discard
|
discard
|
||||||
|
|
||||||
rpc(updateVisibleTokens, "wallet"):
|
|
||||||
symbols: seq[string]
|
|
||||||
|
|
||||||
rpc(getTransactionEstimatedTime, "wallet"):
|
rpc(getTransactionEstimatedTime, "wallet"):
|
||||||
chainId: int
|
chainId: int
|
||||||
maxFeePerGas: float
|
maxFeePerGas: float
|
||||||
@ -303,4 +300,4 @@ rpc(fetchAllCurrencyFormats, "wallet"):
|
|||||||
discard
|
discard
|
||||||
|
|
||||||
rpc(hasPairedDevices, "accounts"):
|
rpc(hasPairedDevices, "accounts"):
|
||||||
discard
|
discard
|
||||||
|
Loading…
x
Reference in New Issue
Block a user