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. 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 you own node endpoint today

Start 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 for 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.

๐Ÿ“˜

You can use the Chainstack EVM Swiss Army Knife to convert values.

Try the zks_getAllAccountBalances RPC method yourself

Language
Click Try It! to start a request and see the response here!