Class TokenTransfer

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

public class TokenTransfer extends Object
A token transfer record.

Internal utility class.

  • Field Details

    • tokenId

      final TokenId tokenId
    • accountId

      final AccountId accountId
    • expectedDecimals

      @Nullable Integer expectedDecimals
    • amount

      long amount
    • isApproved

      boolean isApproved
    • hookCall

      @Nullable FungibleHookCall hookCall
  • Constructor Details

    • TokenTransfer

      TokenTransfer(TokenId tokenId, AccountId accountId, long amount, boolean isApproved)
      Constructor.
      Parameters:
      tokenId - the token id
      accountId - the account id
      amount - the amount
      isApproved - is it approved
    • TokenTransfer

      TokenTransfer(TokenId tokenId, AccountId accountId, long amount, @Nullable Integer expectedDecimals, boolean isApproved)
      Constructor.
      Parameters:
      tokenId - the token id
      accountId - the account id
      amount - the amount
      expectedDecimals - the expected decimals
      isApproved - is it approved
    • TokenTransfer

      TokenTransfer(TokenId tokenId, AccountId accountId, long amount, @Nullable Integer expectedDecimals, boolean isApproved, @Nullable FungibleHookCall hookCall)
  • Method Details

    • fromProtobuf

      static List<TokenTransfer> fromProtobuf(TokenTransferList tokenTransferList)
    • toProtobuf

      AccountAmount toProtobuf()
      Create the protobuf.
      Returns:
      an account amount protobuf
    • toJsonObject

      com.google.gson.JsonObject toJsonObject()
      Build a JSON representation of this token transfer
      Returns:
      the JSON object
    • toString

      public String toString()
      Overrides:
      toString in class Object