Package nxt.http
Class CurrencyMint
- java.lang.Object
-
- nxt.http.APIServlet.APIRequestHandler
-
- nxt.http.CurrencyMint
-
public final class CurrencyMint extends APIServlet.APIRequestHandler
Generate new currency unitsParameters
- currency - currency id of the minted currency
- nonce - a unique nonce provided by the miner
- units - number of units minted per this transaction
- counter - a sequential number counting the ordinal mint operation number per currency/account combination
this ever increasing value ensures that the same mint transaction cannot execute more than once
The resulting hash code is compared to the target value derived from the current difficulty.
If the hash code is smaller than the target the currency units are generated into the sender account.
It is recommended to calculate the hash value offline before submitting the transaction.
Use theGetMintingTarget
transaction to retrieve the current hash target and then calculate the hash offline by following the procedure used inCurrencyMint.mintCurrency(nxt.AccountLedger.LedgerEvent, long, nxt.Account, nxt.Attachment.MonetarySystemCurrencyMinting)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
allowRequiredBlockParameters()
static java.util.List<java.lang.String>
getCommonParameters()
protected org.json.simple.JSONStreamAware
processRequest(javax.servlet.http.HttpServletRequest req)
protected boolean
requirePost()
-
Methods inherited from class nxt.http.APIServlet.APIRequestHandler
getAPITags, getFileParameter, getParameters, isPassword, isTextArea, processRequest, requireBlockchain, requireFullClient, requirePassword, startDbTransaction
-
-
-
-
Method Detail
-
processRequest
protected org.json.simple.JSONStreamAware processRequest(javax.servlet.http.HttpServletRequest req) throws NxtException
- Specified by:
processRequest
in classAPIServlet.APIRequestHandler
- Throws:
NxtException
-
requirePost
protected final boolean requirePost()
- Overrides:
requirePost
in classAPIServlet.APIRequestHandler
-
allowRequiredBlockParameters
protected final boolean allowRequiredBlockParameters()
- Overrides:
allowRequiredBlockParameters
in classAPIServlet.APIRequestHandler
-
getCommonParameters
public static java.util.List<java.lang.String> getCommonParameters()
-
-