Documentation Powered by ReDoc

# Stacks 2.0 Blockchain API (v0.71.2)

Download OpenAPI specification:Download

This is the documentation for the Stacks 2.0 Blockchain API.

It is comprised of two parts; the Stacks Blockchain API and the Stacks Core API.

Download Postman collection

# Faucets

## Get STX tokens

Get STX tokens for the testnet

##### query Parameters

address required | string STX address
stacking | boolean Default: false Request the amount of STX needed for stacking

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/faucets/stx

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/faucets/stx

Local

http://localhost:3999/extended/v1/faucets/stx

### Response samples

- 200

Content type
application/json
`
{

- "success": true,
- "txId": "0xf2f0402f9f4c4d43b382690c4f7b97e24d5ff5dd5c619e3615daa64dca7ef4bc",
- "txRaw": "80800000000400164247d6f2b425ac5771423ae6c80c754f7172b0000000000000003200000000000000b400008537046ff1008368baaa3ff2235122c556b89dad4f9df0639b924cf32a44b866497e49846b24191e711b21faaae96ca0542e4a140168484740b94211cececb3303020000000000051ab52c45b1a7977204f17ac0b6f48306aea2dbb8e9000000000007a12046617563657400000000000000000000000000000000000000000000000000000000"

}`

## Get BTC tokens

Get BTC tokens for the testnet

##### query Parameters

address required | string BTC address

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/faucets/btc

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/faucets/btc

Local

http://localhost:3999/extended/v1/faucets/btc

### Response samples

- 200

Content type
application/json
`
{

- "success": true,
- "txId": "0xf2f0402f9f4c4d43b382690c4f7b97e24d5ff5dd5c619e3615daa64dca7ef4bc",
- "txRaw": "80800000000400164247d6f2b425ac5771423ae6c80c754f7172b0000000000000003200000000000000b400008537046ff1008368baaa3ff2235122c556b89dad4f9df0639b924cf32a44b866497e49846b24191e711b21faaae96ca0542e4a140168484740b94211cececb3303020000000000051ab52c45b1a7977204f17ac0b6f48306aea2dbb8e9000000000007a12046617563657400000000000000000000000000000000000000000000000000000000"

}`

# Transactions

## Get recent transactions

Get all recently mined transactions

If using TypeScript, import typings for this response from our types package:

`import type { TransactionResults } from '@stacks/stacks-blockchain-api-types';`

##### query Parameters

limit | integer max number of transactions to fetch
offset | integer index of first transaction to fetch
type | Array of strings Items Enum: "coinbase" "token_transfer" "smart_contract" "contract_call" "poison_microblock" Filter by transaction type
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tx

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tx

Local

http://localhost:3999/extended/v1/tx

### Response samples

- 200

Content type
application/json
`
{

- "limit": 10,
- "offset": 0,
- "total": 101922,
- "results":
  [
  - {
    - "tx_id": "0x20dedbef812e44d712569224411b27324b68ab4667321a4badd5e81ba76bf0eb",
    - "nonce": 269,
    - "fee_rate": "0",
    - "sender_address": "SPQXK10DBF5ECAM30XVE3EJA8DNZF3VE0BK4MKV",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "on_chain_only",
    - "is_unanchored": false,
    - "block_hash": "0x28a9e2749b82bdc058776781a5abd5c9a6efed38f05545a8a51152655b8e1f4b",
    - "parent_block_hash": "0x3789b75ccfe7f2acf85c3f069fd5b8f95f73aba5332fa618243957d1c017a2a3",
    - "block_height": 21709,
    - "burn_block_time": 1626286436,
    - "burn_block_time_iso": "2021-07-14T18:13:56.000Z",
    - "canonical": true,
    - "tx_index": 0,
    - "tx_status": "success",
    - "tx_result":
      {
      - "hex": "0x0703",
      - "repr": "(ok true)"
      },
    - "microblock_hash": "",
    - "microblock_sequence": 2147483647,
    - "microblock_canonical": true,
    - "event_count": 0,
    - "events": [ ],
    - "tx_type": "coinbase",
    - "coinbase_payload":
      {
      - "data": "0x0000000000000000000000000000000000000000000000000000000000000000"
      }
    }
  ]

}`

## Get mempool transactions

Get all recently-broadcast mempool transactions

##### query Parameters

sender_address | string Filter to only return transactions with this sender address.
recipient_address | string Filter to only return transactions with this recipient address (only applicable for STX transfer tx types).
address | string Filter to only return transactions with this address as the sender or recipient (recipient only applicable for STX transfer tx types).
limit | integer max number of mempool transactions to fetch
offset | integer index of first mempool transaction to fetch
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/mempool

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tx/mempool

Local

http://localhost:3999/extended/v1/tx/mempool

### Response samples

- 200

Content type
application/json
`
{

- "limit": 96,
- "offset": 0,
- "total": 5,
- "results":
  [
  - {
    - "tx_id": "0xb31df5a363dad31723324cb5e0eefa04d491519fd30827a521cbc830114aa50c",
    - "tx_status": "pending",
    - "tx_type": "token_transfer",
    - "receipt_time": 1598288370,
    - "receipt_time_iso": "2020-08-24T16:59:30.000Z",
    - "fee_rate": "180",
    - "sender_address": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "token_transfer":
      {
      - "recipient_address": "ST1GY25DM8RZV4X15X07THRZ2C5NMWPGQWKFGV87F",
      - "amount": "500000",
      - "memo": "0x46617563657400000000000000000000000000000000000000000000000000000000"
      }
    },
  - {
    - "tx_id": "0x5bed8e3f801cb4e2c74d2815a092f7c1c6a35f2fce4a80c80ca70848d34cb395",
    - "tx_status": "pending",
    - "tx_type": "token_transfer",
    - "receipt_time": 1598282326,
    - "receipt_time_iso": "2020-08-24T15:18:46.000Z",
    - "fee_rate": "180",
    - "sender_address": "ST1PS1KF93VBY5A1JV7TM66KN046KP3E3761DBSAG",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "token_transfer":
      {
      - "recipient_address": "ST2H33S8SEY27QKEKQKR6S5PECYPKY45CQYGGQR8X",
      - "amount": "1000",
      - "memo": "0x00000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
  - {
    - "tx_id": "0x9916036fde08a207e581cdcabc18ff55469861cb81194ab0e3e7c9a02cd5a17c",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598258958,
    - "receipt_time_iso": "2020-08-24T08:49:18.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8.test-loans-1",
      - "source_code": "(define-data-var stx-loaned int 0)\n(define-data-var lockup-period int 0)\n(define-data-var stx-return int 0)\n(define-public (get-stx-return (stx uint) (months uint))\n (ok\n (begin\n (var-set stx-loaned (to-int(stx))\n (var-set lockup-period (to-int(months))\n (calculate-stx-return)\n (print (var-get stx-return))\n (transfer-to-server)\n )\n )\n)\n(define-private (calculate-stx-return)\n (ok\n (begin\n (var-set stx-return (- (+ (* (/ (* (var-get stx-loaned) 5) 100) (var-get lockup-period)) (var-get stx-loaned)) 5))\n )\n )\n)\n(define-private (transfer-to-server)\n (begin\n (unwrap-panic (stx-transfer? (to-uint (var-get stx-loaned)) tx-sender 'ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8))\n (ok (to-uint (var-get stx-loaned)))\n )\n)"
      }
    },
  - {
    - "tx_id": "0x871fb186c8d6ac6ede2822c71074d9884b593c0d7f2d0d6e8516e615484d7501",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598230365,
    - "receipt_time_iso": "2020-08-24T00:52:45.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230358601",
      - "source_code": ";; ## CUSTOM FUNCTION TO EXTRACT A SUBSTRING\n\n(define-read-only (subs (source (buff 10)) \n (start int) \n (end int))\n (begin\n (unwrap-panic (if (and (<= 0 start) (<= start 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 0 end) (<= end 10)) (ok 1) (err \"Out of bounds: end\")))\n (let ((temp1 (fold subs1 source \n {start: start, end: end, cursor: 1, data: \"\"})))\n (let ((data (get data temp1))) \n data))))\n\n \n;; Call the function to extract the substring between the bounds:\n\n;; (subs \"123456789\" 2 5)\n\n(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int})) \n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp2 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp3 start)\n (temp4 cursor)\n (temp5 end))\n (and (<= temp3 temp4)\n (<= temp4 temp5)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp2),\n data: (get data temp2)})))\n"
      }
    },
  - {
    - "tx_id": "0x66df10d99d3a26018f521d60e9f744b083386c73e47ad39c394d570abee55f1f",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598230066,
    - "receipt_time_iso": "2020-08-24T00:47:46.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230054238",
      - "source_code": "(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int}))\n (begin\n (unwrap-panic (if (and (<= 1 (get start acc)) (<= (get start acc) 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 1 (get end acc)) (<= (get end acc) 10)) (ok 1) (err \"Out of bounds: end\")))\n (unwrap-panic (if (and (<= 1 (get cursor acc)) (<= (get cursor acc) 10)) (ok 1) (err \"Out of bounds: cursor\")))\n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp1 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp2 start)\n (temp3 cursor)\n (temp4 end))\n (and (<= temp2 temp3)\n (<= temp3 temp4)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp1),\n data: (get data temp1)}))))\n"
      }
    },
  - {
    - "tx_id": "0x7402d8e52204d6c8cba7465e159e79750338c3ee31d4fe6ddef1d4d226304b65",
    - "nonce": 1,
    - "fee_rate": "227",
    - "sender_address": "SP1HJDP35SSMYP98CG8SHMYHMZDK0A495ZCH6ARYS",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions":
      [
      - {
        - "type": "stx",
        - "condition_code": "sent_equal_to",
        - "amount": "88884500",
        - "principal":
          {
          - "type_id": "principal_standard",
          - "address": "SP2J6HSSDYSTM71S0K0KK4YWRKX59JN1AD52M4B59"
          }
        }
      ],
    - "anchor_mode": "any",
    - "tx_status": "pending",
    - "receipt_time": 1626286631,
    - "receipt_time_iso": "2021-07-14T18:17:11.000Z",
    - "tx_type": "contract_call",
    - "contract_call":
      {
      - "contract_id": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo",
      - "function_name": "send-many",
      - "function_signature": "(define-public (send-many (recipients (list 200 (tuple (memo (buff 34)) (to principal) (ustx uint))))))",
      - "function_args":
        [
        - {
          - "hex": "0x0b000000010c00000003046d656d6f020000000e357a62597346716a52336d736b7102746f0516b734e97043840503dc1091661c105d32b7c5c75d047573747801000000000000000000000000054c4514",
          - "repr": "(list (tuple (memo 0x357a62597346716a52336d736b71) (to SP2VK9TBG8E20A0YW228PC70GBMSBFHE7BNVMKB57) (ustx u88884500)))",
          - "name": "recipients",
          - "type": "(list 200 (tuple (memo (buff 34)) (to principal) (ustx uint)))"
          }
        ]
      }
    }
  ]

}`

## Get dropped mempool transactions

Get all recently-broadcast mempool transactions

##### query Parameters

limit | integer max number of mempool transactions to fetch
offset | integer index of first mempool transaction to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/mempool/dropped

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tx/mempool/dropped

Local

http://localhost:3999/extended/v1/tx/mempool/dropped

### Response samples

- 200

Content type
application/json
`
{

- "limit": 96,
- "offset": 0,
- "total": 5,
- "results":
  [
  - {
    - "tx_id": "0xb31df5a363dad31723324cb5e0eefa04d491519fd30827a521cbc830114aa50c",
    - "tx_status": "pending",
    - "tx_type": "token_transfer",
    - "receipt_time": 1598288370,
    - "receipt_time_iso": "2020-08-24T16:59:30.000Z",
    - "fee_rate": "180",
    - "sender_address": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "token_transfer":
      {
      - "recipient_address": "ST1GY25DM8RZV4X15X07THRZ2C5NMWPGQWKFGV87F",
      - "amount": "500000",
      - "memo": "0x46617563657400000000000000000000000000000000000000000000000000000000"
      }
    },
  - {
    - "tx_id": "0x5bed8e3f801cb4e2c74d2815a092f7c1c6a35f2fce4a80c80ca70848d34cb395",
    - "tx_status": "pending",
    - "tx_type": "token_transfer",
    - "receipt_time": 1598282326,
    - "receipt_time_iso": "2020-08-24T15:18:46.000Z",
    - "fee_rate": "180",
    - "sender_address": "ST1PS1KF93VBY5A1JV7TM66KN046KP3E3761DBSAG",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "token_transfer":
      {
      - "recipient_address": "ST2H33S8SEY27QKEKQKR6S5PECYPKY45CQYGGQR8X",
      - "amount": "1000",
      - "memo": "0x00000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
  - {
    - "tx_id": "0x9916036fde08a207e581cdcabc18ff55469861cb81194ab0e3e7c9a02cd5a17c",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598258958,
    - "receipt_time_iso": "2020-08-24T08:49:18.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8.test-loans-1",
      - "source_code": "(define-data-var stx-loaned int 0)\n(define-data-var lockup-period int 0)\n(define-data-var stx-return int 0)\n(define-public (get-stx-return (stx uint) (months uint))\n (ok\n (begin\n (var-set stx-loaned (to-int(stx))\n (var-set lockup-period (to-int(months))\n (calculate-stx-return)\n (print (var-get stx-return))\n (transfer-to-server)\n )\n )\n)\n(define-private (calculate-stx-return)\n (ok\n (begin\n (var-set stx-return (- (+ (* (/ (* (var-get stx-loaned) 5) 100) (var-get lockup-period)) (var-get stx-loaned)) 5))\n )\n )\n)\n(define-private (transfer-to-server)\n (begin\n (unwrap-panic (stx-transfer? (to-uint (var-get stx-loaned)) tx-sender 'ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8))\n (ok (to-uint (var-get stx-loaned)))\n )\n)"
      }
    },
  - {
    - "tx_id": "0x871fb186c8d6ac6ede2822c71074d9884b593c0d7f2d0d6e8516e615484d7501",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598230365,
    - "receipt_time_iso": "2020-08-24T00:52:45.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230358601",
      - "source_code": ";; ## CUSTOM FUNCTION TO EXTRACT A SUBSTRING\n\n(define-read-only (subs (source (buff 10)) \n (start int) \n (end int))\n (begin\n (unwrap-panic (if (and (<= 0 start) (<= start 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 0 end) (<= end 10)) (ok 1) (err \"Out of bounds: end\")))\n (let ((temp1 (fold subs1 source \n {start: start, end: end, cursor: 1, data: \"\"})))\n (let ((data (get data temp1))) \n data))))\n\n \n;; Call the function to extract the substring between the bounds:\n\n;; (subs \"123456789\" 2 5)\n\n(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int})) \n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp2 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp3 start)\n (temp4 cursor)\n (temp5 end))\n (and (<= temp3 temp4)\n (<= temp4 temp5)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp2),\n data: (get data temp2)})))\n"
      }
    },
  - {
    - "tx_id": "0x66df10d99d3a26018f521d60e9f744b083386c73e47ad39c394d570abee55f1f",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598230066,
    - "receipt_time_iso": "2020-08-24T00:47:46.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230054238",
      - "source_code": "(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int}))\n (begin\n (unwrap-panic (if (and (<= 1 (get start acc)) (<= (get start acc) 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 1 (get end acc)) (<= (get end acc) 10)) (ok 1) (err \"Out of bounds: end\")))\n (unwrap-panic (if (and (<= 1 (get cursor acc)) (<= (get cursor acc) 10)) (ok 1) (err \"Out of bounds: cursor\")))\n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp1 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp2 start)\n (temp3 cursor)\n (temp4 end))\n (and (<= temp2 temp3)\n (<= temp3 temp4)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp1),\n data: (get data temp1)}))))\n"
      }
    },
  - {
    - "tx_id": "0x7402d8e52204d6c8cba7465e159e79750338c3ee31d4fe6ddef1d4d226304b65",
    - "nonce": 1,
    - "fee_rate": "227",
    - "sender_address": "SP1HJDP35SSMYP98CG8SHMYHMZDK0A495ZCH6ARYS",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions":
      [
      - {
        - "type": "stx",
        - "condition_code": "sent_equal_to",
        - "amount": "88884500",
        - "principal":
          {
          - "type_id": "principal_standard",
          - "address": "SP2J6HSSDYSTM71S0K0KK4YWRKX59JN1AD52M4B59"
          }
        }
      ],
    - "anchor_mode": "any",
    - "tx_status": "pending",
    - "receipt_time": 1626286631,
    - "receipt_time_iso": "2021-07-14T18:17:11.000Z",
    - "tx_type": "contract_call",
    - "contract_call":
      {
      - "contract_id": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo",
      - "function_name": "send-many",
      - "function_signature": "(define-public (send-many (recipients (list 200 (tuple (memo (buff 34)) (to principal) (ustx uint))))))",
      - "function_args":
        [
        - {
          - "hex": "0x0b000000010c00000003046d656d6f020000000e357a62597346716a52336d736b7102746f0516b734e97043840503dc1091661c105d32b7c5c75d047573747801000000000000000000000000054c4514",
          - "repr": "(list (tuple (memo 0x357a62597346716a52336d736b71) (to SP2VK9TBG8E20A0YW228PC70GBMSBFHE7BNVMKB57) (ustx u88884500)))",
          - "name": "recipients",
          - "type": "(list 200 (tuple (memo (buff 34)) (to principal) (ustx uint)))"
          }
        ]
      }
    }
  ]

}`

## Get transaction

Get a specific transaction by ID

`import type { Transaction } from '@stacks/stacks-blockchain-api-types';`

##### path Parameters

tx_id required | string Hash of transaction

##### query Parameters

event_offset | integer Default: 0 The number of events to skip
event_limit | integer Default: 96 The numbers of events to return
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/{tx_id}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tx/{tx_id}

Local

http://localhost:3999/extended/v1/tx/{tx_id}

### Response samples

- 200

Content type
application/json
`
{

- "tx_id": "0x5e9f3933e358df6a73fec0d47ce3e1062c20812c129f5294e6f37a8d27c051d9",
- "tx_status": "success",
- "tx_type": "coinbase",
- "fee_rate": "0",
- "sender_address": "ST3WCQ6S0DFT7YHF53M8JPKGDS1N1GSSR91677XF1",
- "sponsored": false,
- "post_condition_mode": "deny",
- "is_unanchored": false,
- "microblock_hash": "",
- "microblock_sequence": 2147483647,
- "microblock_canonical": true,
- "block_hash": "0x58412b50266debd0c35b1a20348ad9c0f17e5525fb155a97033256c83c9e2491",
- "block_height": 3231,
- "burn_block_time": 1594230455,
- "canonical": true,
- "tx_index": 0,
- "tx_result":
  {
  - "hex": "0x03",
  - "repr": "true"
  },
- "coinbase_payload":
  {
  - "data": "0x0000000000000000000000000000000000000000000000000000000000000000"
  }

}`

## Get Raw Transaction

Get raw transaction by ID

##### path Parameters

tx_id required | string Hash of transaction

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/{tx_id}/raw

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tx/{tx_id}/raw

Local

http://localhost:3999/extended/v1/tx/{tx_id}/raw

### Response samples

- 200

Content type
application/json
`
{

- "raw_tx": "0x1234"

}`

## Broadcast raw transaction

Broadcast raw transactions on the network. You can use the @stacks/transactions project to generate a raw transaction payload.

##### Request Body schema: application/octet-stream

string <binary>

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/transactions

Testnet

https://stacks-node-api.testnet.stacks.co/v2/transactions

Local

http://localhost:3999/v2/transactions

### Request samples

- Payload

Content type
application/octet-stream

    binary format of 00000000010400bed38c2aadffa348931bcb542880ff79d607afec000000000000000000000000000000c800012b0b1fff6cccd0974966dcd665835838f0985be508e1322e09fb3d751eca132c492bda720f9ef1768d14fdabed6127560ba52d5e3ac470dcb60b784e97dc88c9030200000000000516df0ba3e79792be7be5e50a370289accfc8c9e032000000000000303974657374206d656d6f00000000000000000000000000000000000000000000000000

### Response samples

- 400

Content type
application/json
`
{

- "error": "transaction rejected",
- "reason": "BadNonce",
- "reason_data":
  {
  - "actual": 4,
  - "expected": 0,
  - "is_origin": true,
  - "principal": "ST2ZRX0K27GW0SP3GJCEMHD95TQGJMKB7G9Y0X1MH"
  },
- "txid": "caf6fd60ae05b0c2d19ef14ab6a7670b1095d117fa7c80224c74e76214d0a791"

}`

## Transactions in a block

Get all transactions in block

##### path Parameters

block_hash required | string Hash of block

##### query Parameters

limit | integer max number of transactions to fetch
offset | integer index of first transaction to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/block/{block_hash}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tx/block/{block_hash}

Local

http://localhost:3999/extended/v1/tx/block/{block_hash}

### Response samples

- 200

Content type
application/json
`
{

- "limit": 10,
- "offset": 0,
- "total": 101922,
- "results":
  [
  - {
    - "tx_id": "0x20dedbef812e44d712569224411b27324b68ab4667321a4badd5e81ba76bf0eb",
    - "nonce": 269,
    - "fee_rate": "0",
    - "sender_address": "SPQXK10DBF5ECAM30XVE3EJA8DNZF3VE0BK4MKV",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "on_chain_only",
    - "is_unanchored": false,
    - "block_hash": "0x28a9e2749b82bdc058776781a5abd5c9a6efed38f05545a8a51152655b8e1f4b",
    - "parent_block_hash": "0x3789b75ccfe7f2acf85c3f069fd5b8f95f73aba5332fa618243957d1c017a2a3",
    - "block_height": 21709,
    - "burn_block_time": 1626286436,
    - "burn_block_time_iso": "2021-07-14T18:13:56.000Z",
    - "canonical": true,
    - "tx_index": 0,
    - "tx_status": "success",
    - "tx_result":
      {
      - "hex": "0x0703",
      - "repr": "(ok true)"
      },
    - "microblock_hash": "",
    - "microblock_sequence": 2147483647,
    - "microblock_canonical": true,
    - "event_count": 0,
    - "events": [ ],
    - "tx_type": "coinbase",
    - "coinbase_payload":
      {
      - "data": "0x0000000000000000000000000000000000000000000000000000000000000000"
      }
    }
  ]

}`

## Transactions in a block

Get all transactions in block by height

##### path Parameters

height required | integer Height of block

##### query Parameters

limit | integer max number of transactions to fetch
offset | integer index of first transaction to fetch
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/block_height/{height}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tx/block_height/{height}

Local

http://localhost:3999/extended/v1/tx/block_height/{height}

### Response samples

- 200

Content type
application/json
`
{

- "limit": 10,
- "offset": 0,
- "total": 101922,
- "results":
  [
  - {
    - "tx_id": "0x20dedbef812e44d712569224411b27324b68ab4667321a4badd5e81ba76bf0eb",
    - "nonce": 269,
    - "fee_rate": "0",
    - "sender_address": "SPQXK10DBF5ECAM30XVE3EJA8DNZF3VE0BK4MKV",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "on_chain_only",
    - "is_unanchored": false,
    - "block_hash": "0x28a9e2749b82bdc058776781a5abd5c9a6efed38f05545a8a51152655b8e1f4b",
    - "parent_block_hash": "0x3789b75ccfe7f2acf85c3f069fd5b8f95f73aba5332fa618243957d1c017a2a3",
    - "block_height": 21709,
    - "burn_block_time": 1626286436,
    - "burn_block_time_iso": "2021-07-14T18:13:56.000Z",
    - "canonical": true,
    - "tx_index": 0,
    - "tx_status": "success",
    - "tx_result":
      {
      - "hex": "0x0703",
      - "repr": "(ok true)"
      },
    - "microblock_hash": "",
    - "microblock_sequence": 2147483647,
    - "microblock_canonical": true,
    - "event_count": 0,
    - "events": [ ],
    - "tx_type": "coinbase",
    - "coinbase_payload":
      {
      - "data": "0x0000000000000000000000000000000000000000000000000000000000000000"
      }
    }
  ]

}`

## Transactions for address

Get all transactions for address in mempool

##### path Parameters

address required | string Transactions for the address

##### query Parameters

limit | integer max number of transactions to fetch
offset | integer index of first transaction to fetch
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{address}/mempool

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{address}/mempool

Local

http://localhost:3999/extended/v1/address/{address}/mempool

### Response samples

- 200

Content type
application/json
`
{

- "limit": 96,
- "offset": 0,
- "total": 5,
- "results":
  [
  - {
    - "tx_id": "0xb31df5a363dad31723324cb5e0eefa04d491519fd30827a521cbc830114aa50c",
    - "tx_status": "pending",
    - "tx_type": "token_transfer",
    - "receipt_time": 1598288370,
    - "receipt_time_iso": "2020-08-24T16:59:30.000Z",
    - "fee_rate": "180",
    - "sender_address": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "token_transfer":
      {
      - "recipient_address": "ST1GY25DM8RZV4X15X07THRZ2C5NMWPGQWKFGV87F",
      - "amount": "500000",
      - "memo": "0x46617563657400000000000000000000000000000000000000000000000000000000"
      }
    },
  - {
    - "tx_id": "0x5bed8e3f801cb4e2c74d2815a092f7c1c6a35f2fce4a80c80ca70848d34cb395",
    - "tx_status": "pending",
    - "tx_type": "token_transfer",
    - "receipt_time": 1598282326,
    - "receipt_time_iso": "2020-08-24T15:18:46.000Z",
    - "fee_rate": "180",
    - "sender_address": "ST1PS1KF93VBY5A1JV7TM66KN046KP3E3761DBSAG",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "token_transfer":
      {
      - "recipient_address": "ST2H33S8SEY27QKEKQKR6S5PECYPKY45CQYGGQR8X",
      - "amount": "1000",
      - "memo": "0x00000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
  - {
    - "tx_id": "0x9916036fde08a207e581cdcabc18ff55469861cb81194ab0e3e7c9a02cd5a17c",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598258958,
    - "receipt_time_iso": "2020-08-24T08:49:18.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8.test-loans-1",
      - "source_code": "(define-data-var stx-loaned int 0)\n(define-data-var lockup-period int 0)\n(define-data-var stx-return int 0)\n(define-public (get-stx-return (stx uint) (months uint))\n (ok\n (begin\n (var-set stx-loaned (to-int(stx))\n (var-set lockup-period (to-int(months))\n (calculate-stx-return)\n (print (var-get stx-return))\n (transfer-to-server)\n )\n )\n)\n(define-private (calculate-stx-return)\n (ok\n (begin\n (var-set stx-return (- (+ (* (/ (* (var-get stx-loaned) 5) 100) (var-get lockup-period)) (var-get stx-loaned)) 5))\n )\n )\n)\n(define-private (transfer-to-server)\n (begin\n (unwrap-panic (stx-transfer? (to-uint (var-get stx-loaned)) tx-sender 'ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8))\n (ok (to-uint (var-get stx-loaned)))\n )\n)"
      }
    },
  - {
    - "tx_id": "0x871fb186c8d6ac6ede2822c71074d9884b593c0d7f2d0d6e8516e615484d7501",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598230365,
    - "receipt_time_iso": "2020-08-24T00:52:45.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230358601",
      - "source_code": ";; ## CUSTOM FUNCTION TO EXTRACT A SUBSTRING\n\n(define-read-only (subs (source (buff 10)) \n (start int) \n (end int))\n (begin\n (unwrap-panic (if (and (<= 0 start) (<= start 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 0 end) (<= end 10)) (ok 1) (err \"Out of bounds: end\")))\n (let ((temp1 (fold subs1 source \n {start: start, end: end, cursor: 1, data: \"\"})))\n (let ((data (get data temp1))) \n data))))\n\n \n;; Call the function to extract the substring between the bounds:\n\n;; (subs \"123456789\" 2 5)\n\n(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int})) \n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp2 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp3 start)\n (temp4 cursor)\n (temp5 end))\n (and (<= temp3 temp4)\n (<= temp4 temp5)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp2),\n data: (get data temp2)})))\n"
      }
    },
  - {
    - "tx_id": "0x66df10d99d3a26018f521d60e9f744b083386c73e47ad39c394d570abee55f1f",
    - "tx_status": "pending",
    - "tx_type": "smart_contract",
    - "receipt_time": 1598230066,
    - "receipt_time_iso": "2020-08-24T00:47:46.000Z",
    - "fee_rate": "2000",
    - "sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions": [ ],
    - "anchor_mode": "any",
    - "smart_contract":
      {
      - "contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230054238",
      - "source_code": "(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int}))\n (begin\n (unwrap-panic (if (and (<= 1 (get start acc)) (<= (get start acc) 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 1 (get end acc)) (<= (get end acc) 10)) (ok 1) (err \"Out of bounds: end\")))\n (unwrap-panic (if (and (<= 1 (get cursor acc)) (<= (get cursor acc) 10)) (ok 1) (err \"Out of bounds: cursor\")))\n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp1 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp2 start)\n (temp3 cursor)\n (temp4 end))\n (and (<= temp2 temp3)\n (<= temp3 temp4)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp1),\n data: (get data temp1)}))))\n"
      }
    },
  - {
    - "tx_id": "0x7402d8e52204d6c8cba7465e159e79750338c3ee31d4fe6ddef1d4d226304b65",
    - "nonce": 1,
    - "fee_rate": "227",
    - "sender_address": "SP1HJDP35SSMYP98CG8SHMYHMZDK0A495ZCH6ARYS",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "post_conditions":
      [
      - {
        - "type": "stx",
        - "condition_code": "sent_equal_to",
        - "amount": "88884500",
        - "principal":
          {
          - "type_id": "principal_standard",
          - "address": "SP2J6HSSDYSTM71S0K0KK4YWRKX59JN1AD52M4B59"
          }
        }
      ],
    - "anchor_mode": "any",
    - "tx_status": "pending",
    - "receipt_time": 1626286631,
    - "receipt_time_iso": "2021-07-14T18:17:11.000Z",
    - "tx_type": "contract_call",
    - "contract_call":
      {
      - "contract_id": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo",
      - "function_name": "send-many",
      - "function_signature": "(define-public (send-many (recipients (list 200 (tuple (memo (buff 34)) (to principal) (ustx uint))))))",
      - "function_args":
        [
        - {
          - "hex": "0x0b000000010c00000003046d656d6f020000000e357a62597346716a52336d736b7102746f0516b734e97043840503dc1091661c105d32b7c5c75d047573747801000000000000000000000000054c4514",
          - "repr": "(list (tuple (memo 0x357a62597346716a52336d736b71) (to SP2VK9TBG8E20A0YW228PC70GBMSBFHE7BNVMKB57) (ustx u88884500)))",
          - "name": "recipients",
          - "type": "(list 200 (tuple (memo (buff 34)) (to principal) (ustx uint)))"
          }
        ]
      }
    }
  ]

}`

# Microblocks

## Get recent microblocks

##### query Parameters

limit | integer Max number of microblocks to fetch
offset | integer Index of the first microblock to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/microblock

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/microblock

Local

http://localhost:3999/extended/v1/microblock

### Response samples

- 200

Content type
application/json
`
{

- "limit": 0,
- "offset": 0,
- "total": 0,
- "results":
  [
  - {
    - "canonical": true,
    - "microblock_canonical": true,
    - "microblock_hash": "string",
    - "microblock_sequence": 0,
    - "microblock_parent_hash": "string",
    - "block_height": 0,
    - "parent_block_height": 0,
    - "parent_block_hash": "string",
    - "parent_burn_block_hash": "string",
    - "parent_burn_block_time": 0,
    - "parent_burn_block_time_iso": "string",
    - "parent_burn_block_height": 0,
    - "block_hash": "string",
    - "txs":
      [
      - "string"
      ]
    }
  ]

}`

## Get microblock

Get a specific microblock by hash

##### path Parameters

hash required | string Hash of the microblock

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/microblock/{hash}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/microblock/{hash}

Local

http://localhost:3999/extended/v1/microblock/{hash}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "canonical": true,
- "microblock_canonical": true,
- "microblock_hash": "string",
- "microblock_sequence": 0,
- "microblock_parent_hash": "string",
- "block_height": 0,
- "parent_block_height": 0,
- "parent_block_hash": "string",
- "parent_burn_block_hash": "string",
- "parent_burn_block_time": 0,
- "parent_burn_block_time_iso": "string",
- "parent_burn_block_height": 0,
- "block_hash": "string",
- "txs":
  [
  - "string"
  ]

}`

## Get the list of current transactions that belong to unanchored microblocks

This contains transactions that have been streamed in microblocks but not yet accepted or rejected in an anchor block

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/microblock/unanchored/txs

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/microblock/unanchored/txs

Local

http://localhost:3999/extended/v1/microblock/unanchored/txs

### Response samples

- 200

Content type
application/json
`
{

- "total": 0,
- "results":
  [
  - {
    - "tx_id": "string",
    - "nonce": 0,
    - "fee_rate": "string",
    - "sender_address": "string",
    - "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,
    - "burn_block_time": 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,
    - "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"
      }
    }
  ]

}`

# Blocks

## Get recent blocks

Get all recently mined blocks

##### query Parameters

limit | integer max number of blocks to fetch
offset | integer index of first block to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/block

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/block

Local

http://localhost:3999/extended/v1/block

### Response samples

- 200

Content type
application/json
`
{

- "limit": 1,
- "offset": 0,
- "total": 21707,
- "results":
  [
  - {
    - "canonical": true,
    - "height": 21698,
    - "hash": "0x9be3e38eab9c7d094fd51792383c66706838d6392e95bc05cc730b8f7520e352",
    - "parent_block_hash": "0x76ee36d1d6c88e56b5c0e80f0d7bc7d3492141faf1b900efb19fcd00457d4654",
    - "burn_block_time": 1626281749,
    - "burn_block_time_iso": "2021-07-14T16:55:49.000Z",
    - "burn_block_hash": "0x0000000000000000000ea16f8e906e85ee1cb4dff1e5424e93843b3cec8b0bcb",
    - "burn_block_height": 691014,
    - "miner_txid": "0x118f7122a69441d13e6a3dfd4c3b0f9950be25195bb8126aae7fadea1aa9185d",
    - "parent_microblock_hash": "0x54647c277eefe60519b407f2c897749005fdb7f831034135063b2ee43fdacb04",
    - "parent_microblock_sequence": 3,
    - "txs":
      [
      - "0x76f58b2eaff65a07a5971b241c4e71fee92ee0f9396809f911f90839f9004cac",
      - "0x32972d9052b068f218f6e13451f7aff937099b74bbf95fac7d9402295b1b3941",
      - "0x8cd30724c02a9cc1d8879a34dc136ebfdb2008420badcfb5947b92f85ebce79b",
      - "0xf5c1577f42d3753a508101e045dd2dc60491eb0aa552e0ecd0ad37cc697143f4",
      - "0x35e4c20e2838f999e0cf0b40c5fabce154c2df1912a1074150d26784c53f7a20",
      - "0x501eb42b82e5b7a7350b47fa143cd4e90bb46d43e4a7d22830b2bf2aa70b7922"
      ],
    - "microblocks_accepted":
      [
      - "0x54647c277eefe60519b407f2c897749005fdb7f831034135063b2ee43fdacb04",
      - "0xdaf61d2b355f35c94cf019af99aeb73d8e7db7301c7cd693a464ebd1cfc2228c",
      - "0xb9e9b308cf9621ecbf66ca7b4689fe384b9b67c4588ec827d8163ab602fb935e",
      - "0x754562cba6ec243f90485e97778ab472f462fd123ef5b83cc79d8759ca8875f5"
      ],
    - "microblocks_streamed":
      [
      - "0x54647c277eefe60519b407f2c897749005fdb7f831034135063b2ee43fdacb04",
      - "0xdaf61d2b355f35c94cf019af99aeb73d8e7db7301c7cd693a464ebd1cfc2228c",
      - "0xb9e9b308cf9621ecbf66ca7b4689fe384b9b67c4588ec827d8163ab602fb935e",
      - "0x754562cba6ec243f90485e97778ab472f462fd123ef5b83cc79d8759ca8875f5"
      ]
    }
  ]

}`

## Get block

Get a specific block by hash

##### path Parameters

hash required | string Hash of the block

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/block/{hash}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/block/{hash}

Local

http://localhost:3999/extended/v1/block/{hash}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "parent_block_hash": "0x75ab21ef25cbff2caa14c27d830ed7886a4d1522e1b6f9e5dc3b59ccf73ed49f",
- "burn_block_time": 1594233639,
- "burn_block_time_iso": "2020-08-27T16:41:26.000Z",
- "burn_block_hash": "0xb154c008df2101023a6d0d54986b3964cee58119eed14f5bed98e15678e18fe2",
- "burn_block_height": 654439,
- "miner_txid": "0xd7d56070277ccd87b42acf0c91f915dd181f9db4cf878a4e95518bc397c240cc",
- "parent_microblock_hash": "0x590a1bb1d7bcbeafce0a9fc8f8a69e369486192d14687fe95fbe4dc1c71d49df",
- "parent_microblock_sequence": 2,
- "txs":
  [
  - "0x4262db117659d1ca9406970c8f44ffd3d8f11f8e18c591d2e3960f4070107754",
  - "0x383632cd3b5464dffb684082750fcfaddd1f52625bbb9f884ed8f45d2b1f0547",
  - "0xc99fe597e44b8bd15a50eec660c6e679a7144a5a8553d214b9d5f1406d278c22"
  ],
- "microblocks_accepted":
  [
  - "0xce0b1a4099d3fc7d5885cc7a3baa952b6d999f9709d0683b98b843597208231c",
  - "0x4c0529b6448a5885991c5021bd869cc97f1692c128a98b382729dc962203c326",
  - "0x64968846291dfea1015228a9d4bbd60aac81378cd6774b810b08e59e6b0e7494"
  ],
- "microblocks_streamed":
  [
  - "0xb5650ef855f7d90fc146942e85cf9fac3a8c47ec408aca02f3cf9ed7c82f6cc6",
  - "0xeeb9aa5741d84aa0bc5de4f2fbdeae57ae29694479475d45a67ae7bd7e2c98f3",
  - "0x4f4c368d5f06fdf6065c5bafd9cb37391fddc9c279cfc57be35e4bf8ee932cbd",
  - "0xde2fc8d99872c827f144c752c002d29f9315dfc09472a09572ac7447ae623dea"
  ]

}`

## Get block

Get a specific block by height

##### path Parameters

height required | number Height of the block

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/block/by_height/{height}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/block/by_height/{height}

Local

http://localhost:3999/extended/v1/block/by_height/{height}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "parent_block_hash": "0x75ab21ef25cbff2caa14c27d830ed7886a4d1522e1b6f9e5dc3b59ccf73ed49f",
- "burn_block_time": 1594233639,
- "burn_block_time_iso": "2020-08-27T16:41:26.000Z",
- "burn_block_hash": "0xb154c008df2101023a6d0d54986b3964cee58119eed14f5bed98e15678e18fe2",
- "burn_block_height": 654439,
- "miner_txid": "0xd7d56070277ccd87b42acf0c91f915dd181f9db4cf878a4e95518bc397c240cc",
- "parent_microblock_hash": "0x590a1bb1d7bcbeafce0a9fc8f8a69e369486192d14687fe95fbe4dc1c71d49df",
- "parent_microblock_sequence": 2,
- "txs":
  [
  - "0x4262db117659d1ca9406970c8f44ffd3d8f11f8e18c591d2e3960f4070107754",
  - "0x383632cd3b5464dffb684082750fcfaddd1f52625bbb9f884ed8f45d2b1f0547",
  - "0xc99fe597e44b8bd15a50eec660c6e679a7144a5a8553d214b9d5f1406d278c22"
  ],
- "microblocks_accepted":
  [
  - "0xce0b1a4099d3fc7d5885cc7a3baa952b6d999f9709d0683b98b843597208231c",
  - "0x4c0529b6448a5885991c5021bd869cc97f1692c128a98b382729dc962203c326",
  - "0x64968846291dfea1015228a9d4bbd60aac81378cd6774b810b08e59e6b0e7494"
  ],
- "microblocks_streamed":
  [
  - "0xb5650ef855f7d90fc146942e85cf9fac3a8c47ec408aca02f3cf9ed7c82f6cc6",
  - "0xeeb9aa5741d84aa0bc5de4f2fbdeae57ae29694479475d45a67ae7bd7e2c98f3",
  - "0x4f4c368d5f06fdf6065c5bafd9cb37391fddc9c279cfc57be35e4bf8ee932cbd",
  - "0xde2fc8d99872c827f144c752c002d29f9315dfc09472a09572ac7447ae623dea"
  ]

}`

## Get block

Get a specific block by burnchain block hash

##### path Parameters

burn_block_hash required | string Hash of the burnchain block

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/block/by_burn_block_hash/{burn_block_hash}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/block/by_burn_block_hash/{burn_block_hash}

Local

http://localhost:3999/extended/v1/block/by_burn_block_hash/{burn_block_hash}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "parent_block_hash": "0x75ab21ef25cbff2caa14c27d830ed7886a4d1522e1b6f9e5dc3b59ccf73ed49f",
- "burn_block_time": 1594233639,
- "burn_block_time_iso": "2020-08-27T16:41:26.000Z",
- "burn_block_hash": "0xb154c008df2101023a6d0d54986b3964cee58119eed14f5bed98e15678e18fe2",
- "burn_block_height": 654439,
- "miner_txid": "0xd7d56070277ccd87b42acf0c91f915dd181f9db4cf878a4e95518bc397c240cc",
- "parent_microblock_hash": "0x590a1bb1d7bcbeafce0a9fc8f8a69e369486192d14687fe95fbe4dc1c71d49df",
- "parent_microblock_sequence": 2,
- "txs":
  [
  - "0x4262db117659d1ca9406970c8f44ffd3d8f11f8e18c591d2e3960f4070107754",
  - "0x383632cd3b5464dffb684082750fcfaddd1f52625bbb9f884ed8f45d2b1f0547",
  - "0xc99fe597e44b8bd15a50eec660c6e679a7144a5a8553d214b9d5f1406d278c22"
  ],
- "microblocks_accepted":
  [
  - "0xce0b1a4099d3fc7d5885cc7a3baa952b6d999f9709d0683b98b843597208231c",
  - "0x4c0529b6448a5885991c5021bd869cc97f1692c128a98b382729dc962203c326",
  - "0x64968846291dfea1015228a9d4bbd60aac81378cd6774b810b08e59e6b0e7494"
  ],
- "microblocks_streamed":
  [
  - "0xb5650ef855f7d90fc146942e85cf9fac3a8c47ec408aca02f3cf9ed7c82f6cc6",
  - "0xeeb9aa5741d84aa0bc5de4f2fbdeae57ae29694479475d45a67ae7bd7e2c98f3",
  - "0x4f4c368d5f06fdf6065c5bafd9cb37391fddc9c279cfc57be35e4bf8ee932cbd",
  - "0xde2fc8d99872c827f144c752c002d29f9315dfc09472a09572ac7447ae623dea"
  ]

}`

## Get block

Get a specific block by burn chain height

##### path Parameters

burn_block_height required | number Height of the burn chain block

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/block/by_burn_block_height/{burn_block_height}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/block/by_burn_block_height/{burn_block_height}

Local

http://localhost:3999/extended/v1/block/by_burn_block_height/{burn_block_height}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "parent_block_hash": "0x75ab21ef25cbff2caa14c27d830ed7886a4d1522e1b6f9e5dc3b59ccf73ed49f",
- "burn_block_time": 1594233639,
- "burn_block_time_iso": "2020-08-27T16:41:26.000Z",
- "burn_block_hash": "0xb154c008df2101023a6d0d54986b3964cee58119eed14f5bed98e15678e18fe2",
- "burn_block_height": 654439,
- "miner_txid": "0xd7d56070277ccd87b42acf0c91f915dd181f9db4cf878a4e95518bc397c240cc",
- "parent_microblock_hash": "0x590a1bb1d7bcbeafce0a9fc8f8a69e369486192d14687fe95fbe4dc1c71d49df",
- "parent_microblock_sequence": 2,
- "txs":
  [
  - "0x4262db117659d1ca9406970c8f44ffd3d8f11f8e18c591d2e3960f4070107754",
  - "0x383632cd3b5464dffb684082750fcfaddd1f52625bbb9f884ed8f45d2b1f0547",
  - "0xc99fe597e44b8bd15a50eec660c6e679a7144a5a8553d214b9d5f1406d278c22"
  ],
- "microblocks_accepted":
  [
  - "0xce0b1a4099d3fc7d5885cc7a3baa952b6d999f9709d0683b98b843597208231c",
  - "0x4c0529b6448a5885991c5021bd869cc97f1692c128a98b382729dc962203c326",
  - "0x64968846291dfea1015228a9d4bbd60aac81378cd6774b810b08e59e6b0e7494"
  ],
- "microblocks_streamed":
  [
  - "0xb5650ef855f7d90fc146942e85cf9fac3a8c47ec408aca02f3cf9ed7c82f6cc6",
  - "0xeeb9aa5741d84aa0bc5de4f2fbdeae57ae29694479475d45a67ae7bd7e2c98f3",
  - "0x4f4c368d5f06fdf6065c5bafd9cb37391fddc9c279cfc57be35e4bf8ee932cbd",
  - "0xde2fc8d99872c827f144c752c002d29f9315dfc09472a09572ac7447ae623dea"
  ]

}`

# Burnchain

## Get recent reward slot holders

Array of the Bitcoin addresses that would validly receive PoX commitments.

##### query Parameters

limit | integer max number of items to fetch
offset | integer index of the first items to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/burnchain/reward_slot_holders

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/burnchain/reward_slot_holders

Local

http://localhost:3999/extended/v1/burnchain/reward_slot_holders

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "total": 2,
- "results":
  [
  - {
    - "canonical": true,
    - "burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
    - "burn_block_height": 331,
    - "address": "1C56LYirKa3PFXFsvhSESgDy2acEHVAEt6",
    - "slot_index": 0
    },
  - {
    - "canonical": true,
    - "burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
    - "burn_block_height": 331,
    - "address": "1M3bvWB9CRh5BTumeVxtHDEV6W4S2R9AZw",
    - "slot_index": 0
    }
  ]

}`

## Get recent reward slot holder entries for the given address

Array of the Bitcoin addresses that would validly receive PoX commitments.

##### path Parameters

address required | string Reward slot holder recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format

##### query Parameters

limit | integer max number of items to fetch
offset | integer index of the first items to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/burnchain/reward_slot_holders/{address}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/burnchain/reward_slot_holders/{address}

Local

http://localhost:3999/extended/v1/burnchain/reward_slot_holders/{address}

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "total": 2,
- "results":
  [
  - {
    - "canonical": true,
    - "burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
    - "burn_block_height": 331,
    - "address": "1C56LYirKa3PFXFsvhSESgDy2acEHVAEt6",
    - "slot_index": 0
    },
  - {
    - "canonical": true,
    - "burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
    - "burn_block_height": 331,
    - "address": "1M3bvWB9CRh5BTumeVxtHDEV6W4S2R9AZw",
    - "slot_index": 0
    }
  ]

}`

## Get recent burnchain reward recipients

Get a list of recent burnchain (e.g. Bitcoin) reward recipients with the associated amounts and block info

##### query Parameters

limit | integer max number of rewards to fetch
offset | integer index of first rewards to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/burnchain/rewards

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/burnchain/rewards

Local

http://localhost:3999/extended/v1/burnchain/rewards

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "results":
  [
  - {
    - "canonical": true,
    - "burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
    - "burn_block_height": 331,
    - "burn_amount": "12000",
    - "reward_recipient": "1C56LYirKa3PFXFsvhSESgDy2acEHVAEt6",
    - "reward_amount": "5000",
    - "reward_index": 0
    },
  - {
    - "canonical": true,
    - "burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
    - "burn_block_height": 336,
    - "burn_amount": "14000",
    - "reward_recipient": "1M3bvWB9CRh5BTumeVxtHDEV6W4S2R9AZw",
    - "reward_amount": "2000",
    - "reward_index": 0
    }
  ]

}`

## Get recent burnchain reward for the given recipient

Get a list of recent burnchain (e.g. Bitcoin) rewards for the given recipient with the associated amounts and block info

##### path Parameters

address required | string Reward recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format

##### query Parameters

limit | integer max number of rewards to fetch
offset | integer index of first rewards to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/burnchain/rewards/{address}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/burnchain/rewards/{address}

Local

http://localhost:3999/extended/v1/burnchain/rewards/{address}

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "results":
  [
  - {
    - "canonical": true,
    - "burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
    - "burn_block_height": 331,
    - "burn_amount": "12000",
    - "reward_recipient": "1C56LYirKa3PFXFsvhSESgDy2acEHVAEt6",
    - "reward_amount": "5000",
    - "reward_index": 0
    },
  - {
    - "canonical": true,
    - "burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
    - "burn_block_height": 336,
    - "burn_amount": "14000",
    - "reward_recipient": "1M3bvWB9CRh5BTumeVxtHDEV6W4S2R9AZw",
    - "reward_amount": "2000",
    - "reward_index": 0
    }
  ]

}`

## Get total burnchain rewards for the given recipient

Get the total burnchain (e.g. Bitcoin) rewards for the given recipient

##### path Parameters

address required | string Reward recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/burnchain/rewards/{address}/total

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/burnchain/rewards/{address}/total

Local

http://localhost:3999/extended/v1/burnchain/rewards/{address}/total

### Response samples

- 200

Content type
application/json
`
{

- "reward_recipient": "1C56LYirKa3PFXFsvhSESgDy2acEHVAEt6",
- "reward_amount": "18000"

}`

# Smart Contracts

## Get contract info

Get contract info using the contract ID

##### path Parameters

contract_id required | string Contract identifier formatted as `<contract_address>.<contract_name>`

##### query Parameters

unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/contract/{contract_id}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/contract/{contract_id}

Local

http://localhost:3999/extended/v1/contract/{contract_id}

### Response samples

- 200

Content type
application/json
`
{

- "tx_id": "0x8122b7ae041120ddc9e2f8108e165912e40ad146399d42d6e6cbca7fd2c8ac28",
- "tx_status": "success",
- "tx_type": "smart_contract",
- "fee_rate": "3000",
- "sender_address": "STJTXEJPJPPVDNA9B052NSRRBGQCFNKVS178VGH1",
- "sponsored": false,
- "post_condition_mode": "allow",
- "is_unanchored": false,
- "microblock_hash": "",
- "microblock_sequence": 2147483647,
- "microblock_canonical": true,
- "block_hash": "0x105685d3d4f251d73b75865b192cefb111dd49f67b8970a95094dc7ecf826caa",
- "block_height": 3196,
- "burn_block_time": 1594228322,
- "canonical": true,
- "tx_index": 1,
- "post_conditions": [ ],
- "smart_contract":
  {
  - "contract_id": "STJTXEJPJPPVDNA9B052NSRRBGQCFNKVS178VGH1.hello_world",
  - "source_code": "(define-constant sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(define-constant recipient 'SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G)\n\n(define-fungible-token novel-token-19)\n(begin (ft-mint? novel-token-19 u12 sender))\n(begin (ft-transfer? novel-token-19 u2 sender recipient))\n\n(define-non-fungible-token hello-nft uint)\n(begin (nft-mint? hello-nft u1 sender))\n(begin (nft-mint? hello-nft u2 sender))\n(begin (nft-transfer? hello-nft u1 sender recipient))\n\n(define-public (test-emit-event)\n (begin\n (print \"Event! Hello world\")\n (ok u1)))\n(begin (test-emit-event))\n\n(define-public (test-event-types)\n (begin\n (unwrap-panic (ft-mint? novel-token-19 u3 recipient))\n (unwrap-panic (nft-mint? hello-nft u2 recipient))\n (unwrap-panic (stx-transfer? u60 tx-sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR))\n (unwrap-panic (stx-burn? u20 tx-sender))\n (ok u1)))\n\n(define-map store ((key (buff 32))) ((value (buff 32))))\n(define-public (get-value (key (buff 32)))\n (begin\n (match (map-get? store ((key key)))\n entry (ok (get value entry))\n (err 0))))\n(define-public (set-value (key (buff 32)) (value (buff 32)))\n (begin\n (map-set store ((key key)) ((value value)))\n (ok u1)))"
  },
- "events":
  [
  - {
    - "event_index": 0,
    - "event_type": "fungible_token_asset",
    - "asset":
      {
      - "asset_event_type": "mint",
      - "asset_id": "STJTXEJPJPPVDNA9B052NSRRBGQCFNKVS178VGH1.hello_world::novel-token-19",
      - "sender": "",
      - "recipient": "SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR",
      - "amount": "12"
      }
    },
  - {
    - "event_index": 1,
    - "event_type": "non_fungible_token_asset",
    - "asset":
      {
      - "asset_event_type": "mint",
      - "asset_id": "STJTXEJPJPPVDNA9B052NSRRBGQCFNKVS178VGH1.hello_world::hello-nft",
      - "sender": "",
      - "recipient": "SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR",
      - "value":
        {
        - "hex": "0x0100000000000000000000000000000001",
        - "repr": "1"
        }
      }
    },
  - {
    - "event_index": 2,
    - "event_type": "non_fungible_token_asset",
    - "asset":
      {
      - "asset_event_type": "mint",
      - "asset_id": "STJTXEJPJPPVDNA9B052NSRRBGQCFNKVS178VGH1.hello_world::hello-nft",
      - "sender": "",
      - "recipient": "SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR",
      - "value":
        {
        - "hex": "0x0100000000000000000000000000000002",
        - "repr": "2"
        }
      }
    },
  - {
    - "event_index": 3,
    - "event_type": "smart_contract_log",
    - "contract_log":
      {
      - "contract_id": "STJTXEJPJPPVDNA9B052NSRRBGQCFNKVS178VGH1.hello_world",
      - "topic": "print",
      - "value":
        {
        - "hex": "0x02000000124576656e74212048656c6c6f20776f726c64",
        - "repr": "\"Event! Hello world\""
        }
      }
    },
  - {
    - "event_index": 4,
    - "event_type": "fungible_token_asset",
    - "asset":
      {
      - "asset_event_type": "transfer",
      - "asset_id": "STJTXEJPJPPVDNA9B052NSRRBGQCFNKVS178VGH1.hello_world::novel-token-19",
      - "sender": "SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR",
      - "recipient": "SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G",
      - "amount": "2"
      }
    },
  - {
    - "event_index": 5,
    - "event_type": "non_fungible_token_asset",
    - "asset":
      {
      - "asset_event_type": "transfer",
      - "asset_id": "STJTXEJPJPPVDNA9B052NSRRBGQCFNKVS178VGH1.hello_world::hello-nft",
      - "sender": "SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR",
      - "recipient": "SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G",
      - "value":
        {
        - "hex": "0x0100000000000000000000000000000001",
        - "repr": "1"
        }
      }
    }
  ]

}`

## Get contract events

Get contract events using a contract ID

##### path Parameters

contract_id required | string Contract identifier formatted as `<contract_address>.<contract_name>`

##### query Parameters

limit | integer max number of contract events to fetch
offset | integer index of first contract event to fetch
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/contract/{contract_id}/events

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/contract/{contract_id}/events

Local

http://localhost:3999/extended/v1/contract/{contract_id}/events

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "results":
  [
  - {
    - "event_index": 1,
    - "event_type": "smart_contract_log",
    - "contract_log":
      {
      - "contract_id": "ST2P7B9G6Y55QWZJ9B93DVSEG5S6Z4PFJHB3XRKHW.hello_world",
      - "topic": "print",
      - "value":
        {
        - "hex": "0x02000000124576656e74212048656c6c6f20776f726c64",
        - "repr": "\"Event! Hello world\""
        }
      }
    }
  ]

}`

## Get contract interface

Get contract interface using a `contract_address` and `contract name`

##### path Parameters

contract_address required | string Stacks address
contract_name required | string Contract name

##### query Parameters

tip | string The Stacks chain tip to query from

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/contracts/interface/{contract_address}/{contract_name}

Testnet

https://stacks-node-api.testnet.stacks.co/v2/contracts/interface/{contract_address}/{contract_name}

Local

http://localhost:3999/v2/contracts/interface/{contract_address}/{contract_name}

### Response samples

- 200

Content type
application/json
`
{

- "functions":
  [
  - {
    - "name": "get-value",
    - "access": "public",
    - "args":
      [
      - {
        - "name": "key",
        - "type":
          {
          - "buffer":
            {
            - "length": 32
            }
          }
        }
      ],
    - "outputs":
      {
      - "type":
        {
        - "response":
          {
          - "ok":
            {
            - "buffer":
              {
              - "length": 32
              }
            },
          - "error": "int128"
          }
        }
      }
    },
  - {
    - "name": "set-value",
    - "access": "public",
    - "args":
      [
      - {
        - "name": "key",
        - "type":
          {
          - "buffer":
            {
            - "length": 32
            }
          }
        },
      - {
        - "name": "value",
        - "type":
          {
          - "buffer":
            {
            - "length": 32
            }
          }
        }
      ],
    - "outputs":
      {
      - "type":
        {
        - "response":
          {
          - "ok": "uint128",
          - "error": "none"
          }
        }
      }
    },
  - {
    - "name": "test-emit-event",
    - "access": "public",
    - "args": [ ],
    - "outputs":
      {
      - "type":
        {
        - "response":
          {
          - "ok": "uint128",
          - "error": "none"
          }
        }
      }
    },
  - {
    - "name": "test-event-types",
    - "access": "public",
    - "args": [ ],
    - "outputs":
      {
      - "type":
        {
        - "response":
          {
          - "ok": "uint128",
          - "error": "none"
          }
        }
      }
    }
  ],
- "variables":
  [
  - {
    - "name": "recipient",
    - "type": "principal",
    - "access": "constant"
    },
  - {
    - "name": "sender",
    - "type": "principal",
    - "access": "constant"
    }
  ],
- "maps":
  [
  - {
    - "name": "store",
    - "key":
      [
      - {
        - "name": "key",
        - "type":
          {
          - "buffer":
            {
            - "length": 32
            }
          }
        }
      ],
    - "value":
      [
      - {
        - "name": "value",
        - "type":
          {
          - "buffer":
            {
            - "length": 32
            }
          }
        }
      ]
    }
  ],
- "fungible_tokens":
  [
  - {
    - "name": "novel-token-19"
    }
  ],
- "non_fungible_tokens":
  [
  - {
    - "name": "hello-nft",
    - "type": "uint128"
    }
  ]

}`

## Get specific data-map inside a contract

Attempt to fetch data from a contract data map. The contract is identified with [Stacks Address] and [Contract Name] in the URL path. The map is identified with [Map Name].

The key to lookup in the map is supplied via the POST body. This should be supplied as the hex string serialization of the key (which should be a Clarity value). Note, this is a JSON string atom.

In the response, `data` is the hex serialization of the map response. Note that map responses are Clarity option types, for non-existent values, this is a serialized none, and for all other responses, it is a serialized (some ...) object.

##### path Parameters

contract_address required | string Stacks address
contract_name required | string Contract name
map_name required | string Map name

##### query Parameters

proof | integer Returns object without the proof field when set to 0
tip | string The Stacks chain tip to query from

##### Request Body schema: application/json

Hex string serialization of the lookup key (which should be a Clarity value)

string

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/map_entry/{contract_address}/{contract_name}/{map_name}

Testnet

https://stacks-node-api.testnet.stacks.co/v2/map_entry/{contract_address}/{contract_name}/{map_name}

Local

http://localhost:3999/v2/map_entry/{contract_address}/{contract_name}/{map_name}

### Request samples

- Payload

Content type
application/json
`"string"`

### Response samples

- 200

Content type
application/json
`
{

- "data": "0x0a0c000000010a6d6f6e737465722d69640100000000000000000000000000000001",
- "proof": "0x123..."

}`

## Get contract source

Returns the Clarity source code of a given contract, along with the block height it was published in, and the MARF proof for the data

##### path Parameters

contract_address required | string Stacks address
contract_name required | string Contract name

##### query Parameters

proof | integer Returns object without the proof field if set to 0
tip | string The Stacks chain tip to query from

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/contracts/source/{contract_address}/{contract_name}

Testnet

https://stacks-node-api.testnet.stacks.co/v2/contracts/source/{contract_address}/{contract_name}

Local

http://localhost:3999/v2/contracts/source/{contract_address}/{contract_name}

### Response samples

- 200

Content type
application/json
`
{

- "source": "(define-constant sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(define-constant recipient 'SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G)\n\n(define-fungible-token novel-token-19)\n(begin (ft-mint? novel-token-19 u12 sender))\n(begin (ft-transfer? novel-token-19 u2 sender recipient))\n\n(define-non-fungible-token hello-nft uint)\n(begin (nft-mint? hello-nft u1 sender))\n(begin (nft-mint? hello-nft u2 sender))\n(begin (nft-transfer? hello-nft u1 sender recipient))\n\n(define-public (test-emit-event)\n (begin\n (print \"Event! Hello world\")\n (ok u1)))\n(begin (test-emit-event))\n\n(define-public (test-event-types)\n (begin\n (unwrap-panic (ft-mint? novel-token-19 u3 recipient))\n (unwrap-panic (nft-mint? hello-nft u2 recipient))\n (unwrap-panic (stx-transfer? u60 tx-sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR))\n (unwrap-panic (stx-burn? u20 tx-sender))\n (ok u1)))\n\n(define-map store ((key (buff 32))) ((value (buff 32))))\n(define-public (get-value (key (buff 32)))\n (begin\n (match (map-get? store ((key key)))\n entry (ok (get value entry))\n (err 0))))\n(define-public (set-value (key (buff 32)) (value (buff 32)))\n (begin\n (map-set store ((key key)) ((value value)))\n (ok u1)))",
- "publish_height": 3196,
- "proof": "0000001104060000001ec4e..."

}`

## Call read-only function

Call a read-only public function on a given smart contract.

The smart contract and function are specified using the URL path. The arguments and the simulated tx-sender are supplied via the POST body in the following JSON format:

##### path Parameters

contract_address required | string Stacks address
contract_name required | string Contract name
function_name required | string Function name

##### query Parameters

tip | string The Stacks chain tip to query from

##### Request Body schema: application/json

map of arguments and the simulated tx-sender where sender is either a Contract identifier or a normal Stacks address, and arguments is an array of hex serialized Clarity values.

sender required | string The simulated tx-sender
arguments required | Array of strings An array of hex serialized Clarity values

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name}

Testnet

https://stacks-node-api.testnet.stacks.co/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name}

Local

http://localhost:3999/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name}

### Request samples

- Payload

Content type
application/json
`
{

- "sender": "string",
- "arguments":
  [
  - "string"
  ]

}`

### Response samples

- 200

Content type
application/json
Example
success
success
fail
`null`

# Accounts

## Get account balances

##### path Parameters

principal required | string Stacks address or a Contract identifier (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`)

##### query Parameters

unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/balances

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/balances

Local

http://localhost:3999/extended/v1/address/{principal}/balances

### Response samples

- 200

Content type
application/json
`
{

- "stx":
  {
  - "balance": "1000000",
  - "total_sent": "0",
  - "total_received": "1000000",
  - "lock_tx_id": "0xec94e7d20af8979b44d17a0520c126bf742b999a0fc7ddbcbe0ab21b228ecc8c",
  - "locked": "50000",
  - "lock_height": 100,
  - "burnchain_lock_height": 100,
  - "burnchain_unlock_height": 200
  },
- "fungible_tokens": { },
- "non_fungible_tokens": { }

}`

## Get account STX balance

##### path Parameters

principal required | string Stacks address or a Contract identifier (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`)

##### query Parameters

unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/stx

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/stx

Local

http://localhost:3999/extended/v1/address/{principal}/stx

### Response samples

- 200

Content type
application/json
`
{

- "balance": "1000000",
- "total_sent": "0",
- "total_received": "1000000",
- "lock_tx_id": "0xec94e7d20af8979b44d17a0520c126bf742b999a0fc7ddbcbe0ab21b228ecc8c",
- "locked": "50000",
- "lock_height": 100,
- "burnchain_lock_height": 100,
- "burnchain_unlock_height": 200

}`

## Get account transactions

##### path Parameters

principal required | string Stacks address or a Contract identifier (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`)

##### query Parameters

limit | integer max number of account transactions to fetch
offset | integer index of first account transaction to fetch
height | number Filter for transactions only at this given block height
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/transactions

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/transactions

Local

http://localhost:3999/extended/v1/address/{principal}/transactions

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "total": 4989,
- "results":
  [
  - {
    - "tx_id": "0xb16077b94222bc1466396d30df13db460864e85ce929a20aae0a2ac80b31e4e2",
    - "tx_status": "success",
    - "tx_type": "coinbase",
    - "fee_rate": "0",
    - "sender_address": "ST2TJRHDHMYBQ417HFB0BDX430TQA5PXRX6495G1V",
    - "sponsored": false,
    - "post_condition_mode": "deny",
    - "block_hash": "0x83f84f814c1b00ddb672d93b97d06c8326f76746d90a979c12b69e54beb73f69",
    - "block_height": 5603,
    - "burn_block_time": 1594335838,
    - "canonical": true,
    - "is_unanchored": false,
    - "microblock_hash": "0x590a1bb1d7bcbeafce0a9fc8f8a69e369486192d14687fe95fbe4dc1c71d49df",
    - "microblock_sequence": 5,
    - "microblock_canonical": true,
    - "tx_index": 0,
    - "coinbase_payload":
      {
      - "data": "0x0000000000000000000000000000000000000000000000000000000000000000"
      }
    }
  ]

}`

## Get account transaction information for specific transaction

##### path Parameters

principal required | string Stacks address or a contract identifier
tx_id required | string Transaction id

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/{tx_id}/with_transfers

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/{tx_id}/with_transfers

Local

http://localhost:3999/extended/v1/address/{principal}/{tx_id}/with_transfers

### Response samples

- 200
- 404

Content type
application/json
`
{

- "tx_id": "0x34d79c7cfc2fe525438736733e501a4bf0308a5556e3e080d1e2c0858aad7448",
- "tx_type": "contract_call",
- "nonce": 11,
- "fee_rate": "346",
- "sender_address": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
- "sponsored": false,
- "post_condition_mode": "deny",
- "tx_status": "success",
- "block_hash": "0x13d1b4ad35c95bca209397420fb8af104d2929d91993ba056d7a1ca5470095f9",
- "block_height": 3246,
- "burn_block_time": 1613009951,
- "burn_block_time_iso": "2021-02-11T02:19:11.000Z",
- "canonical": true,
- "is_unanchored": false,
- "microblock_hash": "0x590a1bb1d7bcbeafce0a9fc8f8a69e369486192d14687fe95fbe4dc1c71d49df",
- "microblock_sequence": 5,
- "microblock_canonical": true,
- "tx_index": 1,
- "tx_result":
  {
  - "hex": "0x0703",
  - "repr": "(ok true)"
  },
- "post_conditions":
  [
  - {
    - "type": "stx",
    - "condition_code": "sent_equal_to",
    - "amount": "350",
    - "principal":
      {
      - "type_id": "principal_standard",
      - "address": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE"
      }
    }
  ],
- "contract_call":
  {
  - "contract_id": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo",
  - "function_name": "send-many",
  - "function_signature": "(define-public (send-many (recipients (list 200 (tuple (memo (buff 34)) (to principal) (ustx uint))))))",
  - "function_args":
    [
    - {
      - "hex": "0x0b000000020c00000003046d656d6f020000000966697273746d656d6f02746f05168c031b2db5895ece0cdfbf76e0b0e8af67226a6f047573747801000000000000000000000000000000960c00000003046d656d6f020000000a7365636f6e646d656d6f02746f05168974da696d74a16d0955bc8e55720dfd39e789cf047573747801000000000000000000000000000000c8",
      - "repr": "(list (tuple (memo 0x66697273746d656d6f) (to SP26066SDPP4NXKGCVYZQDR5GX2QPE8KADZ0YK2J7) (ustx u150)) (tuple (memo 0x7365636f6e646d656d6f) (to SP24Q9PK9DNTA2V89APY8WNBJ1QYKKSW9SWB04RJP) (ustx u200)))",
      - "name": "recipients",
      - "type": "(list 200 (tuple (memo (buff 34)) (to principal) (ustx uint)))"
      }
    ]
  },
- "events": [ ],
- "event_count": 4

}`

## Get account transactions including STX transfers for each transaction.

##### path Parameters

principal required | string Stacks address or a Contract identifier (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`)

##### query Parameters

limit | integer max number of account transactions to fetch
offset | integer index of first account transaction to fetch
height | number Filter for transactions only at this given block height
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/transactions_with_transfers

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/transactions_with_transfers

Local

http://localhost:3999/extended/v1/address/{principal}/transactions_with_transfers

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "total": 2,
- "results":
  [
  - {
    - "tx":
      {
      - "tx_id": "0x34d79c7cfc2fe525438736733e501a4bf0308a5556e3e080d1e2c0858aad7448",
      - "tx_type": "contract_call",
      - "nonce": 11,
      - "fee_rate": "346",
      - "sender_address": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
      - "sponsored": false,
      - "post_condition_mode": "deny",
      - "tx_status": "success",
      - "block_hash": "0x13d1b4ad35c95bca209397420fb8af104d2929d91993ba056d7a1ca5470095f9",
      - "block_height": 3246,
      - "burn_block_time": 1613009951,
      - "burn_block_time_iso": "2021-02-11T02:19:11.000Z",
      - "canonical": true,
      - "is_unanchored": false,
      - "microblock_hash": "0x590a1bb1d7bcbeafce0a9fc8f8a69e369486192d14687fe95fbe4dc1c71d49df",
      - "microblock_sequence": 5,
      - "microblock_canonical": true,
      - "tx_index": 1,
      - "tx_result":
        {
        - "hex": "0x0703",
        - "repr": "(ok true)"
        },
      - "post_conditions":
        [
        - {
          - "type": "stx",
          - "condition_code": "sent_equal_to",
          - "amount": "350",
          - "principal":
            {
            - "type_id": "principal_standard",
            - "address": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE"
            }
          }
        ],
      - "contract_call":
        {
        - "contract_id": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo",
        - "function_name": "send-many",
        - "function_signature": "(define-public (send-many (recipients (list 200 (tuple (memo (buff 34)) (to principal) (ustx uint))))))",
        - "function_args":
          [
          - {
            - "hex": "0x0b000000020c00000003046d656d6f020000000966697273746d656d6f02746f05168c031b2db5895ece0cdfbf76e0b0e8af67226a6f047573747801000000000000000000000000000000960c00000003046d656d6f020000000a7365636f6e646d656d6f02746f05168974da696d74a16d0955bc8e55720dfd39e789cf047573747801000000000000000000000000000000c8",
            - "repr": "(list (tuple (memo 0x66697273746d656d6f) (to SP26066SDPP4NXKGCVYZQDR5GX2QPE8KADZ0YK2J7) (ustx u150)) (tuple (memo 0x7365636f6e646d656d6f) (to SP24Q9PK9DNTA2V89APY8WNBJ1QYKKSW9SWB04RJP) (ustx u200)))",
            - "name": "recipients",
            - "type": "(list 200 (tuple (memo (buff 34)) (to principal) (ustx uint)))"
            }
          ]
        },
      - "events": [ ],
      - "event_count": 4
      },
    - "stx_sent": "696",
    - "stx_received": "0",
    - "stx_transfers":
      [
      - {
        - "amount": "200",
        - "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
        - "recipient": "SP24Q9PK9DNTA2V89APY8WNBJ1QYKKSW9SWB04RJP"
        },
      - {
        - "amount": "150",
        - "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
        - "recipient": "SP26066SDPP4NXKGCVYZQDR5GX2QPE8KADZ0YK2J7"
        }
      ],
    - "ft_transfers":
      [
      - {
        - "amount": "103",
        - "asset_identifier": "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27.miamicoin-token::miamicoin",
        - "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
        - "recipient": "SP24Q9PK9DNTA2V89APY8WNBJ1QYKKSW9SWB04RJP"
        }
      ],
    - "nft_transfers":
      [
      - {
        - "asset_identifier": "SP497E7RX3233ATBS2AB9G4WTHB63X5PBSP5VGAQ.boom-nfts::boom",
        - "value":
          {
          - "hex": "0x00",
          - "repr": "0"
          },
        - "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
        - "recipient": "SP24Q9PK9DNTA2V89APY8WNBJ1QYKKSW9SWB04RJP"
        }
      ]
    },
  - {
    - "tx":
      {
      - "tx_id": "0x628045bff13658396277d618e9a3e4d468a4b3876eff4941d2f13ed88cd7abb7",
      - "tx_type": "token_transfer",
      - "nonce": 8,
      - "fee_rate": "180",
      - "sender_address": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
      - "sponsored": false,
      - "post_condition_mode": "deny",
      - "tx_status": "success",
      - "block_hash": "0x2b8599696f64e2456c67b1ab5e63078f99d87bd1d903c37fdcfd73b1890a7551",
      - "block_height": 1761,
      - "burn_block_time": 1611968237,
      - "burn_block_time_iso": "2021-01-30T00:57:17.000Z",
      - "canonical": true,
      - "is_unanchored": false,
      - "microblock_hash": "",
      - "microblock_sequence": 2147483647,
      - "microblock_canonical": true,
      - "tx_index": 2,
      - "tx_result":
        {
        - "hex": "0x0703",
        - "repr": "(ok true)"
        },
      - "token_transfer":
        {
        - "recipient_address": "SPRSM0R2JZWBCZ39NQBARWTMX9TE99K3JK8D5KMX",
        - "amount": "100000",
        - "memo": "0x57656c636f6d6520746f20426f6f6d2e000000000000000000000000000000000000"
        },
      - "events": [ ],
      - "event_count": 1
      },
    - "stx_sent": "100180",
    - "stx_received": "0",
    - "stx_transfers":
      [
      - {
        - "amount": "100000",
        - "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
        - "recipient": "SPRSM0R2JZWBCZ39NQBARWTMX9TE99K3JK8D5KMX"
        }
      ],
    - "ft_transfers": [ ],
    - "nft_transfers": [ ]
    }
  ]

}`

## Get the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.

##### path Parameters

principal required | string Stacks address (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0`)

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/nonces

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/nonces

Local

http://localhost:3999/extended/v1/address/{principal}/nonces

### Response samples

- 200

Content type
application/json
`
{

- "last_mempool_tx_nonce": 5,
- "last_executed_tx_nonce": 2,
- "possible_next_nonce": 6,
- "detected_missing_nonces":
  [
  - 3,
  - 4
  ]

}`

## Get account assets

##### path Parameters

principal required | string Stacks address or a Contract identifier (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`)

##### query Parameters

limit | integer max number of account assets to fetch
offset | integer index of first account assets to fetch
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/assets

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/assets

Local

http://localhost:3999/extended/v1/address/{principal}/assets

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "total": 0,
- "results":
  [
  - {
    - "event_index": 0,
    - "event_type": "stx_asset",
    - "tx_id": "0xb31df5a363dad31723324cb5e0eefa04d491519fd30827a521cbc830114aa50c",
    - "asset":
      {
      - "asset_event_type": "transfer",
      - "sender": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
      - "recipient": "ST2TJRHDHMYBQ417HFB0BDX430TQA5PXRX6495G1V",
      - "amount": "500000"
      }
    }
  ]

}`

## Get inbound STX transfers

Get a list of STX transfers with memos to the given principal. This includes regular transfers from a stx-transfer transaction type, and transfers from contract-call transactions a the `send-many-memo` bulk sending contract.

##### path Parameters

principal required | string Stacks address or a Contract identifier (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`)

##### query Parameters

limit | integer number of items to return
offset | integer number of items to skip
height | number Filter for transfers only at this given block height
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/stx_inbound

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/stx_inbound

Local

http://localhost:3999/extended/v1/address/{principal}/stx_inbound

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "total": 0,
- "results":
  [
  - {
    - "sender": "ST1RZG804V6Y0N4XHQD3ZE2GE3XSCV3VHRKMA3GB0",
    - "amount": "123456789",
    - "memo": "0x00000000000000000000000000000000000000000000000000000000000000000000",
    - "block_height": 12345,
    - "tx_id": "0x29e25515652dad41ef675bd0670964e3d537b80ec19cf6ca6f1dd65d5bc642c5",
    - "transfer_type": "bulk-send",
    - "tx_index": 3
    }
  ]

}`

## Get nft events

Get list of all nfts owned by an address, contains the clarity value of the identifier of the nft

##### path Parameters

principal required | string Stacks address or a Contract identifier (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`)

##### query Parameters

limit | integer number of items to return
offset | integer number of items to skip
unanchored | boolean Default: false Include transaction data from unanchored (i.e. unconfirmed) microblocks

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/address/{principal}/nft_events

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/address/{principal}/nft_events

Local

http://localhost:3999/extended/v1/address/{principal}/nft_events

### Response samples

- 200

Content type
application/json
`
{

- "limit": 20,
- "offset": 0,
- "total": 1,
- "nft_events":
  [
  - {
    - "sender": "none",
    - "recipient": "ST1HB64MAJ1MBV4CQ80GF01DZS4T1DSMX20ADCRA4",
    - "asset_identifier": "some-asset",
    - "value":
      {
      - "hex": "0x00",
      - "repr": "0"
      }
    }
  ]

}`

## Get account info

Get the account data for the provided principal

Where balance is the hex encoding of a unsigned 128-bit integer (big-endian), nonce is a unsigned 64-bit integer, and the proofs are provided as hex strings.

For non-existent accounts, this does not 404, rather it returns an object with balance and nonce of 0.

##### path Parameters

principal required | string Stacks address or a Contract identifier (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`)

##### query Parameters

proof | integer Returns object without the proof field if set to 0
tip | string The Stacks chain tip to query from

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/accounts/{principal}

Testnet

https://stacks-node-api.testnet.stacks.co/v2/accounts/{principal}

Local

http://localhost:3999/v2/accounts/{principal}

### Response samples

- 200

Content type
application/json
`
{

- "balance": "0x0000000000000000000000000007a120",
- "locked": "0x0000000000000000000000000007a120",
- "unlock_height": 126,
- "nonce": 2867,
- "balance_proof": "0xabce",
- "nonce_proof": "0xabcd"

}`

# Fees

## Get estimated fee

Get an estimated fee rate for STX transfer transactions. This a a fee rate / byte, and is returned as a JSON integer

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/fees/transfer

Testnet

https://stacks-node-api.testnet.stacks.co/v2/fees/transfer

Local

http://localhost:3999/v2/fees/transfer

### Response samples

- 200

Content type
application/json
`1`

# Info

## Get Core API info

Get Core API information

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/info

Testnet

https://stacks-node-api.testnet.stacks.co/v2/info

Local

http://localhost:3999/v2/info

### Response samples

- 200

Content type
application/json
`
{

- "peer_version": 385875968,
- "pox_consensus": "17f76e597bab45646956f38dd39573085d72cbc0",
- "burn_block_height": 16,
- "stable_pox_consensus": "8e0561978fc5506b68a589c402dad97e862edb59",
- "stable_burn_block_height": 15,
- "server_version": "blockstack-core 0.0.1 => 23.0.0.0 (, release build, linux [x86_64])",
- "network_id": 2147483648,
- "parent_network_id": 3669344250,
- "stacks_tip_height": 15,
- "stacks_tip": "b1807a2d3f7f8c7922f7c1d60d7c34145ade05d789640dc7dc9ec1021e07bb54",
- "stacks_tip_consensus_hash": "17f76e597bab45646956f38dd39573085d72cbc0",
- "unanchored_tip": "0000000000000000000000000000000000000000000000000000000000000000",
- "exit_at_block_height": null

}`

## Get Blockchain API status

Get Blockchain API status

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/status

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/status

Local

http://localhost:3999/extended/v1/status

### Response samples

- 200

Content type
application/json
`
{

- "server_version": "stacks-blockchain-api v0.64.1 (master:439d4f46)",
- "status": "ready"

}`

## Get the network target block time

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/info/network_block_times

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/info/network_block_times

Local

http://localhost:3999/extended/v1/info/network_block_times

### Response samples

- 200

Content type
application/json
`
{

- "testnet":
  {
  - "target_block_time": 120
  },
- "mainnet":
  {
  - "target_block_time": 600
  }

}`

## Get a given network's target block time

##### path Parameters

network required | string Enum: "testnet" "mainnet" Which network to retrieve the target block time of

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/info/network_block_time/{network}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/info/network_block_time/{network}

Local

http://localhost:3999/extended/v1/info/network_block_time/{network}

### Response samples

- 200

Content type
application/json
`
{

- "target_block_time": 600

}`

## Get total and unlocked STX supply

##### query Parameters

height | number The block height at which to query supply details from, if not provided then the latest block height is used

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/stx_supply

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/stx_supply

Local

http://localhost:3999/extended/v1/stx_supply

### Response samples

- 200

Content type
application/json
`
{

- "unlocked_percent": "71.99",
- "total_stx": "1352464600.000000",
- "unlocked_stx": "973705260.219817",
- "block_height": 3210

}`

## Get total STX supply in plain text format

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/stx_supply/total/plain

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/stx_supply/total/plain

Local

http://localhost:3999/extended/v1/stx_supply/total/plain

### Response samples

- 200

Content type
text/plain

    123.456789

## Get circulating STX supply in plain text format

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/stx_supply/circulating/plain

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/stx_supply/circulating/plain

Local

http://localhost:3999/extended/v1/stx_supply/circulating/plain

### Response samples

- 200

Content type
text/plain

    123.456789

## Get total and unlocked STX supply (results formatted the same as the legacy 1.0 API)

##### query Parameters

height | number The block height at which to query supply details from, if not provided then the latest block height is used

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/stx_supply/legacy_format

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/stx_supply/legacy_format

Local

http://localhost:3999/extended/v1/stx_supply/legacy_format

### Response samples

- 200

Content type
application/json
`
{

- "unlockedPercent": "71.99",
- "totalStacks": "1352464600.000000",
- "totalStacksFormatted": "1,352,464,600.000000",
- "unlockedSupply": "973705260.219817",
- "unlockedSupplyFormatted": "973,705,260.219817",
- "blockHeight": "665746"

}`

## Get PoX details

Get Proof of Transfer (PoX) information. Can be used for Stacking.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/pox

Testnet

https://stacks-node-api.testnet.stacks.co/v2/pox

Local

http://localhost:3999/v2/pox

### Response samples

- 200

Content type
application/json
`
{

- "contract_id": "ST000000000000000000002AMW42H.pox",
- "first_burnchain_block_height": 0,
- "min_amount_ustx": 150000000000,
- "registration_window_length": 250,
- "rejection_fraction": 25,
- "reward_cycle_id": 0,
- "reward_cycle_length": 1000,
- "rejection_votes_left_required": 1000,
- "total_liquid_supply_ustx": 1000000000

}`

# Search

Search blocks, transactions, contracts, or accounts by hash/ID

##### path Parameters

id required | string The hex hash string for a block or transaction, account address, or contract address

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/search/{id}

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/search/{id}

Local

http://localhost:3999/extended/v1/search/{id}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "found": true,
- "result":
  {
  - "entity_id": "ST2P7B9G6Y55QWZJ9B93DVSEG5S6Z4PFJHB3XRKHW.hello_world",
  - "entity_type": "contract_address",
  - "tx_data":
    {
    - "canonical": true,
    - "block_hash": "0xb076fd3983e63bbf28ae615daa31c5b6084d23ceeb920c54f1ea666244415457",
    - "burn_block_time": 1595229199,
    - "block_height": 648,
    - "tx_type": "smart_contract"
    }
  }

}`

# Rosetta

## Get List of Available Networks

This endpoint returns a list of NetworkIdentifiers that the Rosetta server supports.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/network/list

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/network/list

Local

http://localhost:3999/rosetta/v1/network/list

### Response samples

- 200
- 400

Content type
application/json
`
{

- "network_identifiers":
  [
  - {
    - "blockchain": "string",
    - "network": "string",
    - "sub_network_identifier":
      {
      - "network": "string",
      - "metadata":
        {
        - "producer": "string"
        }
      }
    }
  ]

}`

## Get Network Options

This endpoint returns the version information and allowed network-specific types for a NetworkIdentifier. Any NetworkIdentifier returned by /network/list should be accessible here. Because options are retrievable in the context of a NetworkIdentifier, it is possible to define unique options for each network.

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
metadata | object

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/network/options

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/network/options

Local

http://localhost:3999/rosetta/v1/network/options

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "metadata": { }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "version":
  {
  - "rosetta_version": "string",
  - "node_version": "string",
  - "middleware_version": "string",
  - "metadata": { }
  },
- "allow":
  {
  - "operation_statuses":
    [
    - {
      - "status": "string",
      - "successful": true
      }
    ],
  - "operation_types":
    [
    - "string"
    ],
  - "errors":
    [
    - {
      - "code": 0,
      - "message": "string",
      - "retriable": true
      }
    ],
  - "historical_balance_lookup": true
  }

}`

## Get Network Status

This endpoint returns the current status of the network requested. Any NetworkIdentifier returned by /network/list should be accessible here.

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
metadata | object

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/network/status

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/network/status

Local

http://localhost:3999/rosetta/v1/network/status

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "metadata": { }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "current_block_identifier":
  {
  - "hash": "string",
  - "index": 0
  },
- "current_block_timestamp": 0,
- "genesis_block_identifier":
  {
  - "index": 0,
  - "hash": "string"
  },
- "oldest_block_identifier":
  {
  - "index": 0,
  - "hash": "string"
  },
- "sync_status":
  {
  - "current_index": 0,
  - "target_index": 0,
  - "stage": "string",
  - "synced": true
  },
- "peers":
  [
  - {
    - "peer_id": "string",
    - "metadata": { }
    }
  ]

}`

## Get an Account Balance

An AccountBalanceRequest is utilized to make a balance request on the /account/balance endpoint. If the block_identifier is populated, a historical balance query should be performed.

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
required | object (RosettaAccount) The account_identifier uniquely identifies an account within a network. All fields in the account_identifier are utilized to determine this uniqueness (including the metadata field, if populated).
| RosettaBlockIdentifierHash (object) or RosettaBlockIdentifierHeight (object) (RosettaPartialBlockIdentifier) When fetching data by BlockIdentifier, it may be possible to only specify the index or hash. If neither property is specified, it is assumed that the client is making a request at the current block.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/account/balance

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/account/balance

Local

http://localhost:3999/rosetta/v1/account/balance

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "account_identifier":
  {
  - "address": "string",
  - "sub_account":
    {
    - "address": "string",
    - "metadata": { }
    },
  - "metadata": { }
  },
- "block_identifier":
  {
  - "hash": "string"
  }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "block_identifier":
  {
  - "hash": "string",
  - "index": 0
  },
- "balances":
  [
  - {
    - "value": "string",
    - "currency":
      {
      - "symbol": "string",
      - "decimals": 0,
      - "metadata": { }
      },
    - "metadata": { }
    }
  ],
- "coins":
  [
  - {
    - "coin_identifier":
      {
      - "identifier": "string"
      },
    - "amount":
      {
      - "value": "string",
      - "currency":
        {
        - "symbol": "string",
        - "decimals": 0,
        - "metadata": { }
        },
      - "metadata": { }
      }
    }
  ],
- "metadata":
  {
  - "sequence_number": 0
  }

}`

## Get a Block

A BlockRequest is utilized to make a block request on the /block endpoint.

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
required | RosettaBlockIdentifierHash (object) or RosettaBlockIdentifierHeight (object) (RosettaPartialBlockIdentifier) When fetching data by BlockIdentifier, it may be possible to only specify the index or hash. If neither property is specified, it is assumed that the client is making a request at the current block.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/block

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/block

Local

http://localhost:3999/rosetta/v1/block

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "block_identifier":
  {
  - "hash": "string"
  }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "block":
  {
  - "block_identifier":
    {
    - "hash": "string",
    - "index": 0
    },
  - "parent_block_identifier":
    {
    - "index": 0,
    - "hash": "string"
    },
  - "timestamp": 0,
  - "transactions":
    [
    - {
      - "transaction_identifier":
        {
        - "hash": "string"
        },
      - "operations":
        [
        - {
          - "operation_identifier":
            {
            - "index": 0,
            - "network_index": 0
            },
          - "related_operations":
            [
            - {
              - "index": 0,
              - "network_index": 0
              }
            ],
          - "type": "string",
          - "status": "string",
          - "account":
            {
            - "address": "string",
            - "sub_account":
              {
              - "address": "string",
              - "metadata": { }
              },
            - "metadata": { }
            },
          - "amount":
            {
            - "value": "string",
            - "currency":
              {
              - "symbol": "string",
              - "decimals": 0,
              - "metadata": { }
              },
            - "metadata": { }
            },
          - "coin_change":
            {
            - "coin_identifier":
              {
              - "identifier": "string"
              },
            - "coin_action": "coin_created"
            },
          - "metadata": { }
          }
        ],
      - "metadata":
        {
        - "memo": "string",
        - "size": 0,
        - "lockTime": 0
        }
      }
    ],
  - "metadata":
    {
    - "transactions_root": "string",
    - "difficulty": "string"
    }
  },
- "other_transactions":
  [
  - {
    - "hash": "string"
    }
  ]

}`

## Get a Block Transaction

A BlockTransactionRequest is used to fetch a Transaction included in a block that is not returned in a BlockResponse.

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
required | RosettaBlockIdentifierHash (object) or RosettaBlockIdentifierHeight (object) (RosettaPartialBlockIdentifier) When fetching data by BlockIdentifier, it may be possible to only specify the index or hash. If neither property is specified, it is assumed that the client is making a request at the current block.
required | object (TransactionIdentifier) The transaction_identifier uniquely identifies a transaction in a particular network and block or in the mempool.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/block/transaction

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/block/transaction

Local

http://localhost:3999/rosetta/v1/block/transaction

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "block_identifier":
  {
  - "hash": "string"
  },
- "transaction_identifier":
  {
  - "hash": "string"
  }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "transaction":
  {
  - "transaction_identifier":
    {
    - "hash": "string"
    },
  - "operations":
    [
    - {
      - "operation_identifier":
        {
        - "index": 0,
        - "network_index": 0
        },
      - "related_operations":
        [
        - {
          - "index": 0,
          - "network_index": 0
          }
        ],
      - "type": "string",
      - "status": "string",
      - "account":
        {
        - "address": "string",
        - "sub_account":
          {
          - "address": "string",
          - "metadata": { }
          },
        - "metadata": { }
        },
      - "amount":
        {
        - "value": "string",
        - "currency":
          {
          - "symbol": "string",
          - "decimals": 0,
          - "metadata": { }
          },
        - "metadata": { }
        },
      - "coin_change":
        {
        - "coin_identifier":
          {
          - "identifier": "string"
          },
        - "coin_action": "coin_created"
        },
      - "metadata": { }
      }
    ],
  - "metadata":
    {
    - "memo": "string",
    - "size": 0,
    - "lockTime": 0
    }
  }

}`

## Get All Mempool Transactions

Get all Transaction Identifiers in the mempool.

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
metadata | object

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/mempool

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/mempool

Local

http://localhost:3999/rosetta/v1/mempool

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "metadata": { }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "transaction_identifiers":
  [
  - {
    - "hash": "string"
    }
  ],
- "metadata": { }

}`

## Get a Mempool Transaction

A MempoolTransactionRequest is utilized to retrieve a transaction from the mempool.

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
required | object (TransactionIdentifier) The transaction_identifier uniquely identifies a transaction in a particular network and block or in the mempool.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/mempool/transaction

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/mempool/transaction

Local

http://localhost:3999/rosetta/v1/mempool/transaction

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "transaction_identifier":
  {
  - "hash": "string"
  }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "transaction":
  {
  - "transaction_identifier":
    {
    - "hash": "string"
    },
  - "operations":
    [
    - {
      - "operation_identifier":
        {
        - "index": 0,
        - "network_index": 0
        },
      - "related_operations":
        [
        - {
          - "index": 0,
          - "network_index": 0
          }
        ],
      - "type": "string",
      - "status": "string",
      - "account":
        {
        - "address": "string",
        - "sub_account":
          {
          - "address": "string",
          - "metadata": { }
          },
        - "metadata": { }
        },
      - "amount":
        {
        - "value": "string",
        - "currency":
          {
          - "symbol": "string",
          - "decimals": 0,
          - "metadata": { }
          },
        - "metadata": { }
        },
      - "coin_change":
        {
        - "coin_identifier":
          {
          - "identifier": "string"
          },
        - "coin_action": "coin_created"
        },
      - "metadata": { }
      }
    ],
  - "metadata":
    {
    - "memo": "string",
    - "size": 0,
    - "lockTime": 0
    }
  },
- "metadata": { }

}`

## Derive an AccountIdentifier from a PublicKey

TODO

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
required | object (RosettaPublicKey) PublicKey contains a public key byte array for a particular CurveType encoded in hex. Note that there is no PrivateKey struct as this is NEVER the concern of an implementation.
metadata | object

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/construction/derive

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/construction/derive

Local

http://localhost:3999/rosetta/v1/construction/derive

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "public_key":
  {
  - "hex_bytes": "string",
  - "curve_type": "secp256k1"
  },
- "metadata": { }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "address": "string",
- "account_identifier":
  {
  - "address": "string",
  - "sub_account":
    {
    - "address": "string",
    - "metadata": { }
    },
  - "metadata": { }
  },
- "metadata": { }

}`

## Get the Hash of a Signed Transaction

TODO

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
signed_transaction required | string Signed transaction

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/construction/hash

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/construction/hash

Local

http://localhost:3999/rosetta/v1/construction/hash

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "signed_transaction": "string"

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "transaction_identifier":
  {
  - "hash": "string"
  },
- "metadata": { }

}`

## Get Metadata for Transaction Construction

TODO

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
required | object (RosettaOptions) The options that will be sent directly to /construction/metadata by the caller.
| Array of objects (RosettaPublicKey)

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/construction/metadata

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/construction/metadata

Local

http://localhost:3999/rosetta/v1/construction/metadata

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "options":
  {
  - "sender_address": "string",
  - "type": "string",
  - "status": null,
  - "token_transfer_recipient_address": "string",
  - "amount": "string",
  - "symbol": "string",
  - "decimals": 0,
  - "gas_limit": 0,
  - "gas_price": 0,
  - "suggested_fee_multiplier": 0,
  - "max_fee": "string",
  - "fee": "string",
  - "size": 0,
  - "memo": "string",
  - "number_of_cycles": 0,
  - "contract_address": "string",
  - "contract_name": "string",
  - "burn_block_height": 0,
  - "delegate_to": "string",
  - "pox_addr": "string"
  },
- "public_keys":
  [
  - {
    - "hex_bytes": "string",
    - "curve_type": "secp256k1"
    }
  ]

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "metadata":
  {
  - "account_sequence": 0,
  - "recent_block_hash": "string"
  },
- "suggested_fee":
  [
  - {
    - "value": "string",
    - "currency":
      {
      - "symbol": "string",
      - "decimals": 0,
      - "metadata": { }
      },
    - "metadata": { }
    }
  ]

}`

## Parse a Transaction

TODO

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
signed required | boolean Signed is a boolean indicating whether the transaction is signed.
transaction required | string This must be either the unsigned transaction blob returned by /construction/payloads or the signed transaction blob returned by /construction/combine.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/construction/parse

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/construction/parse

Local

http://localhost:3999/rosetta/v1/construction/parse

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "signed": true,
- "transaction": "string"

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "operations":
  [
  - {
    - "operation_identifier":
      {
      - "index": 0,
      - "network_index": 0
      },
    - "related_operations":
      [
      - {
        - "index": 0,
        - "network_index": 0
        }
      ],
    - "type": "string",
    - "status": "string",
    - "account":
      {
      - "address": "string",
      - "sub_account":
        {
        - "address": "string",
        - "metadata": { }
        },
      - "metadata": { }
      },
    - "amount":
      {
      - "value": "string",
      - "currency":
        {
        - "symbol": "string",
        - "decimals": 0,
        - "metadata": { }
        },
      - "metadata": { }
      },
    - "coin_change":
      {
      - "coin_identifier":
        {
        - "identifier": "string"
        },
      - "coin_action": "coin_created"
      },
    - "metadata": { }
    }
  ],
- "signers":
  [
  - "string"
  ],
- "account_identifier_signers":
  [
  - {
    - "address": "string",
    - "sub_account":
      {
      - "address": "string",
      - "metadata": { }
      },
    - "metadata": { }
    }
  ],
- "metadata": { }

}`

## Create a Request to Fetch Metadata

TODO

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
required | Array of objects (RosettaOperation)
metadata | object
| Array of objects (RosettaMaxFeeAmount)

suggested_fee_multiplier

integer

The caller can also provide a suggested fee multiplier to indicate that the suggested fee should be scaled. This may be used to set higher fees for urgent transactions or to pay lower fees when there is less urgency. It is assumed that providing a very low multiplier (like 0.0001) will never lead to a transaction being created with a fee less than the minimum network fee (if applicable). In the case that the caller provides both a max fee and a suggested fee multiplier, the max fee will set an upper bound on the suggested fee (regardless of the multiplier provided).

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/construction/preprocess

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/construction/preprocess

Local

http://localhost:3999/rosetta/v1/construction/preprocess

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "operations":
  [
  - {
    - "operation_identifier":
      {
      - "index": 0,
      - "network_index": 0
      },
    - "related_operations":
      [
      - {
        - "index": 0,
        - "network_index": 0
        }
      ],
    - "type": "string",
    - "status": "string",
    - "account":
      {
      - "address": "string",
      - "sub_account":
        {
        - "address": "string",
        - "metadata": { }
        },
      - "metadata": { }
      },
    - "amount":
      {
      - "value": "string",
      - "currency":
        {
        - "symbol": "string",
        - "decimals": 0,
        - "metadata": { }
        },
      - "metadata": { }
      },
    - "coin_change":
      {
      - "coin_identifier":
        {
        - "identifier": "string"
        },
      - "coin_action": "coin_created"
      },
    - "metadata": { }
    }
  ],
- "metadata": { },
- "max_fee":
  [
  - {
    - "value": "string",
    - "currency":
      {
      - "symbol": "string",
      - "decimals": 0,
      - "metadata": { }
      },
    - "metadata": { }
    }
  ],
- "suggested_fee_multiplier": 0

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "options":
  {
  - "sender_address": "string",
  - "type": "string",
  - "status": null,
  - "token_transfer_recipient_address": "string",
  - "amount": "string",
  - "symbol": "string",
  - "decimals": 0,
  - "gas_limit": 0,
  - "gas_price": 0,
  - "suggested_fee_multiplier": 0,
  - "max_fee": "string",
  - "fee": "string",
  - "size": 0,
  - "memo": "string",
  - "number_of_cycles": 0,
  - "contract_address": "string",
  - "contract_name": "string",
  - "burn_block_height": 0,
  - "delegate_to": "string",
  - "pox_addr": "string"
  },
- "required_public_keys":
  [
  - {
    - "address": "string",
    - "sub_account":
      {
      - "address": "string",
      - "metadata": { }
      },
    - "metadata": { }
    }
  ]

}`

## Submit a Signed Transaction

Submit a pre-signed transaction to the node.

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
signed_transaction required | string Signed transaction

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/construction/submit

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/construction/submit

Local

http://localhost:3999/rosetta/v1/construction/submit

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "signed_transaction": "string"

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "transaction_identifier":
  {
  - "hash": "string"
  },
- "metadata": { }

}`

## Generate an Unsigned Transaction and Signing Payloads

Generate and unsigned transaction from operations and metadata

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
required | Array of objects (RosettaOperation)
| Array of objects (RosettaPublicKey)
| object

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/construction/payloads

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/construction/payloads

Local

http://localhost:3999/rosetta/v1/construction/payloads

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "operations":
  [
  - {
    - "operation_identifier":
      {
      - "index": 0,
      - "network_index": 0
      },
    - "related_operations":
      [
      - {
        - "index": 0,
        - "network_index": 0
        }
      ],
    - "type": "string",
    - "status": "string",
    - "account":
      {
      - "address": "string",
      - "sub_account":
        {
        - "address": "string",
        - "metadata": { }
        },
      - "metadata": { }
      },
    - "amount":
      {
      - "value": "string",
      - "currency":
        {
        - "symbol": "string",
        - "decimals": 0,
        - "metadata": { }
        },
      - "metadata": { }
      },
    - "coin_change":
      {
      - "coin_identifier":
        {
        - "identifier": "string"
        },
      - "coin_action": "coin_created"
      },
    - "metadata": { }
    }
  ],
- "public_keys":
  [
  - {
    - "hex_bytes": "string",
    - "curve_type": "secp256k1"
    }
  ],
- "metadata":
  {
  - "account_sequence": 0,
  - "recent_block_hash": "string"
  }

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "unsigned_transaction": "string",
- "payloads":
  [
  - {
    - "address": "string",
    - "account_identifier":
      {
      - "address": "string",
      - "sub_account":
        {
        - "address": "string",
        - "metadata": { }
        },
      - "metadata": { }
      },
    - "hex_bytes": "string",
    - "signature_type": "ecdsa"
    }
  ]

}`

## Create Network Transaction from Signatures

Take unsigned transaction and signature, combine both and return signed transaction

##### Request Body schema: application/json

required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with.
unsigned_transaction required | string
required | Array of objects (RosettaSignature)

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/rosetta/v1/construction/combine

Testnet

https://stacks-node-api.testnet.stacks.co/rosetta/v1/construction/combine

Local

http://localhost:3999/rosetta/v1/construction/combine

### Request samples

- Payload

Content type
application/json
`
{

- "network_identifier":
  {
  - "blockchain": "string",
  - "network": "string",
  - "sub_network_identifier":
    {
    - "network": "string",
    - "metadata":
      {
      - "producer": "string"
      }
    }
  },
- "unsigned_transaction": "string",
- "signatures":
  [
  - {
    - "signing_payload":
      {
      - "address": "string",
      - "account_identifier":
        {
        - "address": "string",
        - "sub_account":
          {
          - "address": "string",
          - "metadata": { }
          },
        - "metadata": { }
        },
      - "hex_bytes": "string",
      - "signature_type": "ecdsa"
      },
    - "public_key":
      {
      - "hex_bytes": "string",
      - "curve_type": "secp256k1"
      },
    - "signature_type": "ecdsa",
    - "hex_bytes": "string"
    }
  ]

}`

### Response samples

- 200
- 400

Content type
application/json
`
{

- "signed_transaction": "string"

}`

# BNS

## Get Namespace Price

Get the price of a namespace. The `amount` given will be in the smallest possible units of the currency.

##### path Parameters

tld required | string Example: id the namespace to fetch price for

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/prices/namespaces/{tld}

Testnet

https://stacks-node-api.testnet.stacks.co/v2/prices/namespaces/{tld}

Local

http://localhost:3999/v2/prices/namespaces/{tld}

### Response samples

- 200

Content type
application/json
`
{

- "units": "STX",
- "amount": "4000000000"

}`

## Get Name Price

Get the price of a name. The `amount` given will be in the smallest possible units of the currency.

##### path Parameters

name required | string Example: muneeb.id the name to query price information for

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v2/prices/names/{name}

Testnet

https://stacks-node-api.testnet.stacks.co/v2/prices/names/{name}

Local

http://localhost:3999/v2/prices/names/{name}

### Response samples

- 200

Content type
application/json
`
{

- "name_price":
  {
  - "units": "STX",
  - "amount": "100000"
  }

}`

## Get All Namespaces

Fetch a list of all namespaces known to the node.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/namespaces

Testnet

https://stacks-node-api.testnet.stacks.co/v1/namespaces

Local

http://localhost:3999/v1/namespaces

### Response samples

- 200

Content type
application/json
`
{

- "namespaces":
  [
  - "id",
  - "helloworld",
  - "podcast",
  - "graphite",
  - "blockstack"
  ]

}`

## Get Namespace Names

Fetch a list of names from the namespace.

##### path Parameters

tld required | string Example: id the namespace to fetch names from

##### query Parameters

page required | integer Example: page=23 names are returned in pages of size 100, so specify the page number.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/namespaces/{tld}/names

Testnet

https://stacks-node-api.testnet.stacks.co/v1/namespaces/{tld}/names

Local

http://localhost:3999/v1/namespaces/{tld}/names

### Response samples

- 200
- 400
- 404

Content type
application/json
`
[

- "aldenquimby.id",
- "aldeoryn.id",
- "alderete.id",
- "aldert.id",
- "aldi.id",
- "aldighieri.id"

]`

## Get All Names

Fetch a list of all names known to the node.

##### query Parameters

page required | integer Example: page=23 names are returned in pages of size 100, so specify the page number.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/names

Testnet

https://stacks-node-api.testnet.stacks.co/v1/names

Local

http://localhost:3999/v1/names

### Response samples

- 200
- 400

Content type
application/json
`
[

- "aldenquimby.id",
- "aldeoryn.id",
- "alderete.id",
- "aldert.id",
- "aldi.id",
- "aldighieri.id"

]`

## Get Name Details

##### path Parameters

name required | string Example: muneeb.id fully-qualified name

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/names/{name}

Testnet

https://stacks-node-api.testnet.stacks.co/v1/names/{name}

Local

http://localhost:3999/v1/names/{name}

### Response samples

- 200
- 400
- 404

Content type
application/json
`
{

- "address": "1J3PUxY5uDShUnHRrMyU6yKtoHEUPhKULs",
- "blockchain": "bitcoin",
- "expire_block": 599266,
- "grace_period": false,
- "last_txid": "1edfa419f7b83f33e00830bc9409210da6c6d1db60f99eda10c835aa339cad6b",
- "renewal_deadline": 604266,
- "resolver": null,
- "status": "registered",
- "zonefile": "$ORIGIN muneeb.id\n$TTL 3600\n_http._tcp IN URI 10 1 \"https://gaia.blockstack.org/hub/1J3PUxY5uDShUnHRrMyU6yKtoHEUPhKULs/0/profile.json\"\n",
- "zonefile_hash": "37aecf837c6ae9bdc9dbd98a268f263dacd00361"

}`

## Get Name History

Get a history of all blockchain records of a registered name.

##### path Parameters

name required | string Example: muneeb.id name to query

##### query Parameters

page required | integer the page (in 20-entry pages) of the history to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/names/{name}/history

Testnet

https://stacks-node-api.testnet.stacks.co/v1/names/{name}/history

Local

http://localhost:3999/v1/names/{name}/history

### Response samples

- 200
- 400
- 404

Content type
application/json
`
{

- "zonefile": "$ORIGIN muneeb.id\n$TTL 3600\n_http._tcp IN URI 10 1 \"https://blockstack.s3.amazonaws.com/muneeb.id\"\n"

}`

## Fetch Zone File

Fetch a user’s raw zone file. This only works for RFC-compliant zone files. This method returns an error for names that have non-standard zone files.

##### path Parameters

name required | string Example: bar.test fully-qualified name

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/names/{name}/zonefile

Testnet

https://stacks-node-api.testnet.stacks.co/v1/names/{name}/zonefile

Local

http://localhost:3999/v1/names/{name}/zonefile

### Response samples

- 200
- 400
- 404

Content type
application/json
`
{

- "zonefile": "$ORIGIN bar.test\n$TTL 3600\n_https._tcp URI 10 1 \"https://gaia.blockstack.org/hub/17Zijx61Sp7SbVfRTdETo7PhizJHYEUxbY/profile.json\"\n"

}`

## Get Historical Zone File

Fetches the historical zonefile specified by the username and zone hash.

##### path Parameters

name required | string Example: muneeb.id fully-qualified name
zoneFileHash required | string Example: b100a68235244b012854a95f9114695679002af9 zone file hash

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/names/{name}/zonefile/{zoneFileHash}

Testnet

https://stacks-node-api.testnet.stacks.co/v1/names/{name}/zonefile/{zoneFileHash}

Local

http://localhost:3999/v1/names/{name}/zonefile/{zoneFileHash}

### Response samples

- 200
- 400
- 404

Content type
application/json
`
{

- "$schema": "http://json-schema.org/draft-07/schema",
- "$id": "bns-fetch-historical-zone-file-response",
- "title": "BnsFetchHistoricalZoneFileResponse",
- "description": "Fetches the historical zonefile specified by the username and zone hash.",
- "required": [ ],
- "anyOf":
  [
  - {
    - "type": "object",
    - "properties":
      {
      - "zonefile":
        {
        - "type": "string"
        }
      }
    },
  - {
    - "type": "object",
    - "properties":
      {
      - "error":
        {
        - "type": "string"
        }
      }
    }
  ]

}`

## Get Names Owned by Address

Retrieves a list of names owned by the address provided.

##### path Parameters

blockchain required | string Example: bitcoin the layer-1 blockchain for the address
address required | string Example: 1QJQxDas5JhdiXhEbNS14iNjr8auFT96GP the address to lookup

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/addresses/{blockchain}/{address}

Testnet

https://stacks-node-api.testnet.stacks.co/v1/addresses/{blockchain}/{address}

Local

http://localhost:3999/v1/addresses/{blockchain}/{address}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "names":
  [
  - "muneeb.id"
  ]

}`

## Get All Subdomains

Fetch a list of all subdomains known to the node.

##### query Parameters

page required | integer Example: page=3 names are returned in pages of size 100, so specify the page number.

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/subdomains

Testnet

https://stacks-node-api.testnet.stacks.co/v1/subdomains

Local

http://localhost:3999/v1/subdomains

### Response samples

- 200
- 400

Content type
application/json
`
[

- "collegeinfogeek.verified.podcast",
- "collider.verified.podcast",
- "combatandclassics.verified.podcast",
- "combatjack.verified.podcast",
- "comedybangbang.verified.podcast",
- "comedybutton.verified.podcast",
- "commonsense.verified.podcast",
- "concilio002.personal.id"

]`

## Get Subdomain at Transaction

Fetches the list of subdomain operations processed by a given transaction. The returned array includes subdomain operations that have not yet been accepted as part of any subdomain’s history (checkable via the accepted field). If the given transaction ID does not correspond to a Blockstack transaction that introduced new subdomain operations, and empty array will be returned.

##### path Parameters

txid required | string Example: d04d708472ea3c147f50e43264efdb1535f71974053126dc4db67b3ac19d41fe transaction id

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/v1/subdomains/{txid}

Testnet

https://stacks-node-api.testnet.stacks.co/v1/subdomains/{txid}

Local

http://localhost:3999/v1/subdomains/{txid}

### Response samples

- 200
- 400

Content type
application/json
`
[

- {
  - "accepted": 1,
  - "block_height": 546199,
  - "domain": "id.blockstack",
  - "fully_qualified_subdomain": "nturl345.id.blockstack",
  - "missing": "",
  - "owner": "17Q8hcsxRLCk3ypJiGeXQv9tFK9GnHr5Ea",
  - "parent_zonefile_hash": "58224144791919f6206251a9960a2dd5723b96b6",
  - "parent_zonefile_index": 95780,
  - "resolver": "https://registrar.blockstack.org",
  - "sequence": 0,
  - "signature": "None",
  - "txid": "d04d708472ea3c147f50e43264efdb1535f71974053126dc4db67b3ac19d41fe",
  - "zonefile_hash": "d3bdf1cf010aac3f21fac473e41450f5357e0817",
  - "zonefile_offset": 0
  },
- {
  - "accepted": 1,
  - "block_height": 546199,
  - "domain": "id.blockstack",
  - "fully_qualified_subdomain": "dwerner1.id.blockstack",
  - "missing": "",
  - "owner": "17tFeKEBMUAAiHVsCgqKo8ccwYqq7aCn9X",
  - "parent_zonefile_hash": "58224144791919f6206251a9960a2dd5723b96b6",
  - "parent_zonefile_index": 95780,
  - "resolver": "https://registrar.blockstack.org",
  - "sequence": 0,
  - "signature": "None",
  - "txid": "d04d708472ea3c147f50e43264efdb1535f71974053126dc4db67b3ac19d41fe",
  - "zonefile_hash": "ab79b1774fa7a4c5709b6ad4e5892fb7c0f79765",
  - "zonefile_offset": 1
  }

]`

# tokens

## Fungible tokens metadata list

Get list of fungible tokens metadata

##### query Parameters

limit | integer max number of tokens to fetch
offset | integer index of first tokens to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tokens/ft/metadata

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tokens/ft/metadata

Local

http://localhost:3999/extended/v1/tokens/ft/metadata

### Response samples

- 200

Content type
application/json
`
{

- "limit": 1,
- "offset": 0,
- "total": 500,
- "results":
  [
  - {
    - "token_uri": "https://heystack.xyz/token-metadata.json",
    - "name": "Heystack",
    - "description": "Heystack is a SIP-010-compliant fungible token on the Stacks Blockchain, used on the Heystack app",
    - "image_uri": "https://heystack.xyz/assets/Stacks128w.png",
    - "image_canonical_uri": "https://heystack.xyz/assets/Stacks128w.png",
    - "tx_id": "0xef2ac1126e16f46843228b1dk4830e19eb7599129e4jf392cab9e65ae83a45c0",
    - "sender_address": "ST399W7Z9WS0GMSNQGJGME5JAENKN56D65VGMGKGA",
    - "symbol": "HEY",
    - "decimals": 5
    }
  ]

}`

## Non fungible tokens metadata list

Get list of non fungible tokens metadata

##### query Parameters

limit | integer max number of tokens to fetch
offset | integer index of first tokens to fetch

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tokens/nft/metadata

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tokens/nft/metadata

Local

http://localhost:3999/extended/v1/tokens/nft/metadata

### Response samples

- 200

Content type
application/json
`
{

- "limit": 1,
- "offset": 0,
- "total": 500,
- "results":
  [
  - {
    - "token_uri": "https://pool.friedger.de/nft.json",
    - "name": "Friedger Pool",
    - "description": "Enjoying the stacking pool.",
    - "image_uri": "https://pool.friedger.de/nft.webp",
    - "image_canonical_uri": "https://pool.friedger.de/nft.webp",
    - "tx_id": "0xef2ac1126e16f46843228b1dk4830e19eb7599129e4jf392cab9e65ae83a45c0",
    - "sender_address": "ST399W7Z9WS0GMSNQGJGME5JAENKN56D65VGMGKGA"
    }
  ]

}`

## Non fungible tokens metadata for contract id

Get non fungible tokens metadata for given contract id

##### path Parameters

contractId required | string token's contract id

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tokens/{contractId}/nft/metadata

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tokens/{contractId}/nft/metadata

Local

http://localhost:3999/extended/v1/tokens/{contractId}/nft/metadata

### Response samples

- 200

Content type
application/json
`
{

- "token_uri": "https://pool.friedger.de/nft.json",
- "name": "Friedger Pool",
- "description": "Enjoying the stacking pool.",
- "image_uri": "https://pool.friedger.de/nft.webp",
- "image_canonical_uri": "https://pool.friedger.de/nft.webp",
- "tx_id": "0xef2ac1126e16f46843228b1dk4830e19eb7599129e4jf392cab9e65ae83a45c0",
- "sender_address": "ST399W7Z9WS0GMSNQGJGME5JAENKN56D65VGMGKGA"

}`

## Fungible tokens metadata for contract id

Get fungible tokens metadata for given contract id

##### path Parameters

contractId required | string token's contract id

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/tokens/{contractId}/ft/metadata

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/tokens/{contractId}/ft/metadata

Local

http://localhost:3999/extended/v1/tokens/{contractId}/ft/metadata

### Response samples

- 200

Content type
application/json
`
{

- "token_uri": "https://heystack.xyz/token-metadata.json",
- "name": "Heystack",
- "description": "Heystack is a SIP-010-compliant fungible token on the Stacks Blockchain, used on the Heystack app",
- "image_uri": "https://heystack.xyz/assets/Stacks128w.png",
- "image_canonical_uri": "https://heystack.xyz/assets/Stacks128w.png",
- "tx_id": "0xef2ac1126e16f46843228b1dk4830e19eb7599129e4jf392cab9e65ae83a45c0",
- "sender_address": "ST399W7Z9WS0GMSNQGJGME5JAENKN56D65VGMGKGA",
- "symbol": "HEY",
- "decimals": 5

}`

# fee_rate

## fetch fee rate

Fetch fee rate information.

##### Request Body schema: application/json

transaction required | string A serialized transaction

### Responses

Mainnet

https://stacks-node-api.mainnet.stacks.co/extended/v1/fee_rate

Testnet

https://stacks-node-api.testnet.stacks.co/extended/v1/fee_rate

Local

http://localhost:3999/extended/v1/fee_rate

### Request samples

- Payload

Content type
application/json
`
{

- "transaction": "0x5e9f3933e358df6a73fec0d47ce3e1062c20812c129f5294e6f37a8d27c051d9"

}`

### Response samples

- 200

Content type
application/json
`
{

- "fee_rate": 360

}`