java.lang.Object
com.hedera.hashgraph.sdk.TokenInfo
Gets information about a fungible or non-fungible token instance.
See Hedera Documentation
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal KeyThe key which can perform update/delete operations on the token.final AccountIdAn account which will be automatically charged to renew the token's expiration, at autoRenewPeriod intervalfinal DurationThe interval at which the auto-renew account will be charged to extend the token's expiryThe custom fees to be assessed during a CryptoTransfer that transfers units of this tokenfinal intThe amount of decimal places that this token supports.final BooleanThe default Freeze status (not applicable, frozen or unfrozen) of Hedera accounts relative to this token.final BooleanThe default KYC status (KycNotApplicable or Revoked) of Hedera accounts relative to this token.final InstantThe epoch second at which the token will expirefinal KeyThe key which can change the custom fees of the token; if not set, the fees are immutablefinal KeyThe key which can freeze or unfreeze an account for token transactions.final booleanSpecifies whether the token was deleted or notfinal KeyThe key which can grant or revoke KYC of an account for the token's transactions.final LedgerIdThe ledger ID the response was returned from; please see HIP-198 for the network-specific IDs.final longFor tokens of type FUNGIBLE_COMMON - The Maximum number of fungible tokens that can be in circulation.byte[]Represents the metadata of the token definition.final KeyThe key which can change the metadata of a token (token definition and individual NFTs).final StringName of token.final KeyThe Key which can pause and unpause the Token.final BooleanSpecifies whether the token is paused or not.final KeyThe key which can change the supply of a token.final TokenSupplyTypeThe token supply typefinal StringSymbol of token.final TokenIdThe ID of the token for which information is requested.final StringThe memo associated with the tokenfinal TokenTypeThe token typefinal longTotal Supply of token.final AccountIdThe ID of the account which is set as Treasuryfinal KeyThe key which can wipe token balance of an account. -
Constructor Summary
ConstructorsConstructorDescriptionTokenInfo(TokenId tokenId, String name, String symbol, int decimals, long totalSupply, AccountId treasuryAccountId, Key adminKey, Key kycKey, Key freezeKey, Key wipeKey, Key supplyKey, Key feeScheduleKey, Boolean defaultFreezeStatus, Boolean defaultKycStatus, boolean isDeleted, AccountId autoRenewAccount, Duration autoRenewPeriod, Instant expirationTime, String tokenMemo, List<CustomFee> customFees, TokenType tokenType, TokenSupplyType supplyType, long maxSupply, Key pauseKey, Boolean pauseStatus, byte[] metadata, Key metadataKey, LedgerId ledgerId) -
Method Summary
Modifier and TypeMethodDescription(package private) static BooleanfreezeStatusFromProtobuf(TokenFreezeStatus freezeStatus) Are we frozen?(package private) static TokenFreezeStatusfreezeStatusToProtobuf(Boolean freezeStatus) Create a token freeze status protobuf.static TokenInfofromBytes(byte[] bytes) Create a token info object from a byte array.(package private) static TokenInfofromProtobuf(TokenGetInfoResponse response) Create a token info object from a protobuf.(package private) static BooleankycStatusFromProtobuf(TokenKycStatus kycStatus) Is kyc required?(package private) static TokenKycStatuskycStatusToProtobuf(Boolean kycStatus) Create a kyc status protobuf.(package private) static BooleanpauseStatusFromProtobuf(TokenPauseStatus pauseStatus) Are we paused?(package private) static TokenPauseStatuspauseStatusToProtobuf(Boolean pauseStatus) Create a pause status protobuf.byte[]toBytes()Create the byte array.(package private) TokenGetInfoResponseCreate the protobuf.toString()
-
Field Details
-
tokenId
The ID of the token for which information is requested. -
name
Name of token. -
symbol
Symbol of token. -
decimals
public final int decimalsThe amount of decimal places that this token supports. -
totalSupply
public final long totalSupplyTotal Supply of token. -
treasuryAccountId
The ID of the account which is set as Treasury -
adminKey
The key which can perform update/delete operations on the token. If empty, the token can be perceived as immutable (not being able to be updated/deleted) -
kycKey
The key which can grant or revoke KYC of an account for the token's transactions. If empty, KYC is not required, and KYC grant or revoke operations are not possible. -
freezeKey
The key which can freeze or unfreeze an account for token transactions. If empty, freezing is not possible -
wipeKey
The key which can wipe token balance of an account. If empty, wipe is not possible -
supplyKey
The key which can change the supply of a token. The key is used to sign Token Mint/Burn operations -
feeScheduleKey
The key which can change the custom fees of the token; if not set, the fees are immutable -
defaultFreezeStatus
The default Freeze status (not applicable, frozen or unfrozen) of Hedera accounts relative to this token. FreezeNotApplicable is returned if Token Freeze Key is empty. Frozen is returned if Token Freeze Key is set and defaultFreeze is set to true. Unfrozen is returned if Token Freeze Key is set and defaultFreeze is set to false -
defaultKycStatus
The default KYC status (KycNotApplicable or Revoked) of Hedera accounts relative to this token. KycNotApplicable is returned if KYC key is not set, otherwise Revoked -
isDeleted
public final boolean isDeletedSpecifies whether the token was deleted or not -
autoRenewAccount
An account which will be automatically charged to renew the token's expiration, at autoRenewPeriod interval -
autoRenewPeriod
The interval at which the auto-renew account will be charged to extend the token's expiry -
expirationTime
The epoch second at which the token will expire -
tokenMemo
The memo associated with the token -
customFees
The custom fees to be assessed during a CryptoTransfer that transfers units of this token -
tokenType
The token type -
supplyType
The token supply type -
maxSupply
public final long maxSupplyFor tokens of type FUNGIBLE_COMMON - The Maximum number of fungible tokens that can be in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - the maximum number of NFTs (serial numbers) that can be in circulation -
pauseKey
The Key which can pause and unpause the Token. -
pauseStatus
Specifies whether the token is paused or not. Null if pauseKey is not set. -
metadata
public byte[] metadataRepresents the metadata of the token definition. -
metadataKey
The key which can change the metadata of a token (token definition and individual NFTs). -
ledgerId
The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs.
-
-
Constructor Details
-
TokenInfo
TokenInfo(TokenId tokenId, String name, String symbol, int decimals, long totalSupply, AccountId treasuryAccountId, @Nullable Key adminKey, @Nullable Key kycKey, @Nullable Key freezeKey, @Nullable Key wipeKey, @Nullable Key supplyKey, @Nullable Key feeScheduleKey, @Nullable Boolean defaultFreezeStatus, @Nullable Boolean defaultKycStatus, boolean isDeleted, @Nullable AccountId autoRenewAccount, @Nullable Duration autoRenewPeriod, @Nullable Instant expirationTime, String tokenMemo, List<CustomFee> customFees, TokenType tokenType, TokenSupplyType supplyType, long maxSupply, @Nullable Key pauseKey, @Nullable Boolean pauseStatus, byte[] metadata, @Nullable Key metadataKey, LedgerId ledgerId)
-
-
Method Details
-
freezeStatusFromProtobuf
Are we frozen?- Parameters:
freezeStatus- the freeze status- Returns:
- true / false / null
-
kycStatusFromProtobuf
Is kyc required?- Parameters:
kycStatus- the kyc status- Returns:
- true / false / null
-
pauseStatusFromProtobuf
Are we paused?- Parameters:
pauseStatus- the paused status- Returns:
- true / false / null
-
fromProtobuf
Create a token info object from a protobuf.- Parameters:
response- the protobuf- Returns:
- new token info object
-
fromBytes
public static TokenInfo fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException Create a token info object from a byte array.- Parameters:
bytes- the byte array- Returns:
- the new token info object
- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
freezeStatusToProtobuf
Create a token freeze status protobuf.- Parameters:
freezeStatus- the freeze status- Returns:
- the protobuf
-
kycStatusToProtobuf
Create a kyc status protobuf.- Parameters:
kycStatus- the kyc status- Returns:
- the protobuf
-
pauseStatusToProtobuf
Create a pause status protobuf.- Parameters:
pauseStatus- the pause status- Returns:
- the protobuf
-
toProtobuf
TokenGetInfoResponse toProtobuf()Create the protobuf.- Returns:
- the protobuf representation
-
toString
-
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- the byte array representation
-