Skip to content

getTransaction

AxVultis edited this page Nov 12, 2022 · 10 revisions

The getTransaction method returns information about a particular transaction. A transaction consists of one or more transfers. A transfer is an amount-address pair. There could be several transfers in a single transaction.

Request Format

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 11,
  "method": "getTransaction",
  "params": {
    "transactionHash": "495f5944490c0ae76eee4c5634a1f9374d7406e728d45fabc4972f997c5e115d"
  }
}

Request Details:

Argument Mandatory Description Format
transactionHash Yes Hash of the requested transaction string

Response Format

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 11,
  "result": {
    "transaction": {
      "amount": -1000,
      "blockIndex": 488775,
      "confirmations": 55366,
      "depositCount": 1,
      "extra": "01e3efcba7dba9af50475b23ae5082b0a9ad87c1f094c64dac7a9ce80b9f05ecc4",
      "fee": 1000,
      "firstDepositId": 2,
      "isBase": false,
      "paymentId": "",
      "state": 0,
      "timestamp": 1587386789,
      "transactionHash": "495f5944490c0ae76eee4c5634a1f9374d7406e728d45fabc4972f997c5e115d",
      "transfers": [
        {
          "address": "ccx7Xh4S7w3RtRbmfv3BaTNMZcbZL......74vDU5hw2eXjGwyiC8JfT3vPaUSmg9g1utGShBrGS",
          "amount": -7000000,
          "message": "",
          "type": 0
        },
        {
          "address": "ccx7Xh4S7w3RtRbmfv3BaTNMZcbZLu......4vDU5hw2eXjGwyiC8JfT3vPaUSmg9g1utGShBrGS",
          "amount": 6999000,
          "message": "",
          "type": 0
        }
      ],
      "unlockTime": 0
    }
  }
}

Response Details:

Argument Description Format
transaction Contains (see table below) array

Transaction Details:

Argument Description Format
transactionHash hash of the transaction string
blockIndex number of the block that contains a transaction (optional) int
depositCount Number of deposits in the transactions int
firstDepositId The depositId of the first deposit in the transaction int
isBase shows if the transaction is a coinbase transaction or not boolean
unlockTime height of the block when transaction is going to be available for spending int
amount amount of the transaction int
fee transaction fee int
extra string
paymentId payment_id of the transaction string
transfers Contains (see table below) array

Transfer Details:

Argument Description Format
address address string
amount amount transferred int
message string
type The type of transfer int

Possible Errors

  • Object not found - The transaction does not exist in this container.
  • Parse error - Incorrect formatting, JSON, or quotation marks used.
Clone this wiki locally