Package nxt.http
Class CurrencyBuy
java.lang.Object
nxt.http.APIServlet.APIRequestHandler
nxt.http.CreateTransaction
nxt.http.CurrencyBuy
Buy currency for coin
Parameters
- currency - currency id
- rateNQTPerUnit - exchange rate between coin amount and currency units
- unitsQNT - number of units to buy
The currency buy transaction attempts to match existing exchange offers. When a match is found, the minimum number of units
between the number of units offered and the units requested are exchanged at a rate matching the highest sell offer
A single transaction can match multiple sell offers or none.
Unlike asset bid order, currency buy is not saved. It's either executed immediately (fully or partially) or not executed
at all.
For every match between buyer and seller an exchange record is saved, exchange records can be retrieved using the GetExchanges API
-
Nested Class Summary
Nested classes/interfaces inherited from class nxt.http.CreateTransaction
CreateTransaction.CreateTransactionParameters -
Method Summary
Modifier and TypeMethodDescriptionprotected org.json.simple.JSONStreamAwareprocessRequest(javax.servlet.http.HttpServletRequest req) Methods inherited from class nxt.http.CreateTransaction
allowRequiredBlockParameters, createTransaction, getCommonFileParameters, getCommonParameters, getRecipientFileParameters, getRecipientParameters, isChainSpecific, requirePost, transactionParametersMethods inherited from class nxt.http.APIServlet.APIRequestHandler
canHaveRecipient, getAPITags, getCreateTransactionTypes, getFileParameters, getParameters, getSensitiveParameters, isIgnisOnly, isTextArea, processRequest, requireBlockchain, requiredBlockUpdateLock, requireFullClient, requirePassword, startDbTransaction
-
Method Details
-
processRequest
protected org.json.simple.JSONStreamAware processRequest(javax.servlet.http.HttpServletRequest req) throws NxtException - Specified by:
processRequestin classAPIServlet.APIRequestHandler- Throws:
NxtException
-