Transaction Operations
Broadcast Transaction
Broadcast a transaction to the network. POST only.
Request:
requestTypeisbroadcastTransactiontransactionBytesis the bytecode of a signed transaction (optional)transactionJSONis the transaction object (optional iftransactionBytesprovided)prunableAttachmentJSONis the attachment object embedded intransactionJSONcontaining a prunable message (required iftransactionJSONnot provided becausetransactionBytesnever includes prunable data)
Response:
requestProcessingTime(N) is the API request processing time (in millisec)fullHash(S) is the full hash of the signed transactiontransaction(S) is the transaction ID
Example: Refer to Broadcast Transaction example.
Calculate Full Hash
Calculate the full hash of a transaction.
Request:
requestTypeiscalculateFullHashunsignedTransactionJSONis the unsigned transaction JSON object (optional)unsignedTransactionBytesare the unsigned bytes of a transaction (optional ifunsignedTransactionJSONis provided)signatureHashis a SHA-256 hash of the transaction signature
Response:
requestProcessingTime(N) is the API request processing time (in millisec)fullHash(S) is the full hash of the signed transaction
Example: Refer to Calculate Full Hash example.
Get Expected Transactions
Returns the non-phased unconfirmed transactions expected to be included in the next block (only), plus the phased transactions scheduled to finish in that block (whether approved or not).
Request:
requestTypeisgetExpectedTransactionsaccountis one account ID (optional)accountis one account ID (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
expectedTransactions(A) is an array of expected transactions (refer to Get Transaction for details)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Expected Transactions example.
Get Referencing Transactions
Gets the transactions referencing a given transaction id.
Request:
requestTypeisgetReferencingTransactionstransactionis one transaction IDfirstIndexis a zero-based index to the first block ID to retrieve (optional)lastIndexis a zero-based index to the last block ID to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
transactions(A) is an array of transactions (refer to Get Transaction for details)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Referencing Transactions example.
Get Transaction
Get a transaction object given a transaction ID.
Request:
requestTypeisgetTransactiontransactionis the transaction ID (optional)fullHashis the full hash of the transaction (optional if transaction ID is provided)includePhasingResultistrueto retrieve execution status of each phased transaction (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
sender(S) is the account ID of the sendersenderRS(S) is the Reed-Solomon address of the senderfeeNQT(S) is the fee (in NQT) of the transactionamountNQT(S) is the amount (in NQT) of the transactiontransactionIndex(N) is a zero-based index giving the order of the transaction in its blocktimestamp(N) is the time (in seconds since the genesis block) of the transactionreferencedTransactionFullHash(S) is the full hash of a transaction referenced by this one, omitted if no previous transaction is referencedconfirmations(N) is the number of transaction confirmationssubtype(N) is the transaction subtype (refer to Get Constants for a current list of subtypes)block(S) is the ID of the block containing the transactionblockTimestamp(N) is the timestamp (in seconds since the genesis block) of the blockheight(N) is the height of the block in the blockchainsenderPublicKey(S) is the public key of the sending account for the transactiontype(N) is the transaction type (refer to Get Constants for a current list of types)deadline(N) is the deadline (in minutes) for the transaction to be confirmedsignature(S) is the digital signature of the transactionrecipient(S) is the account number of the recipient, if applicablerecipientRS(S) is the Reed-Solomon address of the recipient, if applicablefullHash(S) is the full hash of the signed transactionsignatureHash(S) is a SHA-256 hash of the transaction signatureapproved(B) is a boolean indicating if the transaction is approved (only included whenincludePhasingResultis true and the transaction is phased)result(S) is a string containing the result of the transaction (only included whenincludePhasingResultis true and the transaction is phased)executionHeight(N) is the height the transaction was executed (only included whenincludePhasingResultis true and the transaction is phased)transaction(S) is the transaction IDversion(N) is the transaction version numberphased(B) istrueif the transaction is phased,falseotherwiseecBlockId(N) is the economic clustering block IDecBlockHeight(N) is the economic clustering block heightattachment(O) is an object containing any additional data needed for the transaction, if applicablelastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Note: The block, blockTimestamp and confirmations fields are omitted for unconfirmed transactions. Double-spending transactions are not retrieved.
Example: Refer to Get Transaction example.
Get Transaction Bytes
Get the bytecode of a transaction.
Request:
requestTypeisgetTransactionBytestransactionis a transaction IDrequireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
confirmations(N) is the number of transaction confirmationstransactionBytes(S) are the bytes contained in the transactionunsignedTransactionBytes(S) are the unsigned bytes contained in the transactionprunableAttachmentJSON(O) is the prunable attachment JSON object, if applicable, becausetransactionBytesnever includes prunable datalastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Transaction Bytes example.
Parse Transaction
Get a transaction object given a (signed or unsigned) transaction bytecode, or re-parse a transaction object. Verify the signature.
Request:
requestTypeisparseTransactiontransactionBytesis the signed or unsigned bytecode of the transaction (optional)transactionJSONis the transaction object (optional if transactionBytes is included)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response: Refer to Get Transaction for additional fields.
verify(B) istrueif the signature is verified,falseotherwise
Example: Refer to Parse Transaction example.
Retrieve Pruned Transaction
Force retrieval of the prunable data for a given transaction, even if past the configured nxt.maxPrunableLifetime.
Request:
requestTypeisretrievePrunedTransactiontransactionis transaction ID
Response: Refer to Get Transaction for fields.
Example: Refer to Retrieve Pruned Transaction example.
Send Transaction
It broadcasts a transaction to the network without validating it, without re-broadcasting it and without adding it locally as unconfirmed transaction. Specially intended for roaming or light clients to send transactions to remote peers. POST only.
Request:
requestTypeissendTransactiontransactionBytesis the bytecode of a signed transaction (optional)transactionJSONis the transaction object (optional iftransactionBytesprovided)prunableAttachmentJSONis the attachment object embedded intransactionJSONcontaining a prunable message (required iftransactionJSONnot provided becausetransactionBytesnever includes prunable data)adminPasswordis a string with the admin password (optional)
Response:
requestProcessingTime(N) is the API request processing time (in millisec)fullHash(S) is the full hash of the signed transactiontransaction(S) is the transaction ID
Example: Refer to Send Transaction example.
Sign Transaction
Calculates the full hash, signature hash, and transaction ID of an unsigned transaction.
Request:
requestTypeissignTransactionunsignedTransactionJSONis thetransactionJSONfield of the transaction, without a signature subfieldunsignedTransactionBytesis theunsignedTransactionBytesfield of the transaction (optional, ifunsignedTransactionJSONprovided)prunableAttachmentJSONis a prunable attachment JSON object, if applicable, becauseunsignedTransactionBytesnever includes prunable data (optional if the transaction has already been broadcast and the prunable message can still be retrieved from the database)secretPhraseis the secret passphrase of the signing accountvalidateisfalseto skip validation of the transaction bytes being signed (useful on nodes where the full blockchain is not downloaded)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
signatureHash(S) is a SHA-256 hash of the transaction signature, used in escrow transactionsverify(B) istruethe signature is verified,falseif nottransactionJSON(O) is the signed transaction JSON objecttransactionBytes(S) are the signed transaction bytesfullHash(S) is the full hash of the signed transactionprunableAttachmentJSON(O) is the prunable attachment JSON object, if applicable, becausetransactionBytesnever includes prunable datatransaction(S) is the transaction ID, derived from thefullHashlastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Sign Transaction example.