java.lang.Object
com.hedera.hashgraph.sdk.TokenAssociation
Associates the provided Hedera account with the provided Hedera token(s).
Hedera accounts must be associated with a fungible or non-fungible token
first before you can transfer tokens to that account. In the case of
NON_FUNGIBLE Type, once an account is associated, it can hold any number
of NFTs (serial numbers) of that token type. The Hedera account that is
being associated with a token is required to sign the transaction.
See Hedera Documentation
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TokenAssociationfromBytes(byte[] bytes) Create a token association from a byte array.(package private) static TokenAssociationfromProtobuf(TokenAssociation tokenAssociation) Create a token association from a protobuf.byte[]toBytes()Create the byte array.(package private) TokenAssociationCreate the protobuf.toString()
-
Field Details
-
tokenId
The token involved in the association -
accountId
The account involved in the association
-
-
Constructor Details
-
TokenAssociation
Constructor.- Parameters:
tokenId- the token idaccountId- the account id
-
-
Method Details
-
fromProtobuf
Create a token association from a protobuf.- Parameters:
tokenAssociation- the protobuf- Returns:
- the new token association
-
fromBytes
public static TokenAssociation fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException Create a token association from a byte array.- Parameters:
bytes- the byte array- Returns:
- the new token association
- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
toProtobuf
TokenAssociation toProtobuf()Create the protobuf.- Returns:
- the protobuf representation
-
toString
-
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- the byte array representation
-