Class AccountBalance

java.lang.Object
com.hedera.hashgraph.sdk.AccountBalance

public class AccountBalance extends Object
This class represents the account balance object
  • Field Details

    • hbars

      @Nonnegative public final Hbar hbars
      The Hbar balance of the account
    • token

      @Deprecated @Nonnegative public final Map<TokenId,Long> token
      Deprecated.
      - Use `tokens` instead
    • tokens

      public final Map<TokenId,Long> tokens
    • tokenDecimals

      @Nonnegative public final Map<TokenId,Integer> tokenDecimals
  • Constructor Details

  • Method Details

    • fromProtobuf

      static AccountBalance fromProtobuf(CryptoGetAccountBalanceResponse protobuf)
      Convert the protobuf object to an account balance object.
      Parameters:
      protobuf - protobuf response object
      Returns:
      the converted account balance object
    • fromBytes

      public static AccountBalance fromBytes(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Convert a byte array to an account balance object.
      Parameters:
      data - the byte array
      Returns:
      the converted account balance object
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • toProtobuf

      Convert an account balance object into a protobuf.
      Returns:
      the protobuf object
    • toBytes

      public com.google.protobuf.ByteString toBytes()
      Convert the account balance object to a byte array.
      Returns:
      the converted account balance object
    • toString

      public String toString()
      Overrides:
      toString in class Object