Build
ONCHAIN STORAGE
SDK
Payment API
getBalance()

getBalance()

Returns the connected wallet's balance.

Returns

Type
Description
BigNumber
Wallet balance in atomic units. You can convert it into standard units using irys.utils.fromAtomic().

Example

ℹ️

Use a token-specific version of getIrysUploader() to connect to an Irys Bundler before uploading. Choose one from here.

const irys = await getIrysUploader();
 
// Get loaded balance in atomic units
const atomicBalance = await irys.getBalance();
console.log(`Node balance (atomic units) = ${atomicBalance}`);
 
// Convert balance to standard
const convertedBalance = irys.utils.fromAtomic(atomicBalance);
console.log(`Node balance (converted) = ${convertedBalance}`);