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"
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
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"
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
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).
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.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.zks_getAllAccountBalances API response
, a balance associated with the address 0x0000000000000000000000000000000000000000
specifically represents Ethereum (ETH).zks_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.
Successful response
The response is of type object
.