diff --git a/status/statusgo_backend_new/eth.nim b/status/statusgo_backend_new/eth.nim index 1db66cf..87852c3 100644 --- a/status/statusgo_backend_new/eth.nim +++ b/status/statusgo_backend_new/eth.nim @@ -14,13 +14,5 @@ proc getEthBalance*(address: string): RpcResponse[JsonNode] {.raises: [Exception let payload = %* [address, "latest"] return core.callPrivateRPC("eth_getBalance", payload) -proc getTokenBalance*(tokenAddress: string, accountAddress: string): RpcResponse[JsonNode] {.raises: [Exception].} = - var postfixedAccount: string = accountAddress - postfixedAccount.removePrefix("0x") - let payload = %* [{ - "to": tokenAddress, "from": accountAddress, "data": fmt"0x70a08231000000000000000000000000{postfixedAccount}" - }, "latest"] - return core.callPrivateRPC("eth_call", payload) - proc call*(payload = %* []): RpcResponse[JsonNode] {.raises: [Exception].} = return core.callPrivateRPC("eth_call", payload) diff --git a/status/statusgo_backend_new/custom_tokens.nim b/status/statusgo_backend_new/tokens.nim similarity index 62% rename from status/statusgo_backend_new/custom_tokens.nim rename to status/statusgo_backend_new/tokens.nim index c494b15..bc897ee 100644 --- a/status/statusgo_backend_new/custom_tokens.nim +++ b/status/statusgo_backend_new/tokens.nim @@ -3,6 +3,13 @@ import ./core, ./response_type export response_type + +proc getTokens*(chainId: int): RpcResponse[JsonNode] {.raises: [Exception].} = + return callPrivateRPC("wallet_getTokens", %* [chainId]) + +proc getBalances*(chainId: int, accounts: seq[string], tokens: seq[string]): RpcResponse[JsonNode] {.raises: [Exception].} = + return callPrivateRPC("wallet_getTokensBalancesForChainIDs", %* [@[chainId], accounts, tokens]) + proc getCustomTokens*(): RpcResponse[JsonNode] {.raises: [Exception].} = return callPrivateRPC("wallet_getCustomTokens", %* []) diff --git a/vendor/status-go b/vendor/status-go index 6f26d00..9d8ec44 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit 6f26d00bd54a7d2f608199877358ba3112d328a3 +Subproject commit 9d8ec4432ebc0530788a87512a7e257efc465e75