The token `supply_key` MUST sign this transaction.
This operation SHALL increase the total supply for the token type by the number of tokens "minted".
The total supply for the token type MUST NOT be increased above the maximum supply limit (2^63-1) by this transaction.
The tokens minted SHALL be credited to the token treasury account.
If the token is a fungible/common type, the amount MUST be specified.
If the token is a non-fungible/unique type, the metadata bytes for each unique token MUST be specified in the `metadata` list.
Each unique metadata MUST not exceed the global metadata size limit defined by the network configuration value `tokens.maxMetadataBytes`.
The global batch size limit (`tokens.nfts.maxBatchSizeMint`) SHALL set the maximum number of individual NFT metadata permitted in a single `tokenMint` transaction. ### Block Stream Effects None
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Transaction
Transaction.SignableNodeTransactionBodyBytesNested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Transaction
customFeeLimits, DEFAULT_AUTO_RENEW_PERIOD, defaultMaxTransactionFee, DUMMY_ACCOUNT_ID, DUMMY_TRANSACTION_ID, frozenBodyBuilder, innerSignedTransactions, outerTransactions, publicKeys, regenerateTransactionId, signers, sigPairLists, sourceTransactionBody, transactionIdsFields inherited from class com.hedera.hashgraph.sdk.Executable
attemptedAllNodes, blockingUnaryCall, grpcDeadline, logger, maxAttempts, maxBackoff, minBackoff, nodeAccountIds, nodes, random, RST_STREAM -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.TokenMintTransaction(TransactionBody txBody) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddMetadata(byte[] metadata) Add to the metadata list.(package private) TokenMintTransactionBody.Builderbuild()Build the transaction body.longExtract the amount.List<byte[]> Extract the list of metadata byte array records.(package private) io.grpc.MethodDescriptor<Transaction, TransactionResponse> Called to direct the invocation of the query to the appropriate gRPC service.Extract the token id.(package private) voidInitialize from the transaction body.(package private) voidonFreeze(TransactionBody.Builder bodyBuilder) Called inTransaction.freezeWith(Client)just before the transaction body is built.(package private) voidonScheduled(SchedulableTransactionBody.Builder scheduled) Called inTransaction.schedule()when converting transaction into a scheduled version.setAmount(long amount) An amount to mint to the Treasury Account.setMetadata(List<byte[]> metadataList) A list of metadata bytes.setTokenId(TokenId tokenId) A token identifier.(package private) voidvalidateChecksums(Client client) Methods inherited from class com.hedera.hashgraph.sdk.Transaction
addSignature, addSignature, batchify, buildAllTransactions, buildTransaction, doSchedule, estimateFee, freeze, freezeWith, fromBytes, fromScheduledTransaction, generateTransactionIds, getBatchKey, getDefaultMaxTransactionFee, getExecutionState, getHighVolume, getMaxTransactionFee, getRegenerateTransactionId, getRequiredChunks, getSignableNodeBodyBytesList, getSignatures, getSignaturesAtOffset, getTransactionBodySize, getTransactionHash, getTransactionHashPerNode, getTransactionId, getTransactionIdInternal, getTransactionMemo, getTransactionSize, getTransactionValidDuration, hash, isBatchedAndNotBatchTransaction, isFrozen, keyAlreadySigned, makeRequest, mapResponse, mapResponseStatus, onExecute, onExecuteAsync, regenerateTransactionId, requireNotFrozen, requireOneNodeAccountId, schedule, setBatchKey, setHighVolume, setMaxTransactionFee, setNodeAccountIds, setRegenerateTransactionId, setTransactionId, setTransactionMemo, setTransactionValidDuration, sign, signTransaction, signWith, signWithOperator, spawnBodyBuilder, toBytes, toString, wipeTransactionListsMethods inherited from class com.hedera.hashgraph.sdk.Executable
advanceRequest, checkNodeAccountIds, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getGrpcRequest, getMaxAttempts, getMaxBackoff, getMaxRetry, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
TokenMintTransaction
public TokenMintTransaction()Constructor. -
TokenMintTransaction
TokenMintTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, throws com.google.protobuf.InvalidProtocolBufferExceptionTransaction>> txs) Constructor.- Parameters:
txs- Compound list of transaction id's list of (AccountId, Transaction) records- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
TokenMintTransaction
TokenMintTransaction(TransactionBody txBody) Constructor.- Parameters:
txBody- protobuf TransactionBody
-
-
Method Details
-
getTokenId
Extract the token id.- Returns:
- the token id
-
setTokenId
A token identifier.This SHALL identify the token type to "mint".
The identified token MUST exist, and MUST NOT be deleted.- Parameters:
tokenId- the token id- Returns:
this
-
getAmount
public long getAmount()Extract the amount.- Returns:
- the amount to mint
-
setAmount
An amount to mint to the Treasury Account.This is interpreted as an amount in the smallest possible denomination for the token (10-decimals whole tokens).
The balance for the token treasury account SHALL receive the newly minted tokens.
If this value is equal to zero (`0`), the token SHOULD be a non-fungible/unique type.
If this value is non-zero, the token MUST be a fungible/common type.- Parameters:
amount- the amount to mint- Returns:
this
-
addMetadata
Add to the metadata list.- Parameters:
metadata- the metadata 100 bytes max- Returns:
this
-
getMetadata
Extract the list of metadata byte array records.- Returns:
- the metadata list
-
setMetadata
A list of metadata bytes.
One non-fungible/unique token SHALL be minted for each entry in this list.
Each entry in this list MUST NOT be larger than the limit set by the current network configuration value `tokens.maxMetadataBytes`.
This list MUST NOT contain more entries than the current limit set by the network configuration value `tokens.nfts.maxBatchSizeMint`.
If this list is not empty, the token MUST be a non-fungible/unique type.
If this list is empty, the token MUST be a fungible/common type.- Parameters:
metadataList- the metadata list- Returns:
this
-
initFromTransactionBody
void initFromTransactionBody()Initialize from the transaction body. -
build
TokenMintTransactionBody.Builder build()Build the transaction body.- Returns:
TokenMintTransactionBody
-
validateChecksums
- Specified by:
validateChecksumsin classTransaction<TokenMintTransaction>- Throws:
BadEntityIdException
-
getMethodDescriptor
io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()Description copied from class:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<TokenMintTransaction,Transaction, TransactionResponse, TransactionResponse>
-
onFreeze
Description copied from class:TransactionCalled inTransaction.freezeWith(Client)just before the transaction body is built. The intent is for the derived class to assign their data variant to the transaction body.- Specified by:
onFreezein classTransaction<TokenMintTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<TokenMintTransaction>
-