Get transaction

Retrieves details for a specific transaction.

GET
/extended/v1/tx/{tx_id}

Path Parameters

tx_idTransaction ID

Transaction ID

Pattern"^(0x)?[a-fA-F0-9]{64}$"

Query Parameters

event_limit?Limit

Results per page

Default20
Rangevalue <= 100
event_offset?Offset

Result offset

Default0
unanchored?boolean

Include data from unanchored (i.e. unconfirmed) microblocks

Defaultfalse

Response Body

Default Response

TypeScript Definitions

Use the response body type in TypeScript.

tx_idstring

Transaction ID

nonceinteger

Used for ordering the transactions originating from and paying from an account. The nonce ensures that a transaction is processed at most once. The nonce counts the number of times an account's owner(s) have authorized a transaction. The first transaction from an account will have a nonce value equal to 0, the second will have a nonce value equal to 1, and so on.

fee_ratestring

Transaction fee as Integer string (64-bit unsigned integer).

sender_addressstring

Address of the transaction initiator

sponsor_nonce?integer
sponsoredboolean

Denotes whether the originating account is the same as the paying account

sponsor_address?string
post_condition_modestring & string
post_conditionsarray<object & object & object>
anchor_modestring & string & string

on_chain_only: the transaction MUST be included in an anchored block, off_chain_only: the transaction MUST be included in a microblock, any: the leader can choose where to include the transaction.

block_hashstring

Hash of the blocked this transactions was associated with

block_heightinteger

Height of the block this transactions was associated with

block_timenumber

Unix timestamp (in seconds) indicating when this block was mined.

block_time_isostring

An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) indicating when this block was mined.

burn_block_timeinteger

Unix timestamp (in seconds) indicating when this block was mined.

burn_block_heightinteger

Height of the anchor burn block.

burn_block_time_isostring

An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) timestamp indicating when this block was mined.

parent_burn_block_timeinteger

Unix timestamp (in seconds) indicating when this parent block was mined

parent_burn_block_time_isostring

An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) timestamp indicating when this parent block was mined.

canonicalboolean

Set to true if block corresponds to the canonical chain tip

tx_indexinteger

Index of the transaction, indicating the order. Starts at 0 and increases with each transaction

tx_statusstring & string & string & string & string & string

Status of the transaction

tx_resultobject

Result of the transaction. For contract calls, this will show the value returned by the call. For other transaction types, this will return a boolean indicating the success of the transaction.

event_countinteger

Number of transaction events

parent_block_hashstring

Hash of the previous block.

is_unanchoredboolean

True if the transaction is included in a microblock that has not been confirmed by an anchor block.

microblock_hashstring

The microblock hash that this transaction was streamed in. If the transaction was batched in an anchor block (not included within a microblock) then this value will be an empty string.

microblock_sequenceinteger

The microblock sequence number that this transaction was streamed in. If the transaction was batched in an anchor block (not included within a microblock) then this value will be 2147483647 (0x7fffffff, the max int32 value), this value preserves logical transaction ordering on (block_height, microblock_sequence, tx_index).

microblock_canonicalboolean

Set to true if microblock is anchored in the canonical chain tip, false if the transaction was orphaned in a micro-fork.

execution_cost_read_countinteger

Execution cost read count.

execution_cost_read_lengthinteger

Execution cost read length.

execution_cost_runtimeinteger

Execution cost runtime.

execution_cost_write_countinteger

Execution cost write count.

execution_cost_write_lengthinteger

Execution cost write length.

vm_errorstring | null
eventsarray<SmartContractLogTransactionEvent & StxLockTransactionEvent & StxAssetTransactionEvent & FungibleTokenAssetTransactionEvent & NonFungibleTokenAssetTransactionEvent>
tx_typestring
Value in"tenure_change"
token_transferobject
smart_contractobject
contract_callobject
poison_microblockobject
coinbase_payloadobject
tenure_change_payloadobject
receipt_timeinteger

A unix timestamp (in seconds) indicating when the transaction broadcast was received by the node.

receipt_time_isostring

An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) timestamp indicating when the transaction broadcast was received by the node.

Default Response

TypeScript Definitions

Use the response body type in TypeScript.

errorstring
message?string
[key: string]any
curl -X GET "https://api.hiro.so//extended/v1/tx/0xf6bd5f4a7b26184a3466340b2e99fd003b4962c0e382a7e4b6a13df3dd7a91c6?event_limit=20&event_offset=0&unanchored=true"
fetch("https://api.hiro.so//extended/v1/tx/0xf6bd5f4a7b26184a3466340b2e99fd003b4962c0e382a7e4b6a13df3dd7a91c6?event_limit=20&event_offset=0&unanchored=true")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.hiro.so//extended/v1/tx/0xf6bd5f4a7b26184a3466340b2e99fd003b4962c0e382a7e4b6a13df3dd7a91c6?event_limit=20&event_offset=0&unanchored=true"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.hiro.so//extended/v1/tx/0xf6bd5f4a7b26184a3466340b2e99fd003b4962c0e382a7e4b6a13df3dd7a91c6?event_limit=20&event_offset=0&unanchored=true"

response = requests.request("GET", url)

print(response.text)
{
  "tx_id": "string",
  "nonce": 0,
  "fee_rate": "string",
  "sender_address": "string",
  "sponsor_nonce": 0,
  "sponsored": true,
  "sponsor_address": "string",
  "post_condition_mode": "allow",
  "post_conditions": [
    {
      "principal": {
        "type_id": "principal_origin"
      },
      "condition_code": "sent_equal_to",
      "amount": "string",
      "type": "stx"
    }
  ],
  "anchor_mode": "on_chain_only",
  "block_hash": "string",
  "block_height": 0,
  "block_time": 0,
  "block_time_iso": "string",
  "burn_block_time": 0,
  "burn_block_height": 0,
  "burn_block_time_iso": "string",
  "parent_burn_block_time": 0,
  "parent_burn_block_time_iso": "string",
  "canonical": true,
  "tx_index": 0,
  "tx_status": "success",
  "tx_result": {
    "hex": "string",
    "repr": "string"
  },
  "event_count": 0,
  "parent_block_hash": "string",
  "is_unanchored": true,
  "microblock_hash": "string",
  "microblock_sequence": 0,
  "microblock_canonical": true,
  "execution_cost_read_count": 0,
  "execution_cost_read_length": 0,
  "execution_cost_runtime": 0,
  "execution_cost_write_count": 0,
  "execution_cost_write_length": 0,
  "vm_error": "string",
  "events": [
    {
      "event_index": 0,
      "event_type": "smart_contract_log",
      "tx_id": "string",
      "contract_log": {
        "contract_id": "string",
        "topic": "string",
        "value": {
          "hex": "string",
          "repr": "string"
        }
      }
    }
  ],
  "tx_type": "token_transfer",
  "token_transfer": {
    "recipient_address": "string",
    "amount": "string",
    "memo": "string"
  }
}
{
  "error": "string",
  "message": "string"
}