nxt.http

## Class IssueCurrency

- java.lang.Object
- - nxt.http.APIServlet.APIRequestHandler
  - - nxt.http.CreateTransaction
    - - nxt.http.IssueCurrency

-     public final class IssueCurrency
      extends CreateTransaction

  Issue a currency on the Ardor blockchain

  A currency is the basic block of the Ardor Monetary System it can be exchanged with coins, transferred between accounts, minted using proof of work methods, reserved and claimed as a crowd funding tool.

  Pass the following parameters in order to issue a currency

  - name - unique identifier of the currency composed of between 3 to 10 latin alphabetic symbols and numbers, name must be no shorter than code. name and code are mutually unique.
  - code - unique 3 to 5 letter currency trading symbol composed of upper case latin letters
  - description - free text description of the currency limited to 1000 characters
  - type - a numeric value representing a bit vector modeling the currency capabilities (see below)
  - ruleset - for future use, always set to 0
  - maxSupplyQNT - the total number of currency units which can be created
  - initialSupplyQNT - the number of currency units created when the currency is issued (pre-mine)
  - decimals - currency units are divisible to this number of decimals
  - issuanceHeight - the blockchain height at which the currency would become active For `CurrencyType.RESERVABLE` currency
  - minReservePerUnitNQT - the minimum coin value per unit to allow the currency to become active For `CurrencyType.RESERVABLE` currency
  - reserveSupplyQNT - the number of units that will be distributed to founders when currency becomes active (less initialSupply) For `CurrencyType.RESERVABLE` currency
  - minDifficulty - for mint-able currency, the exponent of the initial difficulty. For `CurrencyType.MINTABLE` currency
  - maxDifficulty - for mint-able currency, the exponent of the final difficulty. For `CurrencyType.MINTABLE` currency
  - algorithm - the hashing `algorithm` used for minting. For `CurrencyType.MINTABLE` currency

  Constraints

  - A given currency can not be neither `CurrencyType.EXCHANGEABLE` nor `CurrencyType.CLAIMABLE`.
  - A `CurrencyType.RESERVABLE` currency becomes active once the blockchain height reaches the currency issuance height.
    At this time, if the minReservePerUnitNQT has not been reached the currency issuance is cancelled and funds are returned to the founders.
    Otherwise the currency becomes active and remains active until deleted, provided deletion is possible. When a `CurrencyType.RESERVABLE` becomes active, in case it is `CurrencyType.CLAIMABLE` the coins used for reserving the currency are locked until they are claimed back. When a `CurrencyType.RESERVABLE` becomes active, in case it is non `CurrencyType.CLAIMABLE` the coins used for reserving the currency are sent to the issuer account as crowd funding.
  - When issuing a `CurrencyType.MINTABLE` currency, the number of units per `CurrencyMint` cannot exceed 0.01% of the total supply. Therefore make sure totalSupply > 10000 or otherwise the currency cannot be minted
  - difficulty is calculated as follows
    difficulty of minting the first unit is based on 2^minDifficulty
    difficulty of minting the last unit is based on 2^maxDifficulty
    difficulty increases linearly from min to max based on the ratio between the current number of units and the total supply
    difficulty increases linearly with the number units minted per `CurrencyMint`
  See Also:
    `CurrencyType`, `HashFunction`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class nxt.http.CreateTransaction

      `CreateTransaction.CreateTransactionParameters`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.json.simple.JSONStreamAware` | `processRequest(javax.servlet.http.HttpServletRequest req)`

    - ### Methods inherited from class nxt.http.CreateTransaction

      `allowRequiredBlockParameters, createTransaction, getCommonParameters, isChainSpecific, requirePost, transactionParameters`

    - ### Methods inherited from class nxt.http.APIServlet.APIRequestHandler

      `getAPITags, getFileParameter, getParameters, isIgnisOnly, isPassword, isTextArea, processRequest, requireBlockchain, requireFullClient, requirePassword, startDbTransaction`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### processRequest

          protected org.json.simple.JSONStreamAware processRequest(javax.servlet.http.HttpServletRequest req)
                                                            throws NxtException

      Specified by:
        `processRequest` in class `APIServlet.APIRequestHandler`
      Throws:
        `NxtException`