zks_getAllAccountBalances | zkSync Era
curl --request POST \
--url https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "zks_getAllAccountBalances",
"params": [
"0xB240316e290e976e31f1557b3B312Dd698efac4c"
]
}
'import requests
url = "https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "zks_getAllAccountBalances",
"params": ["0xB240316e290e976e31f1557b3B312Dd698efac4c"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'zks_getAllAccountBalances',
params: ['0xB240316e290e976e31f1557b3B312Dd698efac4c']
})
};
fetch('https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 1,
'method' => 'zks_getAllAccountBalances',
'params' => [
'0xB240316e290e976e31f1557b3B312Dd698efac4c'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getAllAccountBalances\",\n \"params\": [\n \"0xB240316e290e976e31f1557b3B312Dd698efac4c\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getAllAccountBalances\",\n \"params\": [\n \"0xB240316e290e976e31f1557b3B312Dd698efac4c\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getAllAccountBalances\",\n \"params\": [\n \"0xB240316e290e976e31f1557b3B312Dd698efac4c\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}Zksync node API
zks_getAllAccountBalances | zkSync Era
The zks_getAllAccountBalances API method retrieves the balances of all confirmed tokens for a given account address on the zkSync network.
POST
/
afb8312f3710a5bc469f4c87cad3a2e4
zks_getAllAccountBalances | zkSync Era
curl --request POST \
--url https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "zks_getAllAccountBalances",
"params": [
"0xB240316e290e976e31f1557b3B312Dd698efac4c"
]
}
'import requests
url = "https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "zks_getAllAccountBalances",
"params": ["0xB240316e290e976e31f1557b3B312Dd698efac4c"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'zks_getAllAccountBalances',
params: ['0xB240316e290e976e31f1557b3B312Dd698efac4c']
})
};
fetch('https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 1,
'method' => 'zks_getAllAccountBalances',
'params' => [
'0xB240316e290e976e31f1557b3B312Dd698efac4c'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getAllAccountBalances\",\n \"params\": [\n \"0xB240316e290e976e31f1557b3B312Dd698efac4c\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getAllAccountBalances\",\n \"params\": [\n \"0xB240316e290e976e31f1557b3B312Dd698efac4c\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getAllAccountBalances\",\n \"params\": [\n \"0xB240316e290e976e31f1557b3B312Dd698efac4c\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}The
zks_getAllAccountBalances API method retrieves the balances of all confirmed tokens for a given account address on the zkSync network. This method is integral for users and applications requiring a comprehensive overview of an account’s assets on Layer 2 (zkSync), facilitating asset management, portfolio tracking, and interoperability within decentralized applications (DApps).
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
The method accepts a single parameter within its request:address— a string representing the account address for the requested balance information. This address should be associated with the user’s wallet on zkSync Layer 2.
Response
result— an object where each key represents the token address, and the value is the balance in Wei of that token for the specified account, in hexadecimal.
In the
zks_getAllAccountBalances API response, a balance associated with the address 0x0000000000000000000000000000000000000000 specifically represents Ethereum (ETH).Use case
A key use case forzks_getAllAccountBalances is within a DApp that requires real-time balance information across various tokens for a user’s wallet on zkSync. This could be crucial for financial DApps, portfolio trackers, or any application that manages or displays user assets across multiple tokens.
You can use the Chainstack EVM Swiss Army Knife to convert values.
Body
application/json
Last modified on June 22, 2026
Was this page helpful?