diff --git a/src/app_service/service/wallet_account/async_tasks.nim b/src/app_service/service/wallet_account/async_tasks.nim index 98783a7844..ed7e453906 100644 --- a/src/app_service/service/wallet_account/async_tasks.nim +++ b/src/app_service/service/wallet_account/async_tasks.nim @@ -84,6 +84,7 @@ type accounts: seq[string] storeResult: bool +# TODO:: Clean up once all dependencies are removed const prepareTokensTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} = let arg = decode[BuildTokensTaskArg](argEncoded) var output = %*{ @@ -96,6 +97,20 @@ const prepareTokensTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} = output["storeResult"] = %* arg.storeResult except Exception as e: let err = fmt"Error getting wallet tokens" + arg.finish(output) + +const newPrepareTokensTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} = + let arg = decode[BuildTokensTaskArg](argEncoded) + var output = %*{ + "result": "", + "storeResult": false + } + try: + let response = backend.getWalletTokenBalances(arg.accounts) + output["result"] = response.result + output["storeResult"] = %* arg.storeResult + except Exception as e: + let err = fmt"Error getting wallet tokens" arg.finish(output) ################################################# diff --git a/src/app_service/service/wallet_account/service_token_new.nim b/src/app_service/service/wallet_account/service_token_new.nim index a90404dd57..6c0a53a19d 100644 --- a/src/app_service/service/wallet_account/service_token_new.nim +++ b/src/app_service/service/wallet_account/service_token_new.nim @@ -79,7 +79,7 @@ proc newBuildAllTokens*(self: Service, accounts: seq[string], store: bool) = self.events.emit(SIGNAL_WALLET_ACCOUNT_TOKENS_BEING_FETCHED, Args()) let arg = BuildTokensTaskArg( - tptr: cast[ByteAddress](prepareTokensTask), + tptr: cast[ByteAddress](newPrepareTokensTask), vptr: cast[ByteAddress](self.vptr), slot: "onNewAllTokensBuilt", accounts: accounts, diff --git a/src/backend/backend.nim b/src/backend/backend.nim index 1cc06ccd9d..458d4c7123 100644 --- a/src/backend/backend.nim +++ b/src/backend/backend.nim @@ -141,6 +141,9 @@ rpc(getTransfersForIdentities, "wallet"): rpc(getWalletToken, "wallet"): accounts: seq[string] +rpc(getWalletTokenBalances, "wallet"): + accounts: seq[string] + rpc(fetchMarketValues, "wallet"): symbols: seq[string] currency: string diff --git a/vendor/status-go b/vendor/status-go index a8357dceac..6599be1721 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit a8357dceacd1b737952660272bf80251df19b8f8 +Subproject commit 6599be1721e180fdb78d5c3f2c3daf3a6600b8e7