Transactions

Get Transaction

Get block information for a given block id

GET/transactions/{transactionId}
Path parameters
transactionId*Transactionid
Pattern: [a-f0-9]{64}
Query parameters
Response

Successful Response

Body
subnetwork_idSubnetwork Id
transaction_idTransaction Id
hashHash
massMass
block_hashBlock Hash
block_timeBlock Time
is_acceptedIs Accepted
accepting_block_hashAccepting Block Hash
accepting_block_blue_scoreAccepting Block Blue Score
inputsInputs
outputsOutputs
Request
const response = await fetch('/transactions/{transactionId}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "subnetwork_id": "text",
  "transaction_id": "text",
  "hash": "text",
  "mass": "text",
  "block_hash": [
    "text"
  ],
  "block_time": 0,
  "is_accepted": false,
  "accepting_block_hash": "text",
  "accepting_block_blue_score": 0,
  "inputs": [
    {
      "id": 0,
      "transaction_id": "text",
      "index": 0,
      "previous_outpoint_hash": "text",
      "previous_outpoint_index": "text",
      "previous_outpoint_resolved": {
        "id": 0,
        "transaction_id": "text",
        "index": 0,
        "amount": 0,
        "script_public_key": "text",
        "script_public_key_address": "text",
        "script_public_key_type": "text",
        "accepting_block_hash": "text"
      },
      "previous_outpoint_address": "text",
      "previous_outpoint_amount": 0,
      "signature_script": "text",
      "sig_op_count": "text"
    }
  ],
  "outputs": [
    {
      "id": 0,
      "transaction_id": "text",
      "index": 0,
      "amount": 0,
      "script_public_key": "text",
      "script_public_key_address": "text",
      "script_public_key_type": "text",
      "accepting_block_hash": "text"
    }
  ]
}

Submit A New Transaction

Forwards the body directly to kaspad with the command submitTransactionRequest

POST/transactions
Body
transaction*SubmitTxModel
allowOrphanAlloworphan
Response

Successful Response

Body
transactionIdTransactionid
errorError
Request
const response = await fetch('/transactions', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "transaction": {
        "version": 0,
        "inputs": [
          {
            "previousOutpoint": {
              "transactionId": "text",
              "index": 0
            },
            "signatureScript": "text",
            "sequence": 0,
            "sigOpCount": 0
          }
        ],
        "outputs": [
          {
            "amount": 0,
            "scriptPublicKey": {
              "version": 0,
              "scriptPublicKey": "text"
            }
          }
        ]
      }
    }),
});
const data = await response.json();
Response
{
  "transactionId": "text",
  "error": "text"
}