Transaction Operations
Broadcast Transaction
Broadcast a transaction to the network. POST only.
Request:
requestType
isbroadcastTransaction
transactionBytes
is the bytecode of a signed transaction (optional)transactionJSON
is the transaction object (optional iftransactionBytes
provided)prunableAttachmentJSON
is the attachment object embedded intransactionJSON
containing a prunable message (required iftransactionJSON
not provided becausetransactionBytes
never 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:
requestType
iscalculateFullHash
unsignedTransactionJSON
is the unsigned transaction JSON object (optional)unsignedTransactionBytes
are the unsigned bytes of a transaction (optional ifunsignedTransactionJSON
is provided)signatureHash
is 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:
requestType
isgetExpectedTransactions
account
is one account ID (optional)account
is one account ID (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is 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:
requestType
isgetReferencingTransactions
transaction
is one transaction IDfirstIndex
is a zero-based index to the first block ID to retrieve (optional)lastIndex
is a zero-based index to the last block ID to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is 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:
requestType
isgetTransaction
transaction
is the transaction ID (optional)fullHash
is the full hash of the transaction (optional if transaction ID is provided)includePhasingResult
istrue
to retrieve execution status of each phased transaction (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is 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 whenincludePhasingResult
is true and the transaction is phased)result
(S) is a string containing the result of the transaction (only included whenincludePhasingResult
is true and the transaction is phased)executionHeight
(N) is the height the transaction was executed (only included whenincludePhasingResult
is true and the transaction is phased)transaction
(S) is the transaction IDversion
(N) is the transaction version numberphased
(B) istrue
if the transaction is phased,false
otherwiseecBlockId
(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 ifrequireBlock
is 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:
requestType
isgetTransactionBytes
transaction
is a transaction IDrequireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is 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, becausetransactionBytes
never includes prunable datalastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is 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:
requestType
isparseTransaction
transactionBytes
is the signed or unsigned bytecode of the transaction (optional)transactionJSON
is the transaction object (optional if transactionBytes is included)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is 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) istrue
if the signature is verified,false
otherwise
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:
requestType
isretrievePrunedTransaction
transaction
is 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:
requestType
issendTransaction
transactionBytes
is the bytecode of a signed transaction (optional)transactionJSON
is the transaction object (optional iftransactionBytes
provided)prunableAttachmentJSON
is the attachment object embedded intransactionJSON
containing a prunable message (required iftransactionJSON
not provided becausetransactionBytes
never includes prunable data)adminPassword
is 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:
requestType
issignTransaction
unsignedTransactionJSON
is thetransactionJSON
field of the transaction, without a signature subfieldunsignedTransactionBytes
is theunsignedTransactionBytes
field of the transaction (optional, ifunsignedTransactionJSON
provided)prunableAttachmentJSON
is a prunable attachment JSON object, if applicable, becauseunsignedTransactionBytes
never includes prunable data (optional if the transaction has already been broadcast and the prunable message can still be retrieved from the database)secretPhrase
is the secret passphrase of the signing accountvalidate
isfalse
to skip validation of the transaction bytes being signed (useful on nodes where the full blockchain is not downloaded)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is 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) istrue
the signature is verified,false
if 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, becausetransactionBytes
never includes prunable datatransaction
(S) is the transaction ID, derived from thefullHash
lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Sign Transaction example.