Class StartFundingMonitor
- java.lang.Object
-
- nxt.http.APIServlet.APIRequestHandler
-
- nxt.http.StartFundingMonitor
-
public final class StartFundingMonitor extends APIServlet.APIRequestHandler
Start a funding monitorA funding monitor will transfer NXT, ASSET or CURRENCY from the funding account to a recipient account when the amount held by the recipient account drops below the threshold. The transfer will not be done until the current block height is greater than equal to the block height of the last transfer plus the interval. Holding type codes are listed in getConstants. The asset or currency is specified by the holding identifier.
The funding account is identified by the secret phrase. The secret phrase must be specified since the funding monitor needs to sign the transactions that it submits.
The recipient accounts are identified by the specified account property. Each account that has this property set by the funding account will be monitored for changes. The property value can be omitted or it can consist of a JSON string containing one or more values in the format: {"amount":long,"threshold":long,"interval":integer}
The long values can be specified as numeric values or as strings.
For example, {"amount":25,"threshold":10,"interval":1440}. The specified values will override the default values specified when the account monitor is started.
NXT amounts are specified with 8 decimal places. Asset and Currency decimal places are determined by the asset or currency definition.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
allowRequiredBlockParameters()
protected org.json.simple.JSONStreamAware
processRequest(javax.servlet.http.HttpServletRequest req)
Process the requestprotected boolean
requireFullClient()
protected boolean
requirePost()
-
Methods inherited from class nxt.http.APIServlet.APIRequestHandler
getAPITags, getFileParameter, getParameters, isPassword, isTextArea, processRequest, requireBlockchain, requirePassword, startDbTransaction
-
-
-
-
Method Detail
-
processRequest
protected org.json.simple.JSONStreamAware processRequest(javax.servlet.http.HttpServletRequest req) throws NxtException
Process the request- Specified by:
processRequest
in classAPIServlet.APIRequestHandler
- Parameters:
req
- Client request- Returns:
- Client response
- Throws:
NxtException
- Unable to process request
-
requirePost
protected boolean requirePost()
- Overrides:
requirePost
in classAPIServlet.APIRequestHandler
-
allowRequiredBlockParameters
protected boolean allowRequiredBlockParameters()
- Overrides:
allowRequiredBlockParameters
in classAPIServlet.APIRequestHandler
-
requireFullClient
protected boolean requireFullClient()
- Overrides:
requireFullClient
in classAPIServlet.APIRequestHandler
-
-