- If no Supply Key is defined, the transaction will resolve to
TOKEN\_HAS\_NO\_SUPPLY\_KEY. The maximum total supply a token can have is2^63-1. - The amount provided must be in the lowest denomination possible.
- Example: Token A has 2 decimals. In order to mint 100 tokens, one must provide an amount of 10000. In order to mint 100.55 tokens, one must provide an amount of 10055.
- The metadata field is specific to NFTs. Once an NFT is minted, the metadata cannot be changed and is immutable.
- You can use the metadata field to add a URI that contains additional information about the token. You can view the metadata schema here. The metadata field has a 100-character limit.
- The serial number for the NFT is returned in the receipt of the transaction.
- When minting NFTs, do not set the amount. The amount is used for minting fungible tokens only.
- This transaction accepts zero unit minting operations for fungible tokens (HIP-564)
- Supply key
- Transaction fee payer account key
- 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
| Constructor | Description |
|---|---|
new TokenMintTransaction() | Initializes the TokenMintTransaction object |
Transaction Properties
| Method | Type | Requirement |
|---|---|---|
setTokenId(<tokenId>) | TokenId | Required |
setAmount(<amount>) | long | Optional (fungible) |
addMetadata(<metadata>) | byte[] | Optional (NFT) |
setMetadata(<metadataList>) | List<byte[]> | Optional (NFT) |
setHighVolume(<highVolume>) | boolean | Optional |
Get Transaction Values
| Method | Type | Description |
|---|---|---|
getTokenId() | TokenId | Returns the token ID |
getAmount() | long | Returns the amount to mint (fungible) |
getMetadata() | List<byte[]> | Returns the metadata list (NFT) |
getHighVolume() | boolean | Returns 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 for both fungible and NFT mints.
Always pair this with setMaxTransactionFee() to cap your costs.