java.lang.Object
com.hedera.hashgraph.sdk.TokenRelationship
Token's information related to the given Account.
See Hedera Documentation
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanSpecifies if the relationship is created implicitly.final longFor token of type FUNGIBLE_COMMON - the balance that the Account holds in the smallest denomination.final intThe amount of decimal places that this token supports.final @Nullable BooleanThe Freeze status of the account (FreezeNotApplicable, Frozen or Unfrozen).final @Nullable BooleanThe KYC status of the account (KycNotApplicable, Granted or Revoked).final StringThe Symbol of the tokenfinal TokenIdA unique token id -
Constructor Summary
ConstructorsConstructorDescriptionTokenRelationship(TokenId tokenId, String symbol, long balance, @Nullable Boolean kycStatus, @Nullable Boolean freezeStatus, int decimals, boolean automaticAssociation) -
Method Summary
Modifier and TypeMethodDescription(package private) static @Nullable BooleanfreezeStatusFromProtobuf(TokenFreezeStatus freezeStatus) Retrieve freeze status from a protobuf.(package private) static TokenFreezeStatusfreezeStatusToProtobuf(@Nullable Boolean freezeStatus) Retrieve the freeze status from a protobuf.static TokenRelationshipfromBytes(byte[] bytes) Create a token relationship from a byte array.(package private) static TokenRelationshipfromProtobuf(TokenRelationship tokenRelationship) Create a token relationship object from a protobuf.(package private) static @Nullable BooleankycStatusFromProtobuf(TokenKycStatus kycStatus) Retrieve the kyc status from a protobuf.(package private) static TokenKycStatuskycStatusToProtobuf(@Nullable Boolean kycStatus) Retrieve the kyc status from a protobuf.byte[]toBytes()Create the byte array.(package private) TokenRelationshipCreate the protobuf.toString()
-
Field Details
-
tokenId
A unique token id -
symbol
The Symbol of the token -
balance
public final long balanceFor token of type FUNGIBLE_COMMON - the balance that the Account holds in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of NFTs held by the account -
kycStatus
The KYC status of the account (KycNotApplicable, Granted or Revoked). If the token does not have KYC key, KycNotApplicable is returned -
freezeStatus
The Freeze status of the account (FreezeNotApplicable, Frozen or Unfrozen). If the token does not have Freeze key, FreezeNotApplicable is returned -
decimals
public final int decimalsThe amount of decimal places that this token supports. -
automaticAssociation
public final boolean automaticAssociationSpecifies if the relationship is created implicitly. False : explicitly associated, True : implicitly associated.
-
-
Constructor Details
-
TokenRelationship
-
-
Method Details
-
freezeStatusFromProtobuf
Retrieve freeze status from a protobuf.- Parameters:
freezeStatus- the protobuf- Returns:
- the freeze status
-
kycStatusFromProtobuf
Retrieve the kyc status from a protobuf.- Parameters:
kycStatus- the protobuf- Returns:
- the kyc status
-
fromProtobuf
Create a token relationship object from a protobuf.- Parameters:
tokenRelationship- the protobuf- Returns:
- the new token relationship
-
fromBytes
public static TokenRelationship fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException Create a token relationship from a byte array.- Parameters:
bytes- the byte array- Returns:
- the new token relationship
- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
freezeStatusToProtobuf
Retrieve the freeze status from a protobuf.- Parameters:
freezeStatus- the protobuf- Returns:
- the freeze status
-
kycStatusToProtobuf
Retrieve the kyc status from a protobuf.- Parameters:
kycStatus- the protobuf- Returns:
- the kyc status
-
toProtobuf
TokenRelationship toProtobuf()Create the protobuf.- Returns:
- the protobuf representation
-
toString
-
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- the byte array representation
-