How to get the balance of a wallet
What is the balance of a wallet?
The balance of a wallet refers to the total amount of a specific cryptocurrency that the wallet holds. Depending on your project, you might be need to display the balance of a single cryptocurrency, or the balances of all cryptocurrencies that a wallet holds.
Likewise, wallet assets refer to all forms of cryptocurrencies, tokens, and digital assets that are stored and managed within a cryptocurrency wallet.
How to do it with Moralis?
As an extensive framework for web3 developers, Moralis provides several EVM-centric APIs, allowing you to deliver projects more quickly.
In our case, Moralis has a Wallet API that you can make use of, and they even provide a code sample for the wallet balance use-case:
To adapt their code sample, replace the reference to Ethereum with their ID for Chiliz Chain, 0x15b38
:
How to do it with Tatum?
As a unified framework for building Web3 apps, Tatum provides several EVM-centric APIs, allowing you to deliver projects more quickly.
In our case, Tatum has a comprehensive Data API that you can make use of, and they even provide a code sample for the asset-retrieval use-case:
To adapt their code sample, replace the reference to Ethereum with Chiliz Chain:
How to do it with thirdweb
Thirdweb is a platform offering tools and infrastructure for building decentralized applications on multiple blockchain networks. It simplifies blockchain integration with SDKs, APIs, and pre-built components.
In our case, thirdweb has several short code samples on their docs site, which we can use as an inspiration.
Here is their code, adapted to Chiliz:
Last updated