Transactions

From ArdorDocs
Jump to: navigation, search
Other languages:

Broadcast Transaction

Broadcast a transaction to the network. POST only.

Request:

  • requestType is broadcastTransaction
  • transactionBytes is the bytecode of a signed transaction (optional)
  • transactionJSON is the transaction object (optional if transactionBytes provided)
  • prunableAttachmentJSON is the attachment object embedded in transactionJSON containing a prunable message (required if transactionJSON not provided because transactionBytes never includes prunable data)

Response:

  • requestProcessingTime (N) is the API request processing time (in millisec)
  • fullHash (S) is the full hash of the signed transaction
  • transaction (S) is the transaction ID

Broadcast Transaction Example

http://localhost:27876/nxt?
  requestType=broadcastTransaction&
  transactionBytes=02000000000001e0217e022800df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0069c38ab5c7abe500e40b540200000040420f000000000058cda06a138b59b46b19c5e5d06d65334ed338d0e48d9694ae5c119913d2a00c9b4871989dd367442d1dbd94d22336515135cc3bf35e7c952c244e9d1b6a5c9810851a0069fb1adac03af20c40000000017ac01a000001000000000000000000000000000000016059eed721ae4ad4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
{
 "requestProcessingTime": 4,
 "fullHash": "3a304584f20cf3d2cbbdd9698ff9a166427005ab98fbe9ca4ad6253651ee81f1",
 "transaction": "15200507403046301754"
}

Note: If the transaction has already been broadcast, the following INFO notice appears in the console output and log file: Transaction 15200507403046301754 already in blockchain (or unconfirmed pool), will not broadcast again.


Calculate Fee

Calculate the minimum fee for a transaction.

Request:

  • requestType is calculateFee
  • transactionBytes is the bytecode of a signed transaction (optional)
  • transactionJSON is the transaction object (optional if transactionBytes provided)
  • prunableAttachmentJSON is the attachment object embedded in transactionJSON containing a prunable message (required if transactionJSON not provided because transactionBytes never includes prunable data)

Response:

  • minimumFeeFQT (N) is the minimum fee in FQT in Ardor (1 FQT =1^(10-8) ARDR)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Calculate Fee Example

http://localhost:27876/nxt?
  requestType=calculateFee&
  transactionBytes=02000000000001e0217e022800df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0069c38ab5c7abe500e40b540200000040420f000000000058cda06a138b59b46b19c5e5d06d65334ed338d0e48d9694ae5c119913d2a00c9b4871989dd367442d1dbd94d22336515135cc3bf35e7c952c244e9d1b6a5c9810851a0069fb1adac03af20c40000000017ac01a000001000000000000000000000000000000016059eed721ae4ad4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
{
 "minimumFeeFQT": "1000000",
 "requestProcessingTime": 0
}


Calculate Full Hash

Calculate the full hash of a transaction.

Request:

  • requestType is calculateFullHash
  • unsignedTransactionJSON is the unsigned transaction JSON object (optional)
  • unsignedTransactionBytes are the unsigned bytes of a transaction (optional if unsignedTransactionJSON 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

Calculate Full Hash Example

http://localhost:27876/nxt?
  requestType=calculateFullHash&
  unsignedTransactionBytes=02000000000001e0217e022800df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0069c38ab5c7abe500e40b540200000040420f000000000058cda06a138b59b46b19c5e5d06d65334ed338d0e48d9694ae5c119913d2a00c9b4871989dd367442d1dbd94d22336515135cc3bf35e7c952c244e9d1b6a5c9810851a0069fb1adac03af20c40000000017ac01a000001000000000000000000000000000000016059eed721ae4ad4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000&
  signatureHash=b35eae7d2f01639810d37694138aa0a86fbbf8a9bf58c2be4f2a5b8f0f30b3f7
{
 "requestProcessingTime": 1,
 "fullHash": "3a304584f20cf3d2cbbdd9698ff9a166427005ab98fbe9ca4ad6253651ee81f1"
}


Get Blockchain Transactions

Get the transactions associated with an account in reverse block timestamp order.

Request:

  • chain is the chain to retrieve the transactions (for example ARDOR(1) or IGNIS(2))
  • requestType is getBlockchainTransactions
  • account is the account ID
  • timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)
  • type is the type of transactions to retrieve (optional)
  • subtype is the subtype of transactions to retrieve (optional)
  • firstIndex is a zero-based index to the first transaction to retrieve (optional)
  • lastIndex is a zero-based index to the last transaction to retrieve (optional)
  • numberOfConfirmations is the required number of confirmations per transaction (optional)
  • withMessage is true to retrieve only only transactions having a message attachment, either non-encrypted or decryptable by the account (optional)
  • phasedOnly is true to retrieve only phased transactions (optional unless nonPhasedOnly provided)
  • nonPhasedOnly is true to retrieve only nonphased transactions (optional unless phasedOnly provided)
  • includeExpiredPrunable is true' to retrieve pruned data if available (optional)
  • includePhasingResult is true to retrieve execution status of each phased transaction (optional)
  • executedOnly is true to exclude phased transactions that are not yet executed (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)

Note: Refer to Get Constants for definitions of types and subtypes

Response:

  • transactions (A) is an array of transactions (refer to Get Transaction for details)
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Blockchain Transactions Example

http://localhost:27876/nxt?
  requestType=getBlockchainTransactions&
  chain=1&
  account=ARDOR-4VDY-LNVT-LMAY-FMCKA&
  lastIndex=0
{
 "requestProcessingTime": 2,
 "transactions": [
  {
   "signature": "0bc2045c2e4291e9595702fc6a9e805f11b65a88a867d515e44b980ef72b440a2...",
   "transactionIndex": 0,
   "type": 0,
   "phased": false,
   "ecBlockId": "441034190304176853",
   "signatureHash": "31f92d5612115e174748c7a261cd0412e00028639301aae0f0c1ddfc7618b7e7",
   "attachment": {
    "version.OrdinaryPayment": 0
   },
   "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "subtype": 0,
   "amountNQT": "1400000000",
   "recipientRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "block": "6752144003309284467",
   "blockTimestamp": 46567698,
   "deadline": 1440,
   "timestamp": 46567612,
   "height": 291611,
   "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
   "chain": 1,
   "feeNQT": "100000000",
   "confirmations": 2046,
   "fullHash": "a26a2a36086e5d13f069dd9da06ce4e6b0418e9a299bec0cda39bfa04a2ca5e3",
   "version": 1,
   "sender": "15295723609781267838",
   "recipient": "11580081983047651163",
   "ecBlockHeight": 291600,
   "transaction": "1395392441102264994"
  }
 ]
}


Get Executed Transactions

Returns the transactions ordered by the height at which they were executed, not at which they were included in the blockchain. It simplifies the processing of phased transactions.

Request:

  • requestType is getExecutedTransactions
  • chain is the chain that we want to retrieve the transactions (eg: 2 that is equivalent to IGNIS chain)
  • height (N) is the height of the block in the blockchain
  • numberOfConfirmations is the required number of confirmations per transaction (optional)
  • type is the type of transactions to retrieve (optional)
  • subtype is the subtype of transactions to retrieve (optional)
  • sender is the sender id
  • recipient is the recipient id
  • firstIndex is a zero-based index to the first transaction to retrieve (optional)
  • lastIndex is a zero-based index to the last transaction to retrieve (optional)
  • adminPassword Admin password parameter (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)
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Executed Transactions Example

http://localhost:27876/nxt?
  requestType=getExecutedTransactions&
  chain=2&
  sender=ARDOR-X8ZN-WUJ2-SXY3-FBUYC
{
 "requestProcessingTime": 3,
 "transactions": [
  {
   "signature": "27cb254e2738ffd48cc0bf8deb8d07a79377db1fdadd9c42cababa66a82c2e07f300...",
   "transactionIndex": 1,
   "type": 0,
   "fxtTransaction": "15039146794611713789",
   "phased": false,
   "ecBlockId": "2329106975025976796",
   "signatureHash": "a8a86b2720b90d2654e47185bc2916a1ea157ed73400c7e5dab0f5c12929e910",
   "attachment": {
    "version.OrdinaryPayment": 0
   },
   "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
   "subtype": 0,
   "amountNQT": "100000000",
   "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
   "block": "15841158543529465320",
   "blockTimestamp": 22294078,
   "deadline": 15,
   "timestamp": 22294046,
   "height": 375570,
   "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
   "chain": 2,
   "feeNQT": "100000",
   "confirmations": 50,
   "fullHash": "133e150482d54be300fbb42dc7c9f464abfb98e1ac43f4fb6b49e7241fa5d007",
   "version": 1,
   "sender": "15382970207090678772",
   "recipient": "11579697950237343285",
   "ecBlockHeight": 230000
  },
  {
   "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
   "chain": 2,
   "signature": "8d835e677fc990f082305cf289d797440dc816621a57cf3d340d714801522a015cadea4d...",
   "feeNQT": "100000",
   "transactionIndex": 1,
   "type": 9,
   "confirmations": 1322,
   "fullHash": "c3fcf792eec21a506dd5d1a72f8b2d3c58cecb401e2b6ecb18ddf843e2384f66",
   "version": 1,
   "fxtTransaction": "11288229594459966550",
   "phased": false,
   "ecBlockId": "2329106975025976796",
   "signatureHash": "12bd2919353c18c4dc2102e8da61ccc8853ca1ea1f424f881585886ccdf2fce6",
   "attachment": {
    "version.VoteCasting": 1,
    "poll": "13301905801047812208",
    "vote": [
     1,
     -128
    ]
   }
  ]
 }
}


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). Since version 2.3.0e it returns both bundled and non-bundled transactions.

Request:

  • requestType is getExpectedTransactions
  • chain is the chain that we want to retrieve the transactions (eg: 2 that is equivalent to IGNIS chain)
  • 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)

Get Expected Transactions Example

http://localhost:27876/nxt?
  requestType=getExpectedTransactions&
  chain=2&
  account=ARDOR-X5A4-FTMJ-J97M-F3ANH
{
 "expectedTransactions": [
 {
   "senderPublicKey": "aaf2ffc347dae1442f218c17ff9ae1e917ab32af0af779360737f6faf7a4023e",
   "signature": "58720e3cb6cd4a9ad1dcb0bede55952e624b02a125aa0ac5934d7312cf87660147b495...",
   "feeNQT": "100000000",
   "type": 2,
   "fullHash": "79df9c85bc30f4a72c5d1899ce57b6533f321e1412f433fc3975cd4142a3c781",
   "version": 1,
   "phased": false,
   "ecBlockId": "17663518922057624367",
   "signatureHash": "687701be20bfb0935b3165ae31c08b685a173be660a9720ed0319ec17cc646eb",
   "attachment": {
    "quantityQNT": "5",
    "priceNQT": "908000000",
    "asset": "8122396658538927693",
    "version.BidOrderPlacement": 1
   },
   "senderRS": "ARDOR-X5A4-FTMJ-J97M-F3ANH",
   "subtype": 3,
   "amountNQT": "0",
   "sender": "15551212561974070530",
   "ecBlockHeight": 820879,
   "deadline": 1440,
   "transaction": "12102351684905000825",
   "timestamp": 80248727,
   "height": 2147483647
  }
 ],
 "requestProcessingTime": 1
}


Get Fxt Transactions

Returns the child chain transactions bundled from a parent chain transaction.

Request:

  • requestType is getFxtTransaction
  • transaction is the 8 bytes transaction ID (shown as Entity in the Ardor UI)
  • fullHash fullHash is the 64 byte full hash id (either the transaction id or the full hash must be specified)
  • 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)
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Fxt Transactions Example

http://localhost:27876/nxt?
  requestType=getFxtTransaction&
  transaction=9487776060330762807&
  fullHash=376278f80e5aab83bb97bcab941cc35c643629f874a215f04b62480684456bdd
{
 "signature": "8e44f4b1437fc806e4a205e7243ee59b40a18b7358bc94a68e9759748d...",
 "transactionIndex": 0,
 "type": -2,
 "phased": false,
 "ecBlockId": "3847349073598953311",
 "signatureHash": "585341dbd1ab272351fee793f6baefaa6b712d197cda011ed51e60c4e7334417",
 "attachment": {
  "version.FxtPayment": 0
 },
 "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
 "subtype": 0,
 "amountNQT": "200000000000",
 "recipientRS": "ARDOR-28BK-8X84-Z6EM-3K97H",
 "block": "8691474189543266829",
 "blockTimestamp": 16419206,
 "deadline": 15,
 "timestamp": 16419187,
 "height": 276693,
 "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
 "chain": 1,
 "feeNQT": "100000000",
 "childTransactions": [],
 "requestProcessingTime": 1,
 "confirmations": 99065,
 "fullHash": "376278f80e5aab83bb97bcab941cc35c643629f874a215f04b62480684456bdd",
 "version": 1,
 "sender": "15382970207090678772",
 "recipient": "1699248179228186929",
 "ecBlockHeight": 275972,
 "transaction": "9487776060330762807"
}


Get Referencing Transactions

Gets the transactions referencing a given transaction id.

Request:

  • requestType is getReferencingTransactions
  • chain is the chain that we want to retrieve the transactions (eg: 2 that is equivalent to IGNIS chain)
  • transactionFullHash is the transaction Full Hash
  • firstIndex 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)
  • adminPassword Admin password parameter (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)

Get Referencing Transactions Example

http://localhost:27876/nxt?
  requestType=getReferencingTransactions&
  chain=2&
  transactionFullHash=c96b60bafc581891be88eae695f773677fe3cf7322cc149831d70de046041ea7
{
 "requestProcessingTime": 1,
 "transactions": [
  {
   "signature": "d9a62808d68d9ee35dac4be3f31075138071525ae839815cf834f5c6d1c63009102b4c1f1...",
   "transactionIndex": 1,
   "type": 0,
   "fxtTransaction": "1572937164448472925",
   "phased": false,
   "ecBlockId": "2329106975025976796",
   "signatureHash": "50282e80b507b164c990ec92fffc191a6571fc0608e89530c66a2058e049ac2f",
   "attachment": {
    "version.OrdinaryPayment": 0
   },
   "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
   "subtype": 0,
   "amountNQT": "1000000",
   "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
   "block": "4762895660554659519",
   "blockTimestamp": 22297596,
   "deadline": 15,
   "timestamp": 22297565,
   "height": 375629,
   "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
   "chain": 2,
   "feeNQT": "100000",
   "confirmations": 135,
   "fullHash": "91be75425ed620e405948488ff67edc2296b69671ba695f80e9ffdc7e5c88efc",
   "version": 1,
   "sender": "15382970207090678772",
   "recipient": "11579697950237343285",
   "ecBlockHeight": 230000
 ]
}


Get Transaction

Get a transaction object given a transaction ID.

Request:

  • requestType is getTransaction
  • chain is the chain that we want to retrieve the transactions (eg: 2 that is equivalent to IGNIS chain)
  • fullHash is the full hash of the transaction (optional if transaction ID is provided)
  • includePhasingResult is true 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 sender
  • senderRS (S) is the Reed-Solomon address of the sender
  • feeNQT (S) is the fee (in NQT) of the transaction
  • amountNQT (S) is the amount (in NQT) of the transaction
  • transactionIndex (N) is a zero-based index giving the order of the transaction in its block
  • timestamp (N) is the time (in seconds since the genesis block) of the transaction
  • referencedTransactionFullHash (S) is the full hash of a transaction referenced by this one, omitted if no previous transaction is referenced
  • confirmations (N) is the number of transaction confirmations
  • subtype (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 transaction
  • blockTimestamp (N) is the timestamp (in seconds since the genesis block) of the block
  • height (N) is the height of the block in the blockchain
  • senderPublicKey (S) is the public key of the sending account for the transaction
  • type (N) is the transaction type (refer to Get Constants for a current list of types)
  • chain (N) is the chain related to the transaction
  • fxtTransaction (N) is the child chain block transaction
  • deadline (N) is the deadline (in minutes) for the transaction to be confirmed
  • signature (S) is the digital signature of the transaction
  • recipient (S) is the account number of the recipient, if applicable
  • recipientRS (S) is the Reed-Solomon address of the recipient, if applicable
  • fullHash (S) is the full hash of the signed transaction
  • signatureHash (S) is a SHA-256 hash of the transaction signature
  • approved (B) is a boolean indicating if the transaction is approved (only included when includePhasingResult is true and the transaction is phased)
  • result (S) is a string containing the result of the transaction (only included when includePhasingResult is true and the transaction is phased)
  • executionHeight (N) is the height the transaction was executed (only included when includePhasingResult is true and the transaction is phased)
  • transaction (S) is the transaction ID
  • version (N) is the transaction version number
  • phased (B) is true if the transaction is phased, false otherwise
  • ecBlockId (N) is the economic clustering block ID
  • ecBlockHeight (N) is the economic clustering block height
  • attachment (O) is an object containing any additional data needed for the transaction, if applicable
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • 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.

Get Transaction Example

http://localhost:27876/nxt?
  requestType=getTransaction&
  chain=2&
  fullHash=91be75425ed620e405948488ff67edc2296b69671ba695f80e9ffdc7e5c88efc
{
 "signature": "d9a62808d68d9ee35dac4be3f31075138071525ae839815cf834...",
 "transactionIndex": 1,
 "type": 0,
 "fxtTransaction": "1572937164448472925",
 "phased": false,
 "ecBlockId": "2329106975025976796",
 "signatureHash": "50282e80b507b164c990ec92fffc191a6571fc0608e89530c66a2058e049ac2f",
 "attachment": {
  "version.OrdinaryPayment": 0
 },
 "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
 "subtype": 0,
 "amountNQT": "1000000",
 "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
 "block": "4762895660554659519",
 "blockTimestamp": 22297596,
 "deadline": 15,
 "timestamp": 22297565,
 "height": 375629,
 "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
 "chain": 2,
 "feeNQT": "100000",
 "requestProcessingTime": 0,
 "confirmations": 450,
 "fullHash": "91be75425ed620e405948488ff67edc2296b69671ba695f80e9ffdc7e5c88efc",
 "version": 1,
 "sender": "15382970207090678772",
 "recipient": "11579697950237343285",
 "ecBlockHeight": 230000
}


Get Transaction Bytes

Get the bytecode of a transaction.

Request:

  • requestType is getTransactionBytes
  • chain is the chain that we want to retrieve the transactions (eg: 2 that is equivalent to IGNIS chain)
  • fullHash is the full hash of the transaction
  • 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:

  • confirmations (N) is the number of transaction confirmations
  • transactionBytes (S) are the bytes contained in the transaction
  • unsignedTransactionBytes (S) are the unsigned bytes contained in the transaction
  • prunableAttachmentJSON (O) is the prunable attachment JSON object, if applicable, because transactionBytes never includes prunable data
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Transaction Bytes Example

http://localhost:27876/nxt?
  requestType=getTransactionBytes&
  chain=2&
  transaction=15200507403046301754
{
 "unsignedTransactionBytes": "001046aac6013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473...",
 "requestProcessingTime": 66,
 "confirmations": 1019,
 "transactionBytes": "001046aac6013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473..."
}


Get Unconfirmed Transaction Ids

Get all unconfirmed transaction Ids.

Request:

  • requestType is getUnconfirmedTransactionIds
  • chain is the chain that we want to retrieve the unconfirmed transactions (eg: 2 that is equivalent to IGNIS chain)
  • account is one account ID (optional)
  • account is one account ID (optional)

  • firstIndex is a zero-based index to the first transaction to retrieve (optional)
  • lastIndex is a zero-based index to the last transaction to retrieve (optional)
  • adminPassword Admin password parameter (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:

  • requestProcessingTime (N) is the API request processing time (in millisec)
  • unconfirmedTransactionIds (A) is an array containing all the unconfirmed transaction ids

Get Unconfirmed Transaction Ids Example

http://localhost:27876/nxt?
  requestType=getUnconfirmedTransactionIds&
  chain=2&
  account=ARDOR-X8ZN-WUJ2-SXY3-FBUYC
{
 "requestProcessingTime": 1,
 "unconfirmedTransactionIds": [
  "1150631032717207470"
 ]
}


Get Unconfirmed Transactions

Get all unconfirmed transactions.

Request:

  • requestType is getUnconfirmedTransactions
  • chain is the chain that we want to retrieve the unconfirmed transactions (eg: 2 that is equivalent to IGNIS chain)
  • account is one account ID (optional)
  • account is one account ID (optional)

  • firstIndex is a zero-based index to the first transaction to retrieve (optional)
  • lastIndex is a zero-based index to the last transaction to retrieve (optional)
  • adminPassword Admin password parameter (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:

  • unconfirmedTransactions (A) is an array of unconfirmed transactions (refer to Get Transaction for details)
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Unconfirmed Transactions Example

http://localhost:27876/nxt?
  requestType=getUnconfirmedTransactions&
  chain=2&
  account=ARDOR-X8ZN-WUJ2-SXY3-FBUYC
{
 "unconfirmedTransactions": [
  {
   "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
   "isBundled": false,
   "chain": 2,
   "signature": "e432e091242140a520ba1624e8cf7790925a85...",
   "feeNQT": "100000",
   "type": 0,
   "fullHash": "ae67a6f4d3dcf70fa48d8fdb0c5b2e7729cce437f60566fcfccba3c6f5f9e8f0",
   "version": 1,
   "fxtTransaction": "0",
   "phased": true,
   "ecBlockId": "2329106975025976796",
   "signatureHash": "9b8de30c10c69e04292d35b11b1355a0a17eae0cf73b5d79a062e50ae794d7e2",
   "attachment": {
    "phasingFinishHeight": 377534,
    "phasingHolding": "0",
    "phasingQuorum": "1",
    "version.Phasing": 1,
    "phasingWhitelist": [
     "15382970207090678772"
    ],
    "phasingMinBalance": "0",
    "phasingMinBalanceModel": 0,
    "version.OrdinaryPayment": 0,
    "phasingVotingModel": 0
   },
   "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
   "subtype": 0,
   "amountNQT": "1000000",
   "sender": "15382970207090678772",
   "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
   "recipient": "11579697950237343285",
   "ecBlockHeight": 230000,
   "deadline": 15,
   "timestamp": 22325223,
   "height": 2147483647
  }
 ],
 "requestProcessingTime": 1
}

Parse Transaction

Get a transaction object given a (signed or unsigned) transaction bytecode, or re-parse a transaction object. Verify the signature.

Request:

  • requestType is parseTransaction
  • transactionBytes is the signed or unsigned bytecode of the transaction (optional)
  • transactionJSON is the transaction object (optional if transactionBytes is included)
  • prunableAttachmentJSON is the attachment object embedded in transactionJSON containing a prunable message (required if transactionJSON not provided because transactionBytes never includes prunable data)
  • 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) is true if the signature is verified, false otherwise

Parse Transaction Example

http://localhost:27876/nxt?
  requestType=parseTransaction&
  transactionBytes=02000000000001e0217e022800df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0069c38ab5c7abe500e40b540200000040420f000000000058cda06a138b59b46b19c5e5d06d65334ed338d0e48d9694ae5c119913d2a00c9b4871989dd367442d1dbd94d22336515135cc3bf35e7c952c244e9d1b6a5c9810851a0069fb1adac03af20c40000000017ac01a000001000000000000000000000000000000016059eed721ae4ad4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
{
 "signature": "d9a62808d68d9ee35dac4be3f31075138071525ae839815cf834...",
 "transactionIndex": 1,
 "type": 0,
 "fxtTransaction": "1572937164448472925",
 "phased": false,
 "ecBlockId": "2329106975025976796",
 "signatureHash": "50282e80b507b164c990ec92fffc191a6571fc0608e89530c66a2058e049ac2f",
 "attachment": {
  "version.OrdinaryPayment": 0
 },
 "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
 "subtype": 0,
 "amountNQT": "1000000",
 "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
 "block": "4762895660554659519",
 "blockTimestamp": 22297596,
 "deadline": 15,
 "timestamp": 22297565,
 "height": 375629,
 "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
 "chain": 2,
 "feeNQT": "100000",
 "requestProcessingTime": 0,
 "confirmations": 450,
 "fullHash": "91be75425ed620e405948488ff67edc2296b69671ba695f80e9ffdc7e5c88efc",
 "version": 1,
 "sender": "15382970207090678772",
 "recipient": "11579697950237343285",
 "ecBlockHeight": 230000
}


Process Voucher

Process a voucher that has been previously generated. HTTP Post method only.

Request:

  • requestType is processVoucher
  • voucher is the json that contains the voucher
  • validate whether to validate or not the voucher
  • broadcast whether to broadcast or not the voucher transaction
  • 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:

  • broadcast determines whether the transaction was broadcasted or not
  • signedTransaction the signed transaction, refer to Get Transaction for additional fields.
  • voucher is the element that contains the voucher request id. Refer to Account operations

Parse Transaction Example

http://localhost:27876/nxt?
  requestType=processVoucher&
  secretPhrase=IwontTellYou
{
 "broadcast": "true",
 "signedTransaction": {
  "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
  "chain": 2,
  "signature": "1c18248e2a9caaa15f6542eafd44f9a7727ea8202bc295ac19e51e361f3a...",
  "feeNQT": "100000",
  "type": 0,
  "fullHash": "3880fc45b485c0d6cb745040d694d02149331c0009f606c4ca93ed2202e05d73",
  "version": 1,
  "fxtTransaction": "0",
  "phased": false,
  "ecBlockId": "2329106975025976796",
  "signatureHash": "2b268e179bce1dc632d67cf15c91c8be691d53f1825349e8ea9fc6aa6d0c864e",
  "attachment": {
   "version.OrdinaryPayment": 0
  },
  "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
  "subtype": 0,
  "amountNQT": "1000000",
  "sender": "15382970207090678772",
  "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
  "recipient": "11579697950237343285",
  "ecBlockHeight": 230000,
  "deadline": 15,
  "timestamp": 22326715,
  "height": 2147483647
 },
 "voucher": {
 "requestType": "sendMoney",
 "transactionJSON": {
  "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
  "chain": 2,
  "feeNQT": "100000",
  "type": 0,
  "version": 1,
  "fxtTransaction": "0",
  "phased": false,
  "ecBlockId": "2329106975025976796",
  "attachment": {
   "version.OrdinaryPayment": 0
  },
  "subtype": 0,
  "amountNQT": "1000000",
  "sender": "15382970207090678772",
  "recipient": "11579697950237343285",
  "ecBlockHeight": 230000,
  "deadline": 15,
  "timestamp": 22326715
 },
 "unsignedTransactionBytes": "020000000000018ead54010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cb...",
 "signature": "d2229d490d4913b42bcff5800e88de90f13a897687f361d51ed106862...",
 "publicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c"
 },
"verify": true,
"requestProcessingTime": 4,
"status": "valid"
}


Retrieve Pruned Transaction

Force retrieval of the prunable data for a given transaction, even if past the configured nxt.maxPrunableLifetime.

Request:

  • requestType is retrievePrunedTransaction
  • chain is the chain to retrieve the pruned transaction (eg: 2 or IGNIS)
  • transactionFullHash is transaction full hash

Response: Refer to Get Transaction for fields.

Retrieve Pruned Transaction Example

http://localhost:27876/nxt?
  requestType=retrievePrunedTransaction&
  chain=2&
  transactionFullHash=bb5dcd17fbe0b27b0ca62c3e22742b6d8ac82624e975ac97a8d56866f8829da1
{
 "signature": "3fd1082d55752f160569caaf8a0cff707a8b888f75a3816a1...",
 "transactionIndex": 1,
 "type": 0,
 "fxtTransaction": "18339021330515738632",
 "phased": false,
 "ecBlockId": "2329106975025976796",
 "signatureHash": "1d9e227783950aa6fae36217c9f8b5c0e8c4cc076e908d2513e7c599baa1bf8c",
 "attachment": {
  "version.OrdinaryPayment": 0
 },
 "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
 "subtype": 0,
 "amountNQT": "1000000",
 "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
 "block": "609073581120354350",
 "blockTimestamp": 22326989,
 "deadline": 15,
 "timestamp": 22326948,
 "height": 376125,
 "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
 "chain": 2,
 "feeNQT": "100000",
 "requestProcessingTime": 1,
 "confirmations": 16,
 "fullHash": "bb5dcd17fbe0b27b0ca62c3e22742b6d8ac82624e975ac97a8d56866f8829da1",
 "version": 1,
 "sender": "15382970207090678772",
 "recipient": "11579697950237343285",
 "ecBlockHeight": 230000
}


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 is sendTransaction
  • transactionBytes is the bytecode of a signed transaction (optional)
  • transactionJSON is the transaction object (optional if transactionBytes provided)
  • prunableAttachmentJSON is the attachment object embedded in transactionJSON containing a prunable message (required if transactionJSON not provided because transactionBytes never includes prunable data)
  • adminPassword Admin password parameter (optional)

Response:

  • requestProcessingTime (N) is the API request processing time (in millisec)
  • fullHash (S) is the full hash of the signed transaction
  • transaction (S) is the transaction ID

Send Transaction Example

http://localhost:27876/nxt?
  requestType=sendTransaction&
  transactionBytes=02000000000001e0217e022800df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0069c38ab5c7abe500e40b540200000040420f000000000058cda06a138b59b46b19c5e5d06d65334ed338d0e48d9694ae5c119913d2a00c9b4871989dd367442d1dbd94d22336515135cc3bf35e7c952c244e9d1b6a5c9810851a0069fb1adac03af20c40000000017ac01a000001000000000000000000000000000000016059eed721ae4ad4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
{
 "requestProcessingTime": 2,
 "fullHash": "799ad836f9c65e2985978123f145130b867bab9a86f6fdabae8e8c8f25c087dc",
 "transaction": "2981038777035168377"
}


Sign Transaction

Calculates the full hash, signature hash, and transaction ID of an unsigned transaction.

Request:

  • requestType is signTransaction
  • unsignedTransactionJSON is the transactionJSON field of the transaction, without a signature subfield
  • unsignedTransactionBytes is the unsignedTransactionBytes field of the transaction (optional, if unsignedTransactionJSON provided)
  • prunableAttachmentJSON is a prunable attachment JSON object, if applicable, because unsignedTransactionBytes 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 account
  • privateKey (S) is the privateKey (hex) of the derived account (HD wallet, refer to: Getting the private key from the derived account)
  • validate is false 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 transactions
  • verify (B) is true the signature is verified, false if not
  • transactionJSON (O) is the signed transaction JSON object
  • transactionBytes (S) are the signed transaction bytes
  • fullHash (S) is the full hash of the signed transaction
  • prunableAttachmentJSON (O) is the prunable attachment JSON object, if applicable, because transactionBytes never includes prunable data
  • transaction (S) is the transaction ID, derived from the fullHash
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Sign Transaction Example

http://localhost:27876/nxt?
  requestType=signTransaction&
  unsignedTransactionBytes=02000000000001e0217e022800df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0069c38ab5c7abe500e40b540200000040420f000000000058cda06a138b59b46b19c5e5d06d65334ed338d0e48d9694ae5c119913d2a00c9b4871989dd367442d1dbd94d22336515135cc3bf35e7c952c244e9d1b6a5c9810851a0069fb1adac03af20c40000000017ac01a000001000000000000000000000000000000016059eed721ae4ad4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000&
  secretPhrase=SecretPhrase
{
 "signatureHash": "3f4830bf28f105d5075f5e084c36e4582a156e713abfe0bc6ee51cbf8b20f2d2",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "signature": "24513e93029688100c5a04183ffddc49812fd7a137a15fb3a2545aa9a2bcb5004a3...",
  "feeNQT": "100000000",
  "type": 0,
  "fullHash": "c34af8f1509e3be79c4562e24125ff2a8f026871fdd1a0366ad315bf8fab76b9",
  "version": 1,
  "phased": false,
  "ecBlockId": "15869644242181198665",
  "signatureHash": "3f4830bf28f105d5075f5e084c36e4582a156e713abfe0bc6ee51cbf8b20f2d2",
  "attachment": {
   "version.OrdinaryPayment": 0
  },
  "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 0,
  "amountNQT": "1000000000",
  "sender": "15295723609781267838",
  "recipientRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
  "recipient": "11580081983047651163",
  "ecBlockHeight": 382777,
  "deadline": 1440,
  "transaction": "16662085316881435331",
  "timestamp": 54328076,
  "height": 2147483647
 },
 "verify": true,
 "requestProcessingTime": 5,
 "transactionBytes": "00100cfb3c03a00510f09c34f225d425306e5be55a4946908156072afbead4...",
 "fullHash": "c34af8f1509e3be79c4562e24125ff2a8f026871fdd1a0366ad315bf8fab76b9",
 "transaction": "16662085316881435331"
}