Package nxt.http
Class CurrencyBuy
- java.lang.Object
-
- nxt.http.APIServlet.APIRequestHandler
-
- nxt.http.CurrencyBuy
-
public final class CurrencyBuy extends APIServlet.APIRequestHandler
Buy currency for NXTParameters
- currency - currency id
- rateNQT - exchange rate between NXT amount and currency units
- units - number of units to buy
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 theGetExchangesAPI
-
-
Field Summary
-
Fields inherited from class nxt.http.APIServlet.APIRequestHandler
DESCRIPTION_FIELD, MESSAGE_FIELD, NAME_FIELD
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanallowRequiredBlockParameters()protected org.json.simple.JSONStreamAwareprocessRequest(javax.servlet.http.HttpServletRequest req)protected booleanrequirePost()-
Methods inherited from class nxt.http.APIServlet.APIRequestHandler
getAPITags, getFileParameter, getParameters, processRequest, requireBlockchain, requireFullClient, requirePassword, startDbTransaction
-
-
-
-
Method Detail
-
processRequest
protected org.json.simple.JSONStreamAware processRequest(javax.servlet.http.HttpServletRequest req) throws NxtException- Specified by:
processRequestin classAPIServlet.APIRequestHandler- Throws:
NxtException
-
requirePost
protected final boolean requirePost()
- Overrides:
requirePostin classAPIServlet.APIRequestHandler
-
allowRequiredBlockParameters
protected final boolean allowRequiredBlockParameters()
- Overrides:
allowRequiredBlockParametersin classAPIServlet.APIRequestHandler
-
-