Class SendTransaction
- java.lang.Object
-
- nxt.http.APIServlet.APIRequestHandler
-
- nxt.http.SendTransaction
-
public final class SendTransaction extends APIServlet.APIRequestHandler
Sends a transaction to some peers. Similarly toBroadcastTransaction, the purpose ofSendTransactionis to support client side signing of transactions. UnlikeBroadcastTransaction, does not validate the transaction and requires adminPassword parameter to avoid abuses. Also does not re-broadcast the transaction and does not store it as unconfirmed transaction. Clients first submit their transaction usingCreateTransactionwithout providing the secret phrase.
In response the client receives the unsigned transaction JSON and transaction bytes.The client then signs and submits the signed transaction using
SendTransactionThe default wallet implements this procedure in nrs.server.js which you can use as reference.
SendTransactionaccepts the following parameters:
transactionJSON - JSON representation of the signed transaction
transactionBytes - row bytes composing the signed transaction bytes excluding the prunable appendages
prunableAttachmentJSON - JSON representation of the prunable appendages
Clients can submit either the signed transactionJSON or the signed transactionBytes but not both.
In case the client submits transactionBytes for a transaction containing prunable appendages, the client also needs to submit the prunableAttachmentJSON parameter which includes the attachment JSON for the prunable appendages.
Prunable appendages are classes implementing the
Appendix.Prunableinterface.
-
-
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 booleanrequireBlockchain()protected booleanrequirePassword()protected booleanrequirePost()-
Methods inherited from class nxt.http.APIServlet.APIRequestHandler
getAPITags, getFileParameter, getParameters, processRequest, requireFullClient, startDbTransaction
-
-
-
-
Method Detail
-
processRequest
protected org.json.simple.JSONStreamAware processRequest(javax.servlet.http.HttpServletRequest req) throws ParameterException- Specified by:
processRequestin classAPIServlet.APIRequestHandler- Throws:
ParameterException
-
requirePost
protected boolean requirePost()
- Overrides:
requirePostin classAPIServlet.APIRequestHandler
-
requirePassword
protected boolean requirePassword()
- Overrides:
requirePasswordin classAPIServlet.APIRequestHandler
-
requireBlockchain
protected boolean requireBlockchain()
- Overrides:
requireBlockchainin classAPIServlet.APIRequestHandler
-
allowRequiredBlockParameters
protected final boolean allowRequiredBlockParameters()
- Overrides:
allowRequiredBlockParametersin classAPIServlet.APIRequestHandler
-
-