💰Get Balance

Users can check their account balance with the given command. It returns the data limit and current usage in bytes.

const getBalance = async() => {
  /*
    @param {string} apiKey - your api key.
  */
  const apiKey = 'YOUR_API_KEY';
  const balance = await lighthouse.getBalance(apiKey);
  
  /* Sample Response (Unit is Bytes)
      {data: { dataLimit: 687194767360, dataUsed: 7012827847 }}
  */
}

Last updated