Lighthouse
Ask or search…
⌃K
💰

Get Balance

Users can check their account balance with the given command. It returns the data limit and current usage in bytes.
JS SDK
API
CLI
const getBalance = async() => {
/*
@param {string} publicKey - your public key.
*/
const publicKey = 'YOUR_WALLET_PUBLIC_KEY';
const balance = await lighthouse.getBalance(publicKey);
/* Sample Response (Unit is Bytes)
{data: { dataLimit: 687194767360, dataUsed: 7012827847 }}
*/
}
curl https://api.lighthouse.storage/api/user/user_data_usage?publicKey=<publicKey>
lighthouse-web3 balance