The following explains how to retrieve wallet balances on the peaq network using ethers.js
. Developers can often reuse ethers-based approaches with the right configurations.
If direct on-chain queries are difficult, we’ll also explore how to fall back to peaq.subscan.io
, a web-based explorer that allows you to look up balances via an HTTPS GUI.
ethers.js
installed and know how to initialize a provider.Ensure you have node
and npm
installed, then run:
In your JavaScript file (e.g., checkBalance.js
), import ethers and instantiate a provider. Point it to the RPC endpoint of the peaq network you’re connecting to (this might be a testnet or mainnet endpoint—adjust accordingly):
Use the provider’s getBalance
method, passing in the wallet address. The address should be an Ethereum-compatible format (e.g., 0x…):
If the direct query via ethers fails (due to network incompatibilities at the time of querying), you can manually check the balance using the peaq Subscan explorer:
Whether you retrieved the balance programmatically via ethers.js
or via peaq.subscan.io
, you’ll see the current token holdings associated with that address.
Make sure you understand the units (often the smallest unit might be displayed, and you may need to convert them to a more human-readable format).
Checking wallet balances on the peaq network can be attempted through ethers.js
if the network is EVM-compatible and you have the correct provider endpoint.
In the event of issues, the peaq.subscan.io
explorer provides a simple GUI fallback. By combining these approaches, developers and users can confidently monitor
and verify the holdings in their peaq wallets.
The following explains how to retrieve wallet balances on the peaq network using ethers.js
. Developers can often reuse ethers-based approaches with the right configurations.
If direct on-chain queries are difficult, we’ll also explore how to fall back to peaq.subscan.io
, a web-based explorer that allows you to look up balances via an HTTPS GUI.
ethers.js
installed and know how to initialize a provider.Ensure you have node
and npm
installed, then run:
In your JavaScript file (e.g., checkBalance.js
), import ethers and instantiate a provider. Point it to the RPC endpoint of the peaq network you’re connecting to (this might be a testnet or mainnet endpoint—adjust accordingly):
Use the provider’s getBalance
method, passing in the wallet address. The address should be an Ethereum-compatible format (e.g., 0x…):
If the direct query via ethers fails (due to network incompatibilities at the time of querying), you can manually check the balance using the peaq Subscan explorer:
Whether you retrieved the balance programmatically via ethers.js
or via peaq.subscan.io
, you’ll see the current token holdings associated with that address.
Make sure you understand the units (often the smallest unit might be displayed, and you may need to convert them to a more human-readable format).
Checking wallet balances on the peaq network can be attempted through ethers.js
if the network is EVM-compatible and you have the correct provider endpoint.
In the event of issues, the peaq.subscan.io
explorer provides a simple GUI fallback. By combining these approaches, developers and users can confidently monitor
and verify the holdings in their peaq wallets.