Class Transfer

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

public final class Transfer extends Object
A transfer of Hbar that occurred within a transaction.

Returned with a TransactionRecord.

  • Field Details

    • accountId

      public final AccountId accountId
      The Account ID that sends or receives crypto-currency.
    • amount

      public final Hbar amount
      The amount that the account sends (negative) or receives (positive).
    • isApproved

      public final boolean isApproved
      If true then the transfer is expected to be an approved allowance and the accountId is expected to be the owner. The default is false.
  • Constructor Details

    • Transfer

      Transfer(AccountId accountId, Hbar amount)
    • Transfer

      Transfer(AccountId accountId, Hbar amount, boolean isApproved)
  • Method Details

    • fromProtobuf

      static Transfer fromProtobuf(AccountAmount accountAmount)
      Create a transfer from a protobuf.
      Parameters:
      accountAmount - the protobuf
      Returns:
      the new transfer
    • toProtobuf

      AccountAmount toProtobuf()
      Create the protobuf.
      Returns:
      the protobuf representation
    • toJsonObject

      com.google.gson.JsonObject toJsonObject()
      Build a Gson representation of this transfer, mirroring the JS SDK's Transfer.toJSON().
      Returns:
      the JSON object
    • toString

      public String toString()
      Overrides:
      toString in class Object