nxt.http

## Class PublishExchangeOffer

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

-     public final class PublishExchangeOffer
      extends CreateTransaction

  Publish exchange offer for `CurrencyType.EXCHANGEABLE` currency

  Parameters

  - currency - currency id of an active currency
  - buyRateNQTPerUnit - Coin amount for buying a currency unit specified in NQT
  - sellRateNQTPerUnit - Coin amount for selling a currency unit specified in NQT
  - initialBuySupplyQNT - Initial number of currency units offered to buy by the publisher
  - initialSellSupplyQNT - Initial number of currency units offered for sell by the publisher
  - totalBuyLimitQNT - Total number of currency units which can be bought from the offer
  - totalSellLimitQNT - Total number of currency units which can be sold from the offer
  - expirationHeight - Blockchain height at which the offer is expired

  Publishing an exchange offer internally creates a buy offer and a counter sell offer linked together. Typically the buyRateNQTPerUnit specified would be less than the sellRateNQTPerUnit thus allowing the publisher to make profit

  Each `CurrencyBuy` transaction which matches this offer reduces the sell supply and increases the buy supply Similarly, each `CurrencySell` transaction which matches this offer reduces the buy supply and increases the sell supply Therefore the multiple buy/sell transaction can be issued against this offer during it's lifetime. However, the total buy limit and sell limit stops exchanging based on this offer after the accumulated buy/sell limit is reached after possibly multiple exchange operations.

  Only one exchange offer is allowed per account. Publishing a new exchange offer when another exchange offer exists for the account, removes the existing exchange offer and publishes the new exchange offer

- - ### 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`