Hedera
Search…
Get token info
Gets information about a fungible or non-fungible token instance. The token info query returns the following information:
Query Fees
  • Please see the transaction and query fees table for base transaction fee
  • Please use the Hedera fee estimator to estimate your query fee cost
Item
Description
TokenId
ID of the token instance
Token Type
The type of token (fungible or non-fungible)
Name
The name of the token. It is a string of ASCII only characters
Symbol
The symbol of the token. It is a UTF-8 capitalized alphabetical string
Decimals
The number of decimal places a token is divisible by
Total Supply
The total supply of tokens that are currently in circulation
Treasury
The ID of the account which is set as Treasury
Custom Fees
The custom fee schedule of the token, if any
Fee Schedule Key
Fee schedule key, if any
Admin Key
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)
KYC Key
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.
Freeze Key
The key which can freeze or unfreeze an account for token transactions. If empty, freezing is not possible
Wipe Key
The key which can wipe token balance of an account. If empty, wipe is not possible
Supply Key
The key which can change the supply of a token. The key is used to sign Token Mint/Burn operations
Pause Key
The key that can pause or unpause the token from participating in transactions.
Pause Status
Whether or not the token is paused.
false = not paused
true = paused
Max Supply
The max supply of the token
Supply Type
The supply type of the token
Default Freeze Status
The default Freeze status (not applicable = null, frozen = false, or unfrozen = true) 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.
FreezeNotApplicable = null;
Frozen = false;
Unfrozen = true;
Constructor
Description
new TokenInfoQuery()
Initializes the TokenInfoQuery object
1
new TokenInfoQuery()
Copied!

Methods

V2
V1
Method
Type
Requirement
setTokenId(<tokenId>)
TokenId
Required
<TokenInfo>.tokenId
TokenId
Optional
<TokenInfo>.name
String
Optional
<TokenInfo>.symbol
String
Optional
<TokenInfo>.decimals
int
Optional
<TokenInfo>.customFees
List<CustomFee>
Optional
<TokenInfo>.totalSupply
long
Optional
<TokenInfoQuery>.treasury
AccountId
Optional
<TokenInfo>.adminKey
Key
Optional
<TokenInfo>.kycKey
Key
Optional
<TokenInfo>.freezeKey
Key
Optional
<TokenInfo>.feeScheduleKey
Key
Optional
<TokenInfo>.wipeKey
Key
Optional
<TokenInfo>.supplyKey
Key
Optional
<TokenInfo>.defaultFreezeStatus
boolean
Optional
<TokenInfo>.defaultKycStatus
boolean
Optional
<TokenInfo>.isDeleted
boolean
Optional
<TokenInfo>.tokenType
TokenType
Optional
<TokenInfo>.supplyType
TokenSupplyType
Optional
Java
1
//Create the query
2
TokenInfoQuery query = new TokenInfoQuery()
3
.setTokenId(newTokenId);
4
​
5
//Sign with the client operator private key, submit the query to the network and get the token supply
6
long tokenSupply = query.execute(client).totalSupply;
7
​
8
System.out.println("The token info is " +tokenSupply);
9
​
Copied!
JavaScript
1
//Create the query
2
const query = new TokenInfoQuery()
3
.setTokenId(newTokenId);
4
​
5
//Sign with the client operator private key, submit the query to the network and get the token supply
6
const tokenSupply = (await query.execute(client)).totalSupply;
7
​
8
console.log("The total supply of this token is " +tokenSupply);
9
​
10
//v2.0.7
Copied!
Go
1
//Create the query
2
query := hedera.NewTokenInfoQuery().
3
SetTokenID(tokenId)
4
​
5
//Sign with the client operator private key and submit to a Hedera network
6
tokenInfo, err := query.Execute(client)
7
​
8
if err != nil {
9
panic(err)
10
}
11
​
12
fmt.Printf("The token info is %v\n", tokenInfo)
13
​
14
//v2.1.0
Copied!
Method
Type
Requirement
setTokenId(<tokenId>)
TokenId
Required
<TokenInfoQuery>.tokenId
TokenId
Optional
<TokenInfoQuery>.name
String
Optional
<TokenInfoQuery>.symbol
String
Optional
<TokenInfoQuery>.customFees
List<CustomFee>
Optional
<TokenInfoQuery>.decimals
int
Optional
<TokenInfoQuery>.totalSupply
long
Optional
<TokenInfoQuery>.treasury
AccountId
Optional
<TokenInfoQuery>.adminKey
PublicKey
Optional
<TokenInfoQuery>.kycKey
PublicKey
Optional
<TokenInfoQuery>.freezeKey
PublicKey
Optional
<TokenInfoQuery>.freezeKey
PublicKey
Optional
<TokenInfoQuery>.wipeKey
PublicKey
Optional
<TokenInfoQuery>.supplyKey
PublicKey
Optional
<TokenInfoQuery>.tokenType
TokenType
Optional
<TokenInfoQuery>.supplyType
TokenSupplyType
Optional
<TokenInfoQuery>.maxSupply
long
Optional
<TokenInfoQuery>.defaultFreezeStatus
boolean
Optional
<TokenInfoQuery>.defaultKycStatus
boolean
Optional
Java
1
//Create the query
2
TokenInfoQuery tokenInfo = new TokenInfoQuery()
3
.setTokenId(newTokenId);
4
​
5
//Submit the query to the network and obtain the token supply
6
long totalSupply = tokenInfo.execute(client).totalSupply;
7
System.out.println("The total supply of this token is " +totalSupply)
8
//Version: 1.2.2
Copied!
JavaScript
1
//Create the query
2
const tokenInfo = new TokenInfoQuery()
3
.setTokenId(newTokenId);
4
​
5
//Submit the query to the network and obtain the token supply
6
const totalSupply = await tokenInfo.execute(client).totalSupply;
7
​
8
console.log("The total supply of this token is " +totalSupply)
9
​
10
//Version 1.4.3
Copied!
​
Copy link
Contents
Methods