Skip to main content
Check out the “Getting Started with the Hedera Token Service” video tutorial in JavaScript here.
Create a new fungible or non-fungible token (NFT) on the Hedera network. After you submit the transaction to the Hedera network, you can obtain the new token ID by requesting the receipt. You can also create, access, or transfer HTS tokens using smart contracts - see Hedera Service Solidity Libraries and Supported ERC Token Standards.
Token Keys
  • If any of the token key types (KYC key, Wipe key, Metadata key, etc) are not set during the creation of the token, you will not be able to update the token and add them in the future
  • If any of the token key types (KYC key, Wipe key, Metadata key, etc) are set during the creation of the token, you will not be able to remove them in the future

NFTs

For non-fungible tokens, the token ID represents an NFT class. Once the token is created, you must mint each NFT using the token mint operation.
Note: The initial supply for an NFT is required to be set to 0.

Token Properties

Token Properties

Transaction Signing Requirements
  • Treasury key is required to sign
  • Admin key, if specified
  • Transaction fee payer key
Transaction Fees
  • For fungible tokens, a CryptoTransfer fee is added to transfer the newly created token to the treasury account
  • Please see the transaction and query fees table for the base transaction fee
  • Please use the Hedera fee estimator to estimate your transaction fee cost

Constructor

ConstructorDescription
new TokenCreateTransaction()Initializes the TokenCreateTransaction object

Transaction Properties

MethodTypeRequirement
setTokenName(<name>)StringRequired
setTokenSymbol(<symbol>)StringRequired
setDecimals(<decimals>)intOptional
setInitialSupply(<initialSupply>)longOptional
setTreasuryAccountId(<treasuryAccountId>)AccountIdRequired
setAdminKey(<key>)KeyOptional
setKycKey(<key>)KeyOptional
setFreezeKey(<key>)KeyOptional
setWipeKey(<key>)KeyOptional
setSupplyKey(<key>)KeyOptional
setPauseKey(<key>)KeyOptional
setFeeScheduleKey(<key>)KeyOptional
setMetadataKey(<key>)KeyOptional
setFreezeDefault(<freezeDefault>)booleanOptional
setExpirationTime(<expirationTime>)InstantOptional
setAutoRenewAccountId(<autoRenewAccountId>)AccountIdOptional
setAutoRenewPeriod(<autoRenewPeriod>)DurationOptional
setTokenMemo(<memo>)StringOptional
setTokenType(<tokenType>)TokenTypeOptional
setSupplyType(<supplyType>)TokenSupplyTypeOptional
setMaxSupply(<maxSupply>)longOptional
setCustomFees(<customFees>)List<CustomFee>Optional
setMetadata(<metadata>)byte[]Optional
setHighVolume(<highVolume>)booleanOptional

Get Transaction Values

MethodTypeDescription
getTokenName()StringReturns the name of the token
getTokenSymbol()StringReturns the symbol of the token
getDecimals()intReturns the number of decimals
getInitialSupply()longReturns the initial supply of tokens
getTreasuryAccountId()AccountIdReturns the treasury account ID
getAdminKey()KeyReturns the admin key
getKycKey()KeyReturns the KYC key
getFreezeKey()KeyReturns the freeze key
getWipeKey()KeyReturns the wipe key
getSupplyKey()KeyReturns the supply key
getPauseKey()KeyReturns the pause key
getFeeScheduleKey()KeyReturns the fee schedule key
getMetadataKey()KeyReturns the metadata key
getFreezeDefault()booleanReturns the freeze default value
getTokenType()TokenTypeReturns the token type
getSupplyType()TokenSupplyTypeReturns the supply type
getMaxSupply()longReturns the max supply
getHighVolume()booleanReturns whether this transaction uses high-volume throttles
This transaction supports high-volume entity creation (HIP-1313). Setting setHighVolume(true) routes the transaction through dedicated high-volume throttle capacity with variable-rate pricing. Always pair this with setMaxTransactionFee() to cap your costs.
//Create the transaction
TokenCreateTransaction transaction = new TokenCreateTransaction()
    .setTokenName("Your Token Name")
    .setTokenSymbol("F")
    .setTreasuryAccountId(treasuryAccountId)
    .setInitialSupply(5000)
    .setAdminKey(adminKey.getPublicKey())
    .setMetadataKey(metadataKey)
    .setMetadata(metadata)
    .setMaxTransactionFee(new Hbar(30)); //Change the default max transaction fee

//Build the unsigned transaction, sign with admin private key of the token, sign with the token treasury private key, submit the transaction to a Hedera network
TransactionResponse txResponse = transaction.freezeWith(client).sign(adminKey).sign(treasuryKey).execute(client);

//Request the receipt of the transaction
TransactionReceipt receipt = txResponse.getReceipt(client);

//Get the token ID from the receipt
TokenId tokenId = receipt.tokenId;

System.out.println("The new token ID is " + tokenId);
//v2.0.1