Download OpenAPI specification:Download
Welcome to the API reference overview for the Stacks Blockchain API.
Retrieves total account balance information for a given Address or Contract Identifier. This includes the balances of STX Tokens, Fungible Tokens and Non-Fungible Tokens for the account.
principal required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 Stacks address or a Contract identifier |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
until_block | string Example: until_block=60000 returned data representing the state up until that point in time, rather than the current block. |
{- "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": { }
}
Retrieves STX token balance for a given Address or Contract Identifier.
principal required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 Stacks address or a Contract identifier. |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks. |
until_block | string Example: until_block=60000 returned data representing the state up until that point in time, rather than the current block. Note - Use either of the query parameters but not both at a time. |
{- "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
}
Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found here.
If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to WebSockets or Socket.io for real-time updates.
principal required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 Stacks address or a Contract identifier |
limit | integer Example: limit=42000 max number of account transactions to fetch |
offset | integer Example: offset=42000 index of first account transaction to fetch |
height | number Example: height=42000 Filter for transactions only at this given block height |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
until_block | string Example: until_block=60000 returned data representing the state up until that point in time, rather than the current block. Note - Use either of the query parameters but not both at a time. |
{- "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"
}
}
]
}
Retrieves transaction details for a given Transaction Id tx_id
, for a given account or contract Identifier.
principal required | string Example: SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE Stacks address or a contract identifier |
tx_id required | string Example: 0x34d79c7cfc2fe525438736733e501a4bf0308a5556e3e080d1e2c0858aad7448 Transaction id |
{- "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
}
Retrieve all transactions for an account or contract identifier including STX transfers for each transaction.
principal required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 Stacks address or a Contract identifier |
limit | integer Example: limit=20 max number of account transactions to fetch |
offset | integer Example: offset=10 index of first account transaction to fetch |
height | number Example: height=66119 Filter for transactions only at this given block height |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
until_block | string Example: until_block=60000 returned data representing the state up until that point in time, rather than the current block. |
{- "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": [ ]
}
]
}
Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.
principal required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 Stacks address |
block_height | number Example: block_height=66119 Optionally get the nonce at a given block height. |
block_hash | string Example: block_hash=0x72d53f3cba39e149dcd42708e535bdae03d73e60d2fe853aaf61c0b392f521e9 Optionally get the nonce at a given block hash. Note - Use either of the query parameters but not both at a time. |
{- "last_mempool_tx_nonce": 5,
- "last_executed_tx_nonce": 2,
- "possible_next_nonce": 6,
- "detected_missing_nonces": [
- 3,
- 4
], - "detected_mempool_nonces": [ ]
}
Retrieves a list of all assets events associated with an account or a Contract Identifier. This includes Transfers, Mints.
principal required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 Stacks address or a Contract identifier |
limit | integer Example: limit=20 max number of account assets to fetch |
offset | integer Example: offset=42000 index of first account assets to fetch |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
until_block | string Example: until_block=60000 returned data representing the state at that point in time, rather than the current block. Note - Use either of the query parameters but not both at a time. |
{- "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"
}
}
]
}
Retrieves 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.
principal required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 Stacks address or a Contract identifier |
limit | integer number of items to return |
offset | integer Example: offset=42000 number of items to skip |
height | number Filter for transfers only at this given block height |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
until_block | string Example: until_block=60000 returned data representing the state up until that point in time, rather than the current block. Note - Use either of the query parameters but not both at a time. |
{- "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
}
]
}
Retrieves the account data for a given Account or a Contract Identifier
Where balance is the hex encoding of a unsigned 128-bit integer (big-endian), nonce is an unsigned 64-bit integer, and the proofs are provided as hex strings.
For non-existent accounts, this does not return a 404 error, rather it returns an object with balance and nonce of 0.
principal required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 Stacks address or a Contract identifier |
proof | integer Returns object without the proof field if set to 0 |
tip | string The Stacks chain tip to query from |
{- "balance": "0x0000000000000000000000000007a120",
- "locked": "0x0000000000000000000000000007a120",
- "unlock_height": 126,
- "nonce": 2867,
- "balance_proof": "0xabce",
- "nonce_proof": "0xabcd"
}
Retrieves a list of blocks confirmed by a specific burn block
required | integer or string filter by burn block height, hash, or the constant |
limit | integer Example: limit=20 max number of blocks to fetch |
offset | integer Example: offset=0 index of first burn block to fetch |
{- "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",
- "txs": [
- "0x76f58b2eaff65a07a5971b241c4e71fee92ee0f9396809f911f90839f9004cac",
- "0x32972d9052b068f218f6e13451f7aff937099b74bbf95fac7d9402295b1b3941",
- "0x8cd30724c02a9cc1d8879a34dc136ebfdb2008420badcfb5947b92f85ebce79b",
- "0xf5c1577f42d3753a508101e045dd2dc60491eb0aa552e0ecd0ad37cc697143f4",
- "0x35e4c20e2838f999e0cf0b40c5fabce154c2df1912a1074150d26784c53f7a20",
- "0x501eb42b82e5b7a7350b47fa143cd4e90bb46d43e4a7d22830b2bf2aa70b7922"
]
}
]
}
Retrieves a list of recently mined blocks
limit | integer Example: limit=20 max number of blocks to fetch |
offset | integer Example: offset=0 index of first burn block to fetch |
{- "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",
- "txs": [
- "0x76f58b2eaff65a07a5971b241c4e71fee92ee0f9396809f911f90839f9004cac",
- "0x32972d9052b068f218f6e13451f7aff937099b74bbf95fac7d9402295b1b3941",
- "0x8cd30724c02a9cc1d8879a34dc136ebfdb2008420badcfb5947b92f85ebce79b",
- "0xf5c1577f42d3753a508101e045dd2dc60491eb0aa552e0ecd0ad37cc697143f4",
- "0x35e4c20e2838f999e0cf0b40c5fabce154c2df1912a1074150d26784c53f7a20",
- "0x501eb42b82e5b7a7350b47fa143cd4e90bb46d43e4a7d22830b2bf2aa70b7922"
]
}
]
}
Retrieves a single block
required | integer or string filter by block height, hash, index block hash or the constant |
{- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "block_time": 1594233639,
- "block_time_iso": "2020-08-27T16:41:26.000Z",
- "index_block_hash": "0x918697ef63f9d8bdf844c3312b299e72a231cde542f3173f7755bb8c1cdaf3a7",
- "parent_block_hash": "0x75ab21ef25cbff2caa14c27d830ed7886a4d1522e1b6f9e5dc3b59ccf73ed49f",
- "parent_index_block_hash": "0x4262db117659d1ca9406970c8f44ffd3d8f11f8e18c591d2e3960f4070107756",
- "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",
- "tx_count": 3,
- "execution_cost_read_count": 2477,
- "execution_cost_read_length": 1659409,
- "execution_cost_runtime": 2520952000,
- "execution_cost_write_count": 608,
- "execution_cost_write_length": 80170
}
NOTE: This endpoint is deprecated in favor of Get blocks.
Retrieves a list of recently mined blocks
If you need to actively monitor new blocks, we highly recommend subscribing to WebSockets or Socket.io for real-time updates.
limit | integer <= 30 Default: 20 max number of blocks to fetch |
offset | integer Example: offset=42000 index of first block to fetch |
{- "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"
]
}
]
}
NOTE: This endpoint is deprecated in favor of Get block.
Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block ('get_block_list' API) to get your block details.
hash required | string Example: 0x4839a8b01cfb39ffcc0d07d3db31e848d5adf5279d529ed5062300b9f353ff79 Hash of the block |
{- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "block_time": 1594233639,
- "block_time_iso": "2020-08-27T16:41:26.000Z",
- "index_block_hash": "0x918697ef63f9d8bdf844c3312b299e72a231cde542f3173f7755bb8c1cdaf3a7",
- "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"
], - "execution_cost_read_count": 2477,
- "execution_cost_read_length": 1659409,
- "execution_cost_runtime": 2520952000,
- "execution_cost_write_count": 608,
- "execution_cost_write_length": 80170,
- "microblock_tx_count": {
- "0xce0b1a4099d3fc7d5885cc7a3baa952b6d999f9709d0683b98b843597208231c": 5,
- "0x4c0529b6448a5885991c5021bd869cc97f1692c128a98b382729dc962203c326": 6,
- "0x64968846291dfea1015228a9d4bbd60aac81378cd6774b810b08e59e6b0e7494": 9
}
}
NOTE: This endpoint is deprecated in favor of Get block.
Retrieves block details of a specific block at a given block height
height required | number Example: 10000 Height of the block |
{- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "block_time": 1594233639,
- "block_time_iso": "2020-08-27T16:41:26.000Z",
- "index_block_hash": "0x918697ef63f9d8bdf844c3312b299e72a231cde542f3173f7755bb8c1cdaf3a7",
- "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"
], - "execution_cost_read_count": 2477,
- "execution_cost_read_length": 1659409,
- "execution_cost_runtime": 2520952000,
- "execution_cost_write_count": 608,
- "execution_cost_write_length": 80170,
- "microblock_tx_count": {
- "0xce0b1a4099d3fc7d5885cc7a3baa952b6d999f9709d0683b98b843597208231c": 5,
- "0x4c0529b6448a5885991c5021bd869cc97f1692c128a98b382729dc962203c326": 6,
- "0x64968846291dfea1015228a9d4bbd60aac81378cd6774b810b08e59e6b0e7494": 9
}
}
NOTE: This endpoint is deprecated in favor of Get blocks.
Retrieves block details of a specific block for a given burnchain block hash
burn_block_hash required | string Example: 0x00000000000000000002bba732926cf68b6eda3e2cdbc2a85af79f10efeeeb10 Hash of the burnchain block |
{- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "block_time": 1594233639,
- "block_time_iso": "2020-08-27T16:41:26.000Z",
- "index_block_hash": "0x918697ef63f9d8bdf844c3312b299e72a231cde542f3173f7755bb8c1cdaf3a7",
- "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"
], - "execution_cost_read_count": 2477,
- "execution_cost_read_length": 1659409,
- "execution_cost_runtime": 2520952000,
- "execution_cost_write_count": 608,
- "execution_cost_write_length": 80170,
- "microblock_tx_count": {
- "0xce0b1a4099d3fc7d5885cc7a3baa952b6d999f9709d0683b98b843597208231c": 5,
- "0x4c0529b6448a5885991c5021bd869cc97f1692c128a98b382729dc962203c326": 6,
- "0x64968846291dfea1015228a9d4bbd60aac81378cd6774b810b08e59e6b0e7494": 9
}
}
NOTE: This endpoint is deprecated in favor of Get blocks.
Retrieves block details of a specific block for a given burn chain height
burn_block_height required | number Example: 744603 Height of the burn chain block |
{- "canonical": true,
- "height": 3275,
- "hash": "0xe77ba8cf6bb7c0e4f64adc83356289ed467d31a22354907b4bb814590058430f",
- "block_time": 1594233639,
- "block_time_iso": "2020-08-27T16:41:26.000Z",
- "index_block_hash": "0x918697ef63f9d8bdf844c3312b299e72a231cde542f3173f7755bb8c1cdaf3a7",
- "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"
], - "execution_cost_read_count": 2477,
- "execution_cost_read_length": 1659409,
- "execution_cost_runtime": 2520952000,
- "execution_cost_write_count": 608,
- "execution_cost_write_length": 80170,
- "microblock_tx_count": {
- "0xce0b1a4099d3fc7d5885cc7a3baa952b6d999f9709d0683b98b843597208231c": 5,
- "0x4c0529b6448a5885991c5021bd869cc97f1692c128a98b382729dc962203c326": 6,
- "0x64968846291dfea1015228a9d4bbd60aac81378cd6774b810b08e59e6b0e7494": 9
}
}
Retrieves a list of recent burn blocks
limit | integer <= 30 Default: 20 max number of burn blocks to fetch |
offset | integer Example: offset=42000 index of first burn block to fetch |
{- "limit": 1,
- "offset": 0,
- "total": 21707,
- "results": [
- {
- "burn_block_time": 1626281749,
- "burn_block_time_iso": "2021-07-14T16:55:49.000Z",
- "burn_block_hash": "0x0000000000000000000ea16f8e906e85ee1cb4dff1e5424e93843b3cec8b0bcb",
- "burn_block_height": 691014,
- "stacks_blocks": [
- "0x54647c277eefe60519b407f2c897749005fdb7f831034135063b2ee43fdacb04",
- "0xdaf61d2b355f35c94cf019af99aeb73d8e7db7301c7cd693a464ebd1cfc2228c",
- "0xb9e9b308cf9621ecbf66ca7b4689fe384b9b67c4588ec827d8163ab602fb935e",
- "0x754562cba6ec243f90485e97778ab472f462fd123ef5b83cc79d8759ca8875f5"
], - "avg_block_time": 15.3,
- "total_tx_count": 728
}
]
}
Retrieves a single burn block
required | integer or string filter by burn block height, hash, or the constant |
{- "burn_block_time": 1594233639,
- "burn_block_time_iso": "2020-08-27T16:41:26.000Z",
- "burn_block_hash": "0xb154c008df2101023a6d0d54986b3964cee58119eed14f5bed98e15678e18fe2",
- "burn_block_height": 654439,
- "stacks_blocks": [
- "0x54647c277eefe60519b407f2c897749005fdb7f831034135063b2ee43fdacb04",
- "0xdaf61d2b355f35c94cf019af99aeb73d8e7db7301c7cd693a464ebd1cfc2228c",
- "0xb9e9b308cf9621ecbf66ca7b4689fe384b9b67c4588ec827d8163ab602fb935e",
- "0x754562cba6ec243f90485e97778ab472f462fd123ef5b83cc79d8759ca8875f5"
], - "avg_block_time": 15.3,
- "total_tx_count": 728
}
Add 500 STX tokens to the specified testnet address. Testnet STX addresses begin with ST
. If the stacking
parameter is set to true
, the faucet will add the required number of tokens for individual stacking to the
specified testnet address.
The endpoint returns the transaction ID, which you can use to view the transaction in the Stacks Explorer. The tokens are delivered once the transaction has been included in an anchor block.
A common reason for failed faucet transactions is that the faucet has run out of tokens. If you are experiencing failed faucet transactions to a testnet address, you can get help in Discord.
Note: This is a testnet only endpoint. This endpoint will not work on the mainnet.
address required | string Example: address=ST3M7N9Q9HDRM7RVP1Q26P0EE69358PZZAZD7KMXQ A valid testnet STX address |
stacking | boolean Default: false Request the amount of STX tokens needed for individual address stacking |
{- "success": true,
- "txId": "0xf2f0402f9f4c4d43b382690c4f7b97e24d5ff5dd5c619e3615daa64dca7ef4bc",
- "txRaw": "80800000000400164247d6f2b425ac5771423ae6c80c754f7172b0000000000000003200000000000000b400008537046ff1008368baaa3ff2235122c556b89dad4f9df0639b924cf32a44b866497e49846b24191e711b21faaae96ca0542e4a140168484740b94211cececb3303020000000000051ab52c45b1a7977204f17ac0b6f48306aea2dbb8e9000000000007a12046617563657400000000000000000000000000000000000000000000000000000000"
}
Add 1 BTC token to the specified testnet BTC address.
The endpoint returns the transaction ID, which you can use to view the transaction in a testnet Bitcoin block explorer. The tokens are delivered once the transaction has been included in a block.
Note: This is a testnet only endpoint. This endpoint will not work on the mainnet.
address required | string Example: address=2N4M94S1ZPt8HfxydXzL2P7qyzgVq7MHWts A valid testnet BTC address |
address | string BTC testnet address |
{- "address": "2N4M94S1ZPt8HfxydXzL2P7qyzgVq7MHWts"
}
{- "success": true,
- "txId": "0xf2f0402f9f4c4d43b382690c4f7b97e24d5ff5dd5c619e3615daa64dca7ef4bc",
- "txRaw": "80800000000400164247d6f2b425ac5771423ae6c80c754f7172b0000000000000003200000000000000b400008537046ff1008368baaa3ff2235122c556b89dad4f9df0639b924cf32a44b866497e49846b24191e711b21faaae96ca0542e4a140168484740b94211cececb3303020000000000051ab52c45b1a7977204f17ac0b6f48306aea2dbb8e9000000000007a12046617563657400000000000000000000000000000000000000000000000000000000"
}
NOTE: This endpoint is deprecated in favor of Get approximate fees for a given transaction.
Retrieves estimated fee rate.
transaction required | string A serialized transaction |
{- "transaction": "0x5e9f3933e358df6a73fec0d47ce3e1062c20812c129f5294e6f37a8d27c051d9"
}
{- "fee_rate": 360
}
Get an estimated fee for the supplied transaction. This estimates the execution cost of the transaction, the current fee rate of the network, and returns estimates for fee amounts.
transaction_payload
is a hex-encoded serialization of
the TransactionPayload for the transaction.estimated_len
is an optional argument that provides the
endpoint with an estimation of the final length (in bytes)
of the transaction, including any post-conditions and
signaturesIf the node cannot provide an estimate for the transaction (e.g., if the node has never seen a contract-call for the given contract and function) or if estimation is not configured on this node, a 400 response is returned.
The 400 response will be a JSON error containing a reason
field which can be one of the following:
DatabaseError
- this Stacks node has had an internal
database error while trying to estimate the costs of the
supplied transaction.NoEstimateAvailable
- this Stacks node has not seen this
kind of contract-call before, and it cannot provide an
estimate yet.CostEstimationDisabled
- this Stacks node does not perform
fee or cost estimation, and it cannot respond on this
endpoint.The 200 response contains the following data:
estimated_cost
- the estimated multi-dimensional cost of
executing the Clarity VM on the provided transaction.estimated_cost_scalar
- a unitless integer that the Stacks
node uses to compare how much of the block limit is consumed
by different transactions. This value incorporates the
estimated length of the transaction and the estimated
execution cost of the transaction. The range of this integer
may vary between different Stacks nodes. In order to compute
an estimate of total fee amount for the transaction, this
value is multiplied by the same Stacks node's estimated fee
rate.cost_scalar_change_by_byte
- a float value that indicates how
much the estimated_cost_scalar
value would increase for every
additional byte in the final transaction.estimations
- an array of estimated fee rates and total fees to
pay in microSTX for the transaction. This array provides a range of
estimates (default: 3) that may be used. Each element of the array
contains the following fields:fee_rate
- the estimated value for the current fee
rates in the networkfee
- the estimated value for the total fee in
microSTX that the given transaction should pay. These
values are the result of computing:
fee_rate
x estimated_cost_scalar
.
If the estimated fees are less than the minimum relay
fee (1 ustx x estimated_len)
, then that minimum relay
fee will be returned here instead.Note: If the final transaction's byte size is larger than
supplied to estimated_len
, then applications should increase
this fee amount by:
fee_rate
x cost_scalar_change_by_byte
x (final_size
- estimated_size
)
transaction_payload required | string |
estimated_len | integer |
{- "estimated_len": 350,
- "transaction_payload": "021af942874ce525e87f21bbe8c121b12fac831d02f4086765742d696e666f0b7570646174652d696e666f00000000"
}
{- "cost_scalar_change_by_byte": 0.00476837158203125,
- "estimated_cost": {
- "read_count": 19,
- "read_length": 4814,
- "runtime": 7175000,
- "write_count": 2,
- "write_length": 1020
}, - "estimated_cost_scalar": 14,
- "estimations": [
- {
- "fee": 17,
- "fee_rate": 1.2410714285714286
}, - {
- "fee": 125,
- "fee_rate": 8.958333333333332
}, - {
- "fee": 140,
- "fee_rate": 10
}
]
}
Read-only endpoints to obtain network, Proof-of-Transfer, Stacking, STX token, and node information
{- "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
}
Retrieves the running status of the Stacks Blockchain API, including the server version and current chain tip information.
{- "server_version": "stacks-blockchain-api v1.0.7 (master:77b25878)",
- "status": "ready",
- "chain_tip": {
- "block_height": 48902,
- "block_hash": "0xa5a2923c405f8356925213bb8c479beb06d3b68ca66dd2b7397b54f8c08c5eac",
- "index_block_hash": "0xf46401bf3cb6a6b6181536b7de414a1fd9e004a6ece99a05de72a781b17f9819",
- "microblock_hash": "0xec89a572d3583b959e490bc45e0f521b775ed51d7ed13087b6df8eb82cbe75d3",
- "microblock_sequence": 0
}
}
Retrieves the target block times for mainnet and testnet. The block time is hardcoded and will change throughout the implementation phases of the testnet.
{- "testnet": {
- "target_block_time": 120
}, - "mainnet": {
- "target_block_time": 600
}
}
Retrieves the target block time for a given network. The network can be mainnet or testnet. The block time is hardcoded and will change throughout the implementation phases of the testnet.
network required | string Enum: "testnet" "mainnet" Example: mainnet the target block time for a given network (testnet, mainnet). |
{- "target_block_time": 600
}
Retrieves the total and unlocked STX supply. More information on Stacking can be found [here] (https://docs.stacks.co/understand-stacks/stacking). Note: This uses the estimated future total supply for the year 2050.
height | number Example: height=200 Supply details are queried from specified block height. If the block height is not specified, the latest block height is taken as default value. Note that the |
{- "unlocked_percent": "71.99",
- "total_stx": "1352464600.000000",
- "unlocked_stx": "973705260.219817",
- "block_height": 3210
}
Retrieves total supply of STX tokens including those currently in circulation that have been unlocked. Note: this uses the estimated future total supply for the year 2050.
height | number Example: height=200 Supply details are queried from specified block height. If the block height is not specified, the latest block height is taken as default value. |
{- "unlockedPercent": "71.99",
- "totalStacks": "1352464600.000000",
- "totalStacksFormatted": "1,352,464,600.000000",
- "unlockedSupply": "973705260.219817",
- "unlockedSupplyFormatted": "973,705,260.219817",
- "blockHeight": "665746"
}
Retrieves Proof-of-Transfer (PoX) information. Can be used for Stacking.
{- "contract_id": "SP000000000000000000002Q6VF78.pox",
- "pox_activation_threshold_ustx": 67694186237302,
- "first_burnchain_block_height": 666050,
- "prepare_phase_block_length": 100,
- "reward_phase_block_length": 2000,
- "reward_slots": 4000,
- "rejection_fraction": 25,
- "total_liquid_supply_ustx": 1353883724746042,
- "current_cycle": {
- "id": 50,
- "min_threshold_ustx": 100000000000,
- "stacked_ustx": 391056240478955,
- "is_pox_active": true
}, - "next_cycle": {
- "id": 51,
- "min_threshold_ustx": 90000000000,
- "min_increment_ustx": 67694186237,
- "stacked_ustx": 350473977597161,
- "prepare_phase_start_block_height": 773050,
- "blocks_until_prepare_phase": 227,
- "reward_phase_start_block_height": 773150,
- "blocks_until_reward_phase": 327,
- "ustx_until_pox_rejection": 338470931186500
}, - "min_amount_ustx": 90000000000,
- "prepare_cycle_length": 100,
- "reward_cycle_id": 50,
- "reward_cycle_length": 2100,
- "rejection_votes_left_required": 338470931186500,
- "next_reward_cycle_in": 327
}
Retrieves a list of microblocks.
If you need to actively monitor new microblocks, we highly recommend subscribing to WebSockets or Socket.io for real-time updates.
limit | integer <= 200 Default: 20 Example: limit=100 Max number of microblocks to fetch |
offset | integer Example: offset=42000 Index of the first microblock to fetch |
{- "limit": 30,
- "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"
]
}
]
}
Retrieves a specific microblock by hash
hash required | string Example: 0x3bfcdf84b3012adb544cf0f6df4835f93418c2269a3881885e27b3d58eb82d47 Hash of the microblock |
{- "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"
]
}
Retrieves transactions that have been streamed in microblocks but not yet accepted or rejected in an anchor block
{- "total": 0,
- "results": [
- {
- "tx_id": "string",
- "nonce": 0,
- "fee_rate": "string",
- "sender_address": "string",
- "sponsor_nonce": 0,
- "sponsored": true,
- "sponsor_address": "string",
- "post_condition_mode": "allow",
- "post_conditions": [
- {
- "principal": {
- "type_id": "principal_origin"
}, - "condition_code": "sent_equal_to",
- "amount": "string",
- "type": "stx"
}
], - "anchor_mode": "on_chain_only",
- "block_hash": "string",
- "block_height": 0,
- "block_time": 0,
- "block_time_iso": "string",
- "burn_block_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"
}
}
]
}
Read-only endpoints realted to the Blockchain Naming System on Stacks
Retrieves the price of a namespace. The amount
given will be in the smallest possible units of the currency.
tld required | string Example: id the namespace to fetch price for |
{- "units": "string",
- "amount": "string"
}
Retrieves the price of a name. The amount
given will be in the smallest possible units of the currency.
name required | string Example: muneeb.id the name to query price information for |
{- "units": "string",
- "amount": "string"
}
Retrieves a list of names within a given namespace.
tld required | string Example: id the namespace to fetch names from. |
page | integer Example: page=22 namespace values are defaulted to page 1 with 100 results. You can query specific page results by using the 'page' query parameter. |
[- "aldenquimby.id",
- "aldeoryn.id",
- "alderete.id",
- "aldert.id",
- "aldi.id",
- "aldighieri.id"
]
Retrieves a list of all names known to the node.
page | integer Example: page=22 names are defaulted to page 1 with 100 results. You can query specific page results by using the 'page' query parameter. |
[- "aldenquimby.id",
- "aldeoryn.id",
- "alderete.id",
- "aldert.id",
- "aldi.id",
- "aldighieri.id"
]
Retrieves details of a given name including the address
, status
and last transaction id - last_txid
.
name required | string Example: muneeb.id fully-qualified name |
{- "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"
}
Retrieves the list of subdomains for a specific name
name required | string Example: id.blockstack fully-qualified name |
[- "address_test.id.blockstack",
- "previous_subdomain.id.blockstack",
- "subdomain.id.blockstack",
- "zonefile_test.id.blockstack",
- "zone_test.id.blockstack"
]
Retrieves 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.
name required | string Example: bar.test fully-qualified name |
{- "zonefile": "$ORIGIN bar.test\n$TTL 3600\n_https._tcp URI 10 1 \"https://gaia.blockstack.org/hub/17Zijx61Sp7SbVfRTdETo7PhizJHYEUxbY/profile.json\"\n"
}
Retrieves the historical zonefile specified by the username and zone hash.
name required | string Example: muneeb.id fully-qualified name |
zoneFileHash required | string Example: b100a68235244b012854a95f9114695679002af9 zone file hash |
{- "title": "BnsFetchHistoricalZoneFileResponse",
- "description": "Fetches the historical zonefile specified by the username and zone hash.",
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "zonefile": {
- "type": "string"
}
}
}, - {
- "type": "object",
- "properties": {
- "error": {
- "type": "string"
}
}
}
]
}
Retrieves a list of names owned by the address provided.
blockchain required | string Example: bitcoin the layer-1 blockchain for the address |
address required | string Example: 1QJQxDas5JhdiXhEbNS14iNjr8auFT96GP the address to lookup |
{- "names": [
- "muneeb.id"
]
}
Read-only endpoints to obtain non-fungible token details
Retrieves the list of Non-Fungible Tokens owned by the given principal (STX address or Smart Contract ID). Results can be filtered by one or more asset identifiers and can include metadata about the transaction that made the principal own each token.
More information on Non-Fungible Tokens on the Stacks blockchain can be found here.
principal required | string Example: principal=SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.marketplace-v3 token owner's STX address or Smart Contract ID |
asset_identifiers | Array of strings Example: asset_identifiers=SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy::candy identifiers of the token asset classes to filter for |
limit | integer Default: 50 max number of tokens to fetch |
offset | integer Default: 0 Example: offset=42000 index of first tokens to fetch |
unanchored | boolean Default: false Example: unanchored=true whether or not to include tokens from unconfirmed transactions |
tx_metadata | boolean Default: false whether or not to include the complete transaction metadata instead of just |
{- "limit": 50,
- "offset": 0,
- "total": 3,
- "results": [
- {
- "asset_identifier": "SP2X0TZ59D5SZ8ACQ6YMCHHNR2ZN51Z32E2CJ173.the-explorer-guild::The-Explorer-Guild",
- "value": {
- "hex": "0x0100000000000000000000000000000803",
- "repr": "u2051"
}, - "block_height": 36442,
- "tx_id": "0x12e6f88724d0e630de26c376f172cf1781e25435e2b4ee54d36a949b244e429c"
}, - {
- "asset_identifier": "SP2BE8TZATXEVPGZ8HAFZYE5GKZ02X0YDKAN7ZTGW.arties::arties",
- "value": {
- "hex": "0x01000000000000000000000000000004f3",
- "repr": "u1267"
}, - "block_height": 37477,
- "tx_id": "0xddc464c5e20a78dc5ac351913e0d9b9cce76fc955cc4599e0cccad960998f130"
}, - {
- "asset_identifier": "SP000000000000000000002Q6VF78.bns::names",
- "value": {
- "hex": "0x0c00000002046e616d65020000000672616661656c096e616d6573706163650200000003627463",
- "repr": "(tuple (name 0x72616661656c) (namespace 0x627463))"
}, - "block_height": 17250,
- "tx_id": "0x0153a41ed24a0e1d32f66ea98338df09f942571ca66359e28bdca79ccd0305cf"
}
]
}
Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset.
More information on Non-Fungible Tokens on the Stacks blockchain can be found here.
asset_identifier required | string Example: asset_identifier=SP2X0TZ59D5SZ8ACQ6YMCHHNR2ZN51Z32E2CJ173.the-explorer-guild::The-Explorer-Guild token asset class identifier |
value required | string Example: value=0x0100000000000000000000000000000803 hex representation of the token's unique value |
limit | integer Default: 50 max number of events to fetch |
offset | integer Default: 0 Example: offset=42000 index of first event to fetch |
unanchored | boolean Default: false Example: unanchored=true whether or not to include events from unconfirmed transactions |
tx_metadata | boolean Default: false whether or not to include the complete transaction metadata instead of just |
{- "limit": 50,
- "offset": 0,
- "total": 2,
- "results": [
- {
- "sender": "SPZGN4KG2AKNNPEWVXXB6EWN1W9WV1JWMGBVVNK3",
- "recipient": "SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.marketplace-v4",
- "event_index": 0,
- "asset_event_type": "transfer",
- "tx_id": "0x4510e6cff6414747f402126b92e35d90165f9f5e1f2750f50ed2b8e052b25108"
}, - {
- "sender": null,
- "recipient": "SPZGN4KG2AKNNPEWVXXB6EWN1W9WV1JWMGBVVNK3",
- "event_index": 1,
- "asset_event_type": "mint",
- "tx_id": "0x3ab1ac33ba0a4fb473ee5a2e9d73208a7aceef2d40fea283e3126bda61524ad0"
}
]
}
Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed.
More information on Non-Fungible Tokens on the Stacks blockchain can be found here.
asset_identifier required | string Example: asset_identifier=SP2X0TZ59D5SZ8ACQ6YMCHHNR2ZN51Z32E2CJ173.the-explorer-guild::The-Explorer-Guild token asset class identifier |
limit | integer Default: 50 max number of events to fetch |
offset | integer Default: 0 Example: offset=42000 index of first event to fetch |
unanchored | boolean Default: false Example: unanchored=true whether or not to include events from unconfirmed transactions |
tx_metadata | boolean Default: false whether or not to include the complete transaction metadata instead of just |
{- "limit": 5,
- "offset": 0,
- "total": 2503,
- "results": [
- {
- "recipient": "SP25KJH4N4YNKTVXSWSHDPVCWDFAN2BA4H2VQVN0G",
- "event_index": 1,
- "value": {
- "hex": "0x01000000000000000000000000000009c7",
- "repr": "u2503"
}, - "tx_id": "0xd5c199447bc5f08d1821350455f4c103ad769976c7a6b745182782d53b5c7922"
}, - {
- "recipient": "SPZGN4KG2AKNNPEWVXXB6EWN1W9WV1JWMGBVVNK3",
- "event_index": 1,
- "value": {
- "hex": "0x01000000000000000000000000000009c5",
- "repr": "u2501"
}, - "tx_id": "0x3ab1ac33ba0a4fb473ee5a2e9d73208a7aceef2d40fea283e3126bda61524ad0"
}, - {
- "recipient": "SPYZ2K1ZTG8NGKNY8VCX8NDKCGCCE9WZT85AGQR",
- "event_index": 1,
- "value": {
- "hex": "0x01000000000000000000000000000009c6",
- "repr": "u2502"
}, - "tx_id": "0xaaff669db77380600b069fbd3ba481e5764e3672246f952bdd976cd3528019e8"
}, - {
- "recipient": "SP2EV985DXEHEB2FKW3Z642R0QWQGXTRDYXNRVCYY",
- "event_index": 1,
- "value": {
- "hex": "0x01000000000000000000000000000009b6",
- "repr": "u2486"
}, - "tx_id": "0xc416218ed09e2252888a620d89a5e8fdff43188c1c4ef46b6bbc4e1901609ef6"
}, - {
- "recipient": "SPP1VDQKF2H90QZVRBN0K6Z90EKES9NSMYKXHVGH",
- "event_index": 9,
- "value": {
- "hex": "0x01000000000000000000000000000009bb",
- "repr": "u2491"
}, - "tx_id": "0xbd272748e0d632f8122126f8b000fa0f84c96f464e6fb91b03bb8b9c5c12ed12"
}
]
}
Endpoints to support the Rosetta API open blockchain standard
Retrieves a list of NetworkIdentifiers that the Rosetta server supports.
{- "network_identifiers": [
- {
- "blockchain": "string",
- "network": "string",
- "sub_network_identifier": {
- "network": "string",
- "metadata": {
- "producer": "string"
}
}
}
]
}
Retrieves 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.
required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with. |
metadata | object |
[- {
- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "metadata": { }
}
]
{- "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
}
}
Retrieves the current status of the network requested. Any NetworkIdentifier returned by /network/list should be accessible here.
required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with. |
metadata | object |
[- {
- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "metadata": { }
}
]
{- "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": { }
}
], - "current_burn_block_height": 0
}
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.
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) or RosettaPartialBlockIdentifier (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. |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "account_identifier": {
- "address": "SP2W6477BT5CRWVC5D5RFNPNAR8R2NW63SMMCAWMC",
- "metadata": { }
}
}
{- "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
}
}
Retrieves the Block information for a given block identifier including a list of all transactions in the block.
required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with. |
required | RosettaBlockIdentifierHash (object) or RosettaBlockIdentifierHeight (object) or RosettaPartialBlockIdentifier (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. |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "block_identifier": {
- "index": 71107,
- "hash": "0xce7e16561150f3a379845f4e96c3dd8f8396e397495821c9eec6b429391c529c"
}
}
{- "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": {
- "burn_block_height": 0
}
}, - "other_transactions": [
- {
- "hash": "string"
}
]
}
Retrieves a Transaction included in a block that is not returned in a BlockResponse.
required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with. |
required | RosettaBlockIdentifierHash (object) or RosettaBlockIdentifierHeight (object) or RosettaPartialBlockIdentifier (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. |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "block_identifier": {
- "hash": "0xce7e16561150f3a379845f4e96c3dd8f8396e397495821c9eec6b429391c529c"
}, - "transaction_identifier": {
- "hash": "0x49354cc7b18dc5296c945a8e89f7d758dac14f1ab38d4c33dfe45ec1765ab339"
}
}
{- "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
}
}
}
Retrieves a list of transactions currently in the mempool for a given network.
required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with. |
metadata | object |
[- {
- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "metadata": { }
}
]
{- "transaction_identifiers": [
- {
- "hash": "string"
}
], - "metadata": { }
}
Retrieves transaction details from the mempool for a given transaction id from a given network.
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. |
{- "network_identifier": {
- "blockchain": "string",
- "network": "string",
- "sub_network_identifier": {
- "network": "string",
- "metadata": {
- "producer": "string"
}
}
}, - "transaction_identifier": {
- "hash": "string"
}
}
{- "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": { }
}
Retrieves the Account Identifier information based on a Public Key for a given network
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 |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "public_key": {
- "hex_bytes": "025c13b2fc2261956d8a4ad07d481b1a3b2cbf93a24f992249a61c3a1c4de79c51",
- "curve_type": "secp256k1"
}, - "metadata": { }
}
{- "address": "string",
- "account_identifier": {
- "address": "string",
- "sub_account": {
- "address": "string",
- "metadata": { }
}, - "metadata": { }
}, - "metadata": { }
}
Retrieves the network-specific transaction hash for a signed transaction.
required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with. |
signed_transaction required | string Signed transaction |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "signed_transaction": "0x80800000000400539886f96611ba3ba6cef9618f8c78118b37c5be000000000000000000000000000000b400017a33a91515ef48608a99c6adecd2eb258e11534a1acf66348f5678c8e2c8f83d243555ed67a0019d3500df98563ca31321c1a675b43ef79f146e322fe08df75103020000000000051a1ae3f911d8f1d46d7416bfbe4b593fd41eac19cb000000000007a12000000000000000000000000000000000000000000000000000000000000000000000"
}
{- "transaction_identifier": {
- "hash": "string"
}, - "metadata": { }
}
To Do
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) |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "options": {
- "sender_address": "SP3Y0BBCCCBFAMYCYN3F35CX9MH1J2GATP53JX3FA",
- "type": "stack_stx",
- "status": "success",
- "token_transfer_recipient_address": "string",
- "amount": "500000",
- "symbol": "STX",
- "decimals": 6,
- "gas_limit": 0,
- "gas_price": 0,
- "suggested_fee_multiplier": 0,
- "max_fee": "12380898",
- "fee": "fee",
- "size": 260,
- "memo": "test.memo",
- "number_of_cycles": 0,
- "contract_address": "SP112T7BYCNEDCZ9TCYXCXFNJG9WXX5Q5SG6DSBAM",
- "contract_name": "STX transfer",
- "burn_block_height": 0,
- "delegate_to": "cb3df38053d132895220b9ce471f6b676db5b9bf0b4adefb55f2118ece2478df01.STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
- "pox_addr": "1Xik14zRm29UsyS6DjhYg4iZeZqsDa8D3"
}, - "public_keys": [
- {
- "hex_bytes": "publicKey",
- "curve_type": "secp256k1"
}
]
}
{- "metadata": {
- "account_sequence": 0,
- "recent_block_hash": "string"
}, - "suggested_fee": [
- {
- "value": "string",
- "currency": {
- "symbol": "string",
- "decimals": 0,
- "metadata": { }
}, - "metadata": { }
}
]
}
TODO
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. |
{- "network_identifier": {
- "blockchain": "string",
- "network": "string",
- "sub_network_identifier": {
- "network": "string",
- "metadata": {
- "producer": "string"
}
}
}, - "signed": true,
- "transaction": "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": { }
}
], - "signers": [
- "string"
], - "account_identifier_signers": [
- {
- "address": "string",
- "sub_account": {
- "address": "string",
- "metadata": { }
}, - "metadata": { }
}
], - "metadata": { }
}
TODO
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). |
{- "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
}
{- "options": {
- "sender_address": "string",
- "type": "string",
- "status": "string",
- "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,
- "reward_cycle_id": 0,
- "delegate_to": "string",
- "pox_addr": "string",
- "signer_key": "string",
- "signer_private_key": "string",
- "signer_signature": "string",
- "pox_max_amount": "string",
- "pox_auth_id": "string"
}, - "required_public_keys": [
- {
- "address": "string",
- "sub_account": {
- "address": "string",
- "metadata": { }
}, - "metadata": { }
}
]
}
Submit a pre-signed transaction to the node. The examples below are illustrative only. You'll need to use your wallet to generate actual values to use them in the request payload.
required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with. |
signed_transaction required | string Signed transaction |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "signed_transaction": "0x80800000000400539886f96611ba3ba6cef9618f8c78118b37c5be000000000000000000000000000000b400017a33a91515ef48608a99c6adecd2eb258e11534a1acf66348f5678c8e2c8f83d243555ed67a0019d3500df98563ca31321c1a675b43ef79f146e322fe08df75103020000000000051a1ae3f911d8f1d46d7416bfbe4b593fd41eac19cb000000000007a12000000000000000000000000000000000000000000000000000000000000000000000"
}
{- "transaction_identifier": {
- "hash": "string"
}, - "metadata": { }
}
Generate an unsigned transaction from operations and metadata. The examples below are illustrative only. You'll need to use your wallet to generate actual values to use them in the request payload.
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 |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "operations": [
- {
- "operation_identifier": {
- "index": 0,
- "network_index": 0
}, - "related_operations": [
- {
- "index": 0,
- "network_index": 0
}
], - "type": "stack_stx",
- "status": "success",
- "account": {
- "address": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
- "metadata": { }
}
}
]
}
{- "unsigned_transaction": "string",
- "payloads": [
- {
- "address": "string",
- "account_identifier": {
- "address": "string",
- "sub_account": {
- "address": "string",
- "metadata": { }
}, - "metadata": { }
}, - "hex_bytes": "string",
- "signature_type": "ecdsa"
}
]
}
Take unsigned transaction and signature, combine both and return signed transaction. The examples below are illustrative only. You'll need to use your wallet to generate actual values to use them in the request payload.
required | object (NetworkIdentifier) The network_identifier specifies which network a particular object is associated with. |
unsigned_transaction required | string |
required | Array of objects (RosettaSignature) |
{- "network_identifier": {
- "blockchain": "stacks",
- "network": "mainnet"
}, - "unsigned_transaction": "00000000010400539886f96611ba3ba6cef9618f8c78118b37c5be0000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003020000000000051ab71a091b4b8b7661a661c620966ab6573bc2dcd3000000000007a12074657374207472616e73616374696f6e000000000000000000000000000000000000",
- "signatures": [
- {
- "signing_payload": {
- "address": "string",
- "account_identifier": {
- "address": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6",
- "metadata": { }
}, - "hex_bytes": "string",
- "signature_type": "ecdsa"
}, - "public_key": {
- "hex_bytes": "025c13b2fc2261956d8a4ad07d481b1a3b2cbf93a24f992249a61c3a1c4de79c51",
- "curve_type": "secp256k1"
}, - "signature_type": "ecdsa",
- "hex_bytes": "string"
}
]
}
{- "signed_transaction": "string"
}
Search blocks, transactions, contracts, or accounts by hash/ID
id required | string Example: 0xcf8b233f19f6c07d2dc1963302d2436efd36e9afac127bf6582824a13961c06d The hex hash string for a block or transaction, account address, or contract address |
include_metadata | boolean This includes the detailed data for purticular hash in the response |
{- "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"
}
}
}
Read-only endpoints to obtain Clarity smart contract details
Retrieves the deployment status of multiple smart contracts.
contract_id required | Array of strings Example: contract_id=SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy contract ids to fetch status for |
{- "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-bridged-v1-1": {
- "found": true,
- "result": {
- "contract_id": "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-bridged-v1-1",
- "status": "success",
- "tx_id": "0x8542d28e427256ea3c29dcd8793222891999ceff4ef1bb062e2f21cb6def6884",
- "block_height": 111021
}
}, - "SP1JTCR202ECC6333N7ZXD7MK7E3ZTEEE1MJ73C60.name-registrar": {
- "found": true,
- "result": {
- "contract_id": "SP1JTCR202ECC6333N7ZXD7MK7E3ZTEEE1MJ73C60.name-registrar",
- "status": "success",
- "tx_id": "0x6e1114cce8c6f2e9c8130f9acd75d67bb667ae584f882acdd2db6dd74e6cbe5e",
- "block_height": 113010
}
}, - "SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v1": {
- "found": true,
- "result": {
- "contract_id": "SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v1",
- "status": "pending",
- "tx_id": "0x10bdcf10ffee72994f493ac36760f4e95a76c8471370182fd4705c2153dc173d"
}
}, - "SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core": {
- "found": false
}
}
Retrieves details of a contract with a given contract_id
contract_id required | string Example: SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C.satoshibles Contract identifier formatted as |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
{- "tx_id": "0xb8b822f30a063fda8f9d44a23530a562a1ed93867d5977fbb12b1c284736edbb",
- "canonical": true,
- "contract_id": "SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.btc-ft-swap",
- "block_height": 23131,
- "source_code": "(use-trait fungible-token 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait) (define-constant expiry u100) (define-map swaps uint {sats: uint, btc-receiver: (buff 40), amount: uint, ft-receiver: (optional principal), ft-sender: principal, when: uint, done: uint, ft: principal}) (define-data-var next-id uint u0) (define-private (find-out (entry {scriptPubKey: (buff 128), value: (buff 8)}) (result {pubscriptkey: (buff 40), out: (optional {scriptPubKey: (buff 128), value: uint})})) (if (is-eq (get scriptPubKey entry) (get pubscriptkey result)) (merge result {out: (some {scriptPubKey: (get scriptPubKey entry), value: (get uint32 (unwrap-panic (contract-call? 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.clarity-bitcoin-lib-v1 read-uint32 {txbuff: (get value entry), index: u0})))})}) result)) (define-public (get-out-value (tx { version: (buff 4), ins: (list 8 {outpoint: {hash: (buff 32), index: (buff 4)}, scriptSig: (buff 256), sequence: (buff 4)}), outs: (list 8 {value: (buff 8), scriptPubKey: (buff 128)}), locktime: (buff 4)}) (pubscriptkey (buff 40))) (ok (fold find-out (get outs tx) {pubscriptkey: pubscriptkey, out: none}))) ;; create a swap between btc and fungible token (define-public (create-swap (sats uint) (btc-receiver (buff 40)) (amount uint) (ft-receiver (optional principal)) (ft <fungible-token>)) (let ((id (var-get next-id))) (asserts! (map-insert swaps id {sats: sats, btc-receiver: btc-receiver, amount: amount, ft-receiver: ft-receiver, ft-sender: tx-sender, when: block-height, done: u0, ft: (contract-of ft)}) ERR_INVALID_ID) (var-set next-id (+ id u1)) (match (contract-call? ft transfer amount tx-sender (as-contract tx-sender) (some 0x636174616d6172616e2073776170)) success (ok id) error (err (* error u1000))))) (define-public (set-ft-receiver (id uint)) (let ((swap (unwrap! (map-get? swaps id) ERR_INVALID_ID))) (if (is-none (get ft-receiver swap)) (begin (asserts! (map-set swaps id (merge swap {ft-receiver: (some tx-sender)})) ERR_NATIVE_FAILURE) (ok true)) ERR_ALREADY_DONE))) ;; any user can cancle the swap after the expiry period (define-public (cancel (id uint) (ft <fungible-token>)) (let ((swap (unwrap! (map-get? swaps id) ERR_INVALID_ID))) (asserts! (is-eq (contract-of ft) (get ft swap)) ERR_INVALID_FUNGIBLE_TOKEN) (asserts! (< (+ (get when swap) expiry) block-height) ERR_TOO_EARLY) (asserts! (is-eq (get done swap) u0) ERR_ALREADY_DONE) (asserts! (map-set swaps id (merge swap {done: u1})) ERR_NATIVE_FAILURE) (as-contract (contract-call? ft transfer (get amount swap) tx-sender (get ft-sender swap) (some 0x72657665727420636174616d6172616e2073776170))))) ;; any user can submit a tx that contains the swap (define-public (submit-swap (id uint) (block { version: (buff 4), parent: (buff 32), merkle-root: (buff 32), timestamp: (buff 4), nbits: (buff 4), nonce: (buff 4), height: uint }) (tx {version: (buff 4), ins: (list 8 {outpoint: {hash: (buff 32), index: (buff 4)}, scriptSig: (buff 256), sequence: (buff 4)}), outs: (list 8 {value: (buff 8), scriptPubKey: (buff 128)}), locktime: (buff 4)}) (proof { tx-index: uint, hashes: (list 12 (buff 32)), tree-depth: uint }) (ft <fungible-token>)) (let ((swap (unwrap! (map-get? swaps id) ERR_INVALID_ID)) (tx-buff (contract-call? 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.clarity-bitcoin-lib-v1 concat-tx tx))) (match (contract-call? 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.clarity-bitcoin-lib-v1 was-tx-mined block tx-buff proof) result (begin (asserts! result ERR_VERIFICATION_FAILED) (asserts! (is-eq (get done swap) u0) ERR_ALREADY_DONE) (match (get out (unwrap! (get-out-value tx (get btc-receiver swap)) ERR_NATIVE_FAILURE)) out (if (>= (get value out) (get sats swap)) (begin (asserts! (is-eq (contract-of ft) (get ft swap)) ERR_INVALID_FUNGIBLE_TOKEN) (asserts! (map-set swaps id (merge swap {done: u1})) ERR_NATIVE_FAILURE) (as-contract (contract-call? ft transfer (get amount swap) tx-sender (unwrap! (get ft-receiver swap) ERR_NO_FT_RECEIVER) (some 0x636174616d6172616e2073776170)))) ERR_TX_VALUE_TOO_SMALL) ERR_TX_NOT_FOR_RECEIVER)) error (err (* error u1000))))) (define-constant ERR_VERIFICATION_FAILED (err u1)) (define-constant ERR_FAILED_TO_PARSE_TX (err u2)) (define-constant ERR_INVALID_ID (err u3)) (define-constant ERR_TOO_EARLY (err u4)) (define-constant ERR_TX_VALUE_TOO_SMALL (err u5)) (define-constant ERR_TX_NOT_FOR_RECEIVER (err u6)) (define-constant ERR_ALREADY_DONE (err u7)) (define-constant ERR_INVALID_FUNGIBLE_TOKEN (err u8)) (define-constant ERR_NO_FT_RECEIVER (err u9)) (define-constant ERR_NATIVE_FAILURE (err u99)) ",
- "abi": "{\"maps\":[{\"key\":\"uint128\",\"name\":\"swaps\",\"value\":{\"tuple\":[{\"name\":\"amount\",\"type\":\"uint128\"},{\"name\":\"btc-receiver\",\"type\":{\"buffer\":{\"length\":40}}},{\"name\":\"done\",\"type\":\"uint128\"},{\"name\":\"ft\",\"type\":\"principal\"},{\"name\":\"ft-receiver\",\"type\":{\"optional\":\"principal\"}},{\"name\":\"ft-sender\",\"type\":\"principal\"},{\"name\":\"sats\",\"type\":\"uint128\"},{\"name\":\"when\",\"type\":\"uint128\"}]}}],\"functions\":[{\"args\":[{\"name\":\"entry\",\"type\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":{\"buffer\":{\"length\":8}}}]}},{\"name\":\"result\",\"type\":{\"tuple\":[{\"name\":\"out\",\"type\":{\"optional\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":\"uint128\"}]}}},{\"name\":\"pubscriptkey\",\"type\":{\"buffer\":{\"length\":40}}}]}}],\"name\":\"find-out\",\"access\":\"private\",\"outputs\":{\"type\":{\"tuple\":[{\"name\":\"out\",\"type\":{\"optional\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":\"uint128\"}]}}},{\"name\":\"pubscriptkey\",\"type\":{\"buffer\":{\"length\":40}}}]}}},{\"args\":[{\"name\":\"id\",\"type\":\"uint128\"},{\"name\":\"ft\",\"type\":\"trait_reference\"}],\"name\":\"cancel\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":\"bool\",\"error\":\"uint128\"}}}},{\"args\":[{\"name\":\"sats\",\"type\":\"uint128\"},{\"name\":\"btc-receiver\",\"type\":{\"buffer\":{\"length\":40}}},{\"name\":\"amount\",\"type\":\"uint128\"},{\"name\":\"ft-receiver\",\"type\":{\"optional\":\"principal\"}},{\"name\":\"ft\",\"type\":\"trait_reference\"}],\"name\":\"create-swap\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":\"uint128\",\"error\":\"uint128\"}}}},{\"args\":[{\"name\":\"tx\",\"type\":{\"tuple\":[{\"name\":\"ins\",\"type\":{\"list\":{\"type\":{\"tuple\":[{\"name\":\"outpoint\",\"type\":{\"tuple\":[{\"name\":\"hash\",\"type\":{\"buffer\":{\"length\":32}}},{\"name\":\"index\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"scriptSig\",\"type\":{\"buffer\":{\"length\":256}}},{\"name\":\"sequence\",\"type\":{\"buffer\":{\"length\":4}}}]},\"length\":8}}},{\"name\":\"locktime\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"outs\",\"type\":{\"list\":{\"type\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":{\"buffer\":{\"length\":8}}}]},\"length\":8}}},{\"name\":\"version\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"pubscriptkey\",\"type\":{\"buffer\":{\"length\":40}}}],\"name\":\"get-out-value\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":{\"tuple\":[{\"name\":\"out\",\"type\":{\"optional\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":\"uint128\"}]}}},{\"name\":\"pubscriptkey\",\"type\":{\"buffer\":{\"length\":40}}}]},\"error\":\"none\"}}}},{\"args\":[{\"name\":\"id\",\"type\":\"uint128\"}],\"name\":\"set-ft-receiver\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":\"bool\",\"error\":\"uint128\"}}}},{\"args\":[{\"name\":\"id\",\"type\":\"uint128\"},{\"name\":\"block\",\"type\":{\"tuple\":[{\"name\":\"height\",\"type\":\"uint128\"},{\"name\":\"merkle-root\",\"type\":{\"buffer\":{\"length\":32}}},{\"name\":\"nbits\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"nonce\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"parent\",\"type\":{\"buffer\":{\"length\":32}}},{\"name\":\"timestamp\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"version\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"tx\",\"type\":{\"tuple\":[{\"name\":\"ins\",\"type\":{\"list\":{\"type\":{\"tuple\":[{\"name\":\"outpoint\",\"type\":{\"tuple\":[{\"name\":\"hash\",\"type\":{\"buffer\":{\"length\":32}}},{\"name\":\"index\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"scriptSig\",\"type\":{\"buffer\":{\"length\":256}}},{\"name\":\"sequence\",\"type\":{\"buffer\":{\"length\":4}}}]},\"length\":8}}},{\"name\":\"locktime\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"outs\",\"type\":{\"list\":{\"type\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":{\"buffer\":{\"length\":8}}}]},\"length\":8}}},{\"name\":\"version\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"proof\",\"type\":{\"tuple\":[{\"name\":\"hashes\",\"type\":{\"list\":{\"type\":{\"buffer\":{\"length\":32}},\"length\":12}}},{\"name\":\"tree-depth\",\"type\":\"uint128\"},{\"name\":\"tx-index\",\"type\":\"uint128\"}]}},{\"name\":\"ft\",\"type\":\"trait_reference\"}],\"name\":\"submit-swap\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":\"bool\",\"error\":\"uint128\"}}}}],\"variables\":[{\"name\":\"ERR_ALREADY_DONE\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_FAILED_TO_PARSE_TX\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_INVALID_FUNGIBLE_TOKEN\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_INVALID_ID\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_NATIVE_FAILURE\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_NO_FT_RECEIVER\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_TOO_EARLY\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_TX_NOT_FOR_RECEIVER\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_TX_VALUE_TOO_SMALL\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_VERIFICATION_FAILED\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"expiry\",\"type\":\"uint128\",\"access\":\"constant\"},{\"name\":\"next-id\",\"type\":\"uint128\",\"access\":\"variable\"}],\"fungible_tokens\":[],\"non_fungible_tokens\":[]}"
}
Retrieves a list of contracts based on the following traits listed in JSON format - functions, variables, maps, fungible tokens and non-fungible tokens
trait_abi required | string JSON abi of the trait. |
limit | integer max number of contracts fetch |
offset | integer Example: offset=42000 index of first contract event to fetch |
{- "offset": 0,
- "limit": 10,
- "result": [
- {
- "tx_id": "0xb8b822f30a063fda8f9d44a23530a562a1ed93867d5977fbb12b1c284736edbb",
- "canonical": true,
- "contract_id": "SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.btc-ft-swap",
- "block_height": 23131,
- "source_code": "(use-trait fungible-token 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait) (define-constant expiry u100) (define-map swaps uint {sats: uint, btc-receiver: (buff 40), amount: uint, ft-receiver: (optional principal), ft-sender: principal, when: uint, done: uint, ft: principal}) (define-data-var next-id uint u0) (define-private (find-out (entry {scriptPubKey: (buff 128), value: (buff 8)}) (result {pubscriptkey: (buff 40), out: (optional {scriptPubKey: (buff 128), value: uint})})) (if (is-eq (get scriptPubKey entry) (get pubscriptkey result)) (merge result {out: (some {scriptPubKey: (get scriptPubKey entry), value: (get uint32 (unwrap-panic (contract-call? 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.clarity-bitcoin-lib-v1 read-uint32 {txbuff: (get value entry), index: u0})))})}) result)) (define-public (get-out-value (tx { version: (buff 4), ins: (list 8 {outpoint: {hash: (buff 32), index: (buff 4)}, scriptSig: (buff 256), sequence: (buff 4)}), outs: (list 8 {value: (buff 8), scriptPubKey: (buff 128)}), locktime: (buff 4)}) (pubscriptkey (buff 40))) (ok (fold find-out (get outs tx) {pubscriptkey: pubscriptkey, out: none}))) ;; create a swap between btc and fungible token (define-public (create-swap (sats uint) (btc-receiver (buff 40)) (amount uint) (ft-receiver (optional principal)) (ft <fungible-token>)) (let ((id (var-get next-id))) (asserts! (map-insert swaps id {sats: sats, btc-receiver: btc-receiver, amount: amount, ft-receiver: ft-receiver, ft-sender: tx-sender, when: block-height, done: u0, ft: (contract-of ft)}) ERR_INVALID_ID) (var-set next-id (+ id u1)) (match (contract-call? ft transfer amount tx-sender (as-contract tx-sender) (some 0x636174616d6172616e2073776170)) success (ok id) error (err (* error u1000))))) (define-public (set-ft-receiver (id uint)) (let ((swap (unwrap! (map-get? swaps id) ERR_INVALID_ID))) (if (is-none (get ft-receiver swap)) (begin (asserts! (map-set swaps id (merge swap {ft-receiver: (some tx-sender)})) ERR_NATIVE_FAILURE) (ok true)) ERR_ALREADY_DONE))) ;; any user can cancle the swap after the expiry period (define-public (cancel (id uint) (ft <fungible-token>)) (let ((swap (unwrap! (map-get? swaps id) ERR_INVALID_ID))) (asserts! (is-eq (contract-of ft) (get ft swap)) ERR_INVALID_FUNGIBLE_TOKEN) (asserts! (< (+ (get when swap) expiry) block-height) ERR_TOO_EARLY) (asserts! (is-eq (get done swap) u0) ERR_ALREADY_DONE) (asserts! (map-set swaps id (merge swap {done: u1})) ERR_NATIVE_FAILURE) (as-contract (contract-call? ft transfer (get amount swap) tx-sender (get ft-sender swap) (some 0x72657665727420636174616d6172616e2073776170))))) ;; any user can submit a tx that contains the swap (define-public (submit-swap (id uint) (block { version: (buff 4), parent: (buff 32), merkle-root: (buff 32), timestamp: (buff 4), nbits: (buff 4), nonce: (buff 4), height: uint }) (tx {version: (buff 4), ins: (list 8 {outpoint: {hash: (buff 32), index: (buff 4)}, scriptSig: (buff 256), sequence: (buff 4)}), outs: (list 8 {value: (buff 8), scriptPubKey: (buff 128)}), locktime: (buff 4)}) (proof { tx-index: uint, hashes: (list 12 (buff 32)), tree-depth: uint }) (ft <fungible-token>)) (let ((swap (unwrap! (map-get? swaps id) ERR_INVALID_ID)) (tx-buff (contract-call? 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.clarity-bitcoin-lib-v1 concat-tx tx))) (match (contract-call? 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.clarity-bitcoin-lib-v1 was-tx-mined block tx-buff proof) result (begin (asserts! result ERR_VERIFICATION_FAILED) (asserts! (is-eq (get done swap) u0) ERR_ALREADY_DONE) (match (get out (unwrap! (get-out-value tx (get btc-receiver swap)) ERR_NATIVE_FAILURE)) out (if (>= (get value out) (get sats swap)) (begin (asserts! (is-eq (contract-of ft) (get ft swap)) ERR_INVALID_FUNGIBLE_TOKEN) (asserts! (map-set swaps id (merge swap {done: u1})) ERR_NATIVE_FAILURE) (as-contract (contract-call? ft transfer (get amount swap) tx-sender (unwrap! (get ft-receiver swap) ERR_NO_FT_RECEIVER) (some 0x636174616d6172616e2073776170)))) ERR_TX_VALUE_TOO_SMALL) ERR_TX_NOT_FOR_RECEIVER)) error (err (* error u1000))))) (define-constant ERR_VERIFICATION_FAILED (err u1)) (define-constant ERR_FAILED_TO_PARSE_TX (err u2)) (define-constant ERR_INVALID_ID (err u3)) (define-constant ERR_TOO_EARLY (err u4)) (define-constant ERR_TX_VALUE_TOO_SMALL (err u5)) (define-constant ERR_TX_NOT_FOR_RECEIVER (err u6)) (define-constant ERR_ALREADY_DONE (err u7)) (define-constant ERR_INVALID_FUNGIBLE_TOKEN (err u8)) (define-constant ERR_NO_FT_RECEIVER (err u9)) (define-constant ERR_NATIVE_FAILURE (err u99)) ",
- "abi": "{\"maps\":[{\"key\":\"uint128\",\"name\":\"swaps\",\"value\":{\"tuple\":[{\"name\":\"amount\",\"type\":\"uint128\"},{\"name\":\"btc-receiver\",\"type\":{\"buffer\":{\"length\":40}}},{\"name\":\"done\",\"type\":\"uint128\"},{\"name\":\"ft\",\"type\":\"principal\"},{\"name\":\"ft-receiver\",\"type\":{\"optional\":\"principal\"}},{\"name\":\"ft-sender\",\"type\":\"principal\"},{\"name\":\"sats\",\"type\":\"uint128\"},{\"name\":\"when\",\"type\":\"uint128\"}]}}],\"functions\":[{\"args\":[{\"name\":\"entry\",\"type\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":{\"buffer\":{\"length\":8}}}]}},{\"name\":\"result\",\"type\":{\"tuple\":[{\"name\":\"out\",\"type\":{\"optional\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":\"uint128\"}]}}},{\"name\":\"pubscriptkey\",\"type\":{\"buffer\":{\"length\":40}}}]}}],\"name\":\"find-out\",\"access\":\"private\",\"outputs\":{\"type\":{\"tuple\":[{\"name\":\"out\",\"type\":{\"optional\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":\"uint128\"}]}}},{\"name\":\"pubscriptkey\",\"type\":{\"buffer\":{\"length\":40}}}]}}},{\"args\":[{\"name\":\"id\",\"type\":\"uint128\"},{\"name\":\"ft\",\"type\":\"trait_reference\"}],\"name\":\"cancel\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":\"bool\",\"error\":\"uint128\"}}}},{\"args\":[{\"name\":\"sats\",\"type\":\"uint128\"},{\"name\":\"btc-receiver\",\"type\":{\"buffer\":{\"length\":40}}},{\"name\":\"amount\",\"type\":\"uint128\"},{\"name\":\"ft-receiver\",\"type\":{\"optional\":\"principal\"}},{\"name\":\"ft\",\"type\":\"trait_reference\"}],\"name\":\"create-swap\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":\"uint128\",\"error\":\"uint128\"}}}},{\"args\":[{\"name\":\"tx\",\"type\":{\"tuple\":[{\"name\":\"ins\",\"type\":{\"list\":{\"type\":{\"tuple\":[{\"name\":\"outpoint\",\"type\":{\"tuple\":[{\"name\":\"hash\",\"type\":{\"buffer\":{\"length\":32}}},{\"name\":\"index\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"scriptSig\",\"type\":{\"buffer\":{\"length\":256}}},{\"name\":\"sequence\",\"type\":{\"buffer\":{\"length\":4}}}]},\"length\":8}}},{\"name\":\"locktime\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"outs\",\"type\":{\"list\":{\"type\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":{\"buffer\":{\"length\":8}}}]},\"length\":8}}},{\"name\":\"version\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"pubscriptkey\",\"type\":{\"buffer\":{\"length\":40}}}],\"name\":\"get-out-value\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":{\"tuple\":[{\"name\":\"out\",\"type\":{\"optional\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":\"uint128\"}]}}},{\"name\":\"pubscriptkey\",\"type\":{\"buffer\":{\"length\":40}}}]},\"error\":\"none\"}}}},{\"args\":[{\"name\":\"id\",\"type\":\"uint128\"}],\"name\":\"set-ft-receiver\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":\"bool\",\"error\":\"uint128\"}}}},{\"args\":[{\"name\":\"id\",\"type\":\"uint128\"},{\"name\":\"block\",\"type\":{\"tuple\":[{\"name\":\"height\",\"type\":\"uint128\"},{\"name\":\"merkle-root\",\"type\":{\"buffer\":{\"length\":32}}},{\"name\":\"nbits\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"nonce\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"parent\",\"type\":{\"buffer\":{\"length\":32}}},{\"name\":\"timestamp\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"version\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"tx\",\"type\":{\"tuple\":[{\"name\":\"ins\",\"type\":{\"list\":{\"type\":{\"tuple\":[{\"name\":\"outpoint\",\"type\":{\"tuple\":[{\"name\":\"hash\",\"type\":{\"buffer\":{\"length\":32}}},{\"name\":\"index\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"scriptSig\",\"type\":{\"buffer\":{\"length\":256}}},{\"name\":\"sequence\",\"type\":{\"buffer\":{\"length\":4}}}]},\"length\":8}}},{\"name\":\"locktime\",\"type\":{\"buffer\":{\"length\":4}}},{\"name\":\"outs\",\"type\":{\"list\":{\"type\":{\"tuple\":[{\"name\":\"scriptPubKey\",\"type\":{\"buffer\":{\"length\":128}}},{\"name\":\"value\",\"type\":{\"buffer\":{\"length\":8}}}]},\"length\":8}}},{\"name\":\"version\",\"type\":{\"buffer\":{\"length\":4}}}]}},{\"name\":\"proof\",\"type\":{\"tuple\":[{\"name\":\"hashes\",\"type\":{\"list\":{\"type\":{\"buffer\":{\"length\":32}},\"length\":12}}},{\"name\":\"tree-depth\",\"type\":\"uint128\"},{\"name\":\"tx-index\",\"type\":\"uint128\"}]}},{\"name\":\"ft\",\"type\":\"trait_reference\"}],\"name\":\"submit-swap\",\"access\":\"public\",\"outputs\":{\"type\":{\"response\":{\"ok\":\"bool\",\"error\":\"uint128\"}}}}],\"variables\":[{\"name\":\"ERR_ALREADY_DONE\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_FAILED_TO_PARSE_TX\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_INVALID_FUNGIBLE_TOKEN\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_INVALID_ID\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_NATIVE_FAILURE\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_NO_FT_RECEIVER\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_TOO_EARLY\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_TX_NOT_FOR_RECEIVER\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_TX_VALUE_TOO_SMALL\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"ERR_VERIFICATION_FAILED\",\"type\":{\"response\":{\"ok\":\"none\",\"error\":\"uint128\"}},\"access\":\"constant\"},{\"name\":\"expiry\",\"type\":\"uint128\",\"access\":\"constant\"},{\"name\":\"next-id\",\"type\":\"uint128\",\"access\":\"variable\"}],\"fungible_tokens\":[],\"non_fungible_tokens\":[]}"
}
]
}
Retrieves a list of events that have been triggered by a given contract_id
contract_id required | string Example: SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C.satoshibles Contract identifier formatted as |
limit | integer max number of contract events to fetch |
offset | integer Example: offset=42000 index of first contract event to fetch |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
{- "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\""
}
}
}
]
}
Retrieves a contract interface with a given contract_address
and contract name
contract_address required | string Example: SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C Stacks address |
contract_name required | string Example: satoshibles Contract name |
tip | string The Stacks chain tip to query from |
{- "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"
}
]
}
Attempt to fetch data from a contract data map. The contract is identified with Stacks Address contract_address
and Contract Name contract_address
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.
contract_address required | string Example: SPSCWDV3RKV5ZRN1FQD84YE1NQFEDJ9R1F4DYQ11 Stacks address |
contract_name required | string Example: newyorkcitycoin-core-v2 Contract name |
map_name required | string Example: approved-contracts Map name |
proof | integer Returns object without the proof field when set to 0 |
tip | string The Stacks chain tip to query from |
Hex string serialization of the lookup key (which should be a Clarity value)
"0x0100000000000000000000000000000095"
{- "data": "0x0a0c000000010a6d6f6e737465722d69640100000000000000000000000000000001",
- "proof": "0x123..."
}
Retrieves the Clarity source code of a given contract, along with the block height it was published in, and the MARF proof for the data
contract_address required | string Example: SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C Stacks address |
contract_name required | string Example: satoshibles Contract name |
proof | integer Returns object without the proof field if set to 0 |
tip | string The Stacks chain tip to query from |
{- "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 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:
contract_address required | string Example: SP187Y7NRSG3T9Z9WTSWNEN3XRV1YSJWS81C7JKV7 Stacks address |
contract_name required | string Example: imaginary-friends-zebras Contract name |
function_name required | string Example: get-token-uri Function name |
tip | string The Stacks chain tip to query from |
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 |
{- "sender": "STM9EQRAB3QAKF8NKTP15WJT7VHH4EWG3DJB4W29",
- "arguments": [
- "0x0100000000000000000000000000000095"
]
}
{- "okay": true,
- "result": "0x111..."
}
Read-only endpoints to obtain Stacking reward details
Retrieves a list of the Bitcoin addresses that would validly receive Proof-of-Transfer commitments.
limit | integer <= 250 Default: 96 max number of items to fetch |
offset | integer Example: offset=42000 index of the first items to fetch |
{- "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
}
]
}
Retrieves a list of the Bitcoin addresses that would validly receive Proof-of-Transfer commitments for a given reward slot holder recipient address.
address required | string Example: 36hQtSEXBMevo5chpxhfAGiCTSC34QKgda 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 |
limit | integer max number of items to fetch |
offset | integer Example: offset=42000 index of the first items to fetch |
{- "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
}
]
}
Retrieves a list of recent burnchain (e.g. Bitcoin) reward recipients with the associated amounts and block info
limit | integer <= 250 Default: 96 max number of rewards to fetch |
offset | integer Example: offset=42000 index of first rewards to fetch |
{- "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
}
]
}
Retrieves a list of recent burnchain (e.g. Bitcoin) rewards for the given recipient with the associated amounts and block info
address required | string Example: 36hQtSEXBMevo5chpxhfAGiCTSC34QKgda 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 |
limit | integer max number of rewards to fetch |
offset | integer Example: offset=42000 index of first rewards to fetch |
{- "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
}
]
}
Retrieves the total burnchain (e.g. Bitcoin) rewards for a given recipient address
address required | string Example: 36hQtSEXBMevo5chpxhfAGiCTSC34QKgda 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 |
{- "reward_recipient": "1C56LYirKa3PFXFsvhSESgDy2acEHVAEt6",
- "reward_amount": "18000"
}
Endpoints to obtain transaction details and to broadcast transactions to the network
Retrieves 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';
limit | integer <= 200 Default: 96 Example: limit=100 max number of transactions to fetch |
offset | integer Example: offset=42000 index of first transaction to fetch |
type | Array of strings Items Enum: "coinbase" "token_transfer" "smart_contract" "contract_call" "poison_microblock" "tenure_change" Example: type=coinbase Filter by transaction type |
from_address | string Option to filter results by sender address |
to_address | string Option to filter results by recipient address |
sort_by | string Default: "block_height" Enum: "block_height" "burn_block_time" "fee" Example: sort_by=burn_block_time Option to sort results by block height, timestamp, or fee |
start_time | integer Example: start_time=1704067200 Filter by transactions after this timestamp (unix timestamp in seconds) |
end_time | integer Example: end_time=1706745599 Filter by transactions before this timestamp (unix timestamp in seconds) |
contract_id | string Example: contract_id=SP000000000000000000002Q6VF78.pox-4 Filter by contract call transactions involving this contract ID |
function_name | string Example: function_name=delegate-stx Filter by contract call transactions involving this function name |
order | string Default: "desc" Enum: "asc" "desc" Example: order=desc Option to sort results in ascending or descending order |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
{- "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_height": 51396,
- "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"
}
}
]
}
Retrieves all transactions that have been recently broadcast to the mempool. These are pending transactions awaiting confirmation.
If you need to monitor new transactions, we highly recommend subscribing to WebSockets or Socket.io for real-time updates.
sender_address | string Example: sender_address=SP1GPBP8NBRXDRJBFQBV7KMAZX1Z7W2RFWJEH0V10 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). |
order_by | string Enum: "age" "size" "fee" Example: order_by=fee Option to sort results by transaction age, size, or fee rate. |
order | string Enum: "asc" "desc" Example: order=asc Option to sort results in ascending or descending order. |
limit | integer <= 50 Default: 20 Example: limit=20 max number of mempool transactions to fetch |
offset | integer Example: offset=42000 index of first mempool transaction to fetch |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
{- "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)))"
}
]
}
}
]
}
Retrieves all recently-broadcast transactions that have been dropped from the mempool.
Transactions are dropped from the mempool if:
limit | integer <= 200 Default: 96 max number of mempool transactions to fetch |
offset | integer Example: offset=42000 index of first mempool transaction to fetch |
{- "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)))"
}
]
}
}
]
}
Queries for transactions counts, age (by block height), fees (simple average), and size. All results broken down by transaction type and percentiles (p25, p50, p75, p95).
{- "tx_type_counts": {
- "token_transfer": 130,
- "smart_contract": 2,
- "contract_call": 310,
- "poison_microblock": 0
}, - "tx_simple_fee_averages": {
- "token_transfer": {
- "p25": 3000,
- "p50": 3000,
- "p75": 6000,
- "p95": 401199.9999999995
}, - "smart_contract": {
- "p25": 837500,
- "p50": 925000,
- "p75": 1012500,
- "p95": 1082500
}, - "contract_call": {
- "p25": 3000,
- "p50": 10368,
- "p75": 100000,
- "p95": 1000000
}, - "poison_microblock": {
- "p25": null,
- "p50": null,
- "p75": null,
- "p95": null
}
}, - "tx_ages": {
- "token_transfer": {
- "p25": 167.5,
- "p50": 45,
- "p75": 1,
- "p95": 0
}, - "smart_contract": {
- "p25": 185.5,
- "p50": 129,
- "p75": 72.5,
- "p95": 27.30000000000001
}, - "contract_call": {
- "p25": 189,
- "p50": 127.5,
- "p75": 9.5,
- "p95": 0
}, - "poison_microblock": {
- "p25": null,
- "p50": null,
- "p75": null,
- "p95": null
}
}, - "tx_byte_sizes": {
- "token_transfer": {
- "p25": 180,
- "p50": 180,
- "p75": 180,
- "p95": 180
}, - "smart_contract": {
- "p25": 706.75,
- "p50": 814.5,
- "p75": 922.25,
- "p95": 1008.45
}, - "contract_call": {
- "p25": 291,
- "p50": 435,
- "p75": 462,
- "p95": 597
}, - "poison_microblock": {
- "p25": null,
- "p50": null,
- "p75": null,
- "p95": null
}
}
}
Retrieves a list of transactions for a given list of transaction IDs
If using TypeScript, import typings for this response from our types package:
import type { Transaction } from '@stacks/stacks-blockchain-api-types';
tx_id required | Array of strings Example: tx_id=0x0a411719e3bfde95f9e227a2d7f8fac3d6c646b1e6cc186db0e2838a2c6cd9c0&tx_id=0xfbe6412b46e9db87df991a0d043ff47eb58019f770208cf48e2380337cc31785&tx_id=0x178b77678a758d9f29a147d6399315c83d0f1baf114431fbe4d3587aa5fbba6f Array of transaction ids |
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 Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
{- "0x8911000000000000000000000000000000000000000000000000000000000000": {
- "found": true,
- "result": {
- "tx_id": "0x8911000000000000000000000000000000000000000000000000000000000000",
- "nonce": 0,
- "fee_rate": "1234",
- "sender_address": "sender-addr",
- "sponsored": true,
- "sponsor_address": "sponsor-addr",
- "post_condition_mode": "allow",
- "post_conditions": [ ],
- "anchor_mode": "any",
- "is_unanchored": false,
- "block_hash": "0x0123",
- "parent_block_hash": "0x5678",
- "block_height": 0,
- "burn_block_height": 69287,
- "burn_block_time": 39486,
- "burn_block_time_iso": "1970-01-01T10:58:06.000Z",
- "parent_burn_block_time": 1626122935,
- "parent_burn_block_time_iso": "2021-07-12T20:48:55.000Z",
- "canonical": true,
- "tx_index": 4,
- "tx_status": "success",
- "microblock_hash": "",
- "microblock_sequence": 2147483647,
- "microblock_canonical": true,
- "event_count": 0,
- "events": [ ],
- "execution_cost_read_count": 0,
- "execution_cost_read_length": 0,
- "execution_cost_runtime": 0,
- "execution_cost_write_count": 0,
- "execution_cost_write_length": 0,
- "tx_type": "coinbase"
}
}, - "0x8915000000000000000000000000000000000000000000000000000000000000": {
- "found": true,
- "result": {
- "tx_id": "0x8915000000000000000000000000000000000000000000000000000000000000",
- "nonce": 1000,
- "fee_rate": "1234",
- "sender_address": "sender-addr",
- "sponsored": true,
- "sponsor_address": "sponsor-addr",
- "post_condition_mode": "allow",
- "post_conditions": [ ],
- "anchor_mode": "any",
- "is_unanchored": false,
- "block_hash": "0x0123",
- "parent_block_hash": "0x5678",
- "block_height": 0,
- "burn_block_height": 69287,
- "burn_block_time": 39486,
- "burn_block_time_iso": "1970-01-01T10:58:06.000Z",
- "parent_burn_block_time": 1626122935,
- "parent_burn_block_time_iso": "2021-07-12T20:48:55.000Z",
- "canonical": true,
- "tx_index": 4,
- "tx_status": "success",
- "microblock_hash": "",
- "microblock_sequence": 2147483647,
- "microblock_canonical": true,
- "event_count": 0,
- "events": [ ],
- "execution_cost_read_count": 0,
- "execution_cost_read_length": 0,
- "execution_cost_runtime": 0,
- "execution_cost_write_count": 0,
- "execution_cost_write_length": 0,
- "tx_type": "coinbase"
}
}, - "0x8912000000000000000000000000000000000000000000000000000000000000": {
- "found": true,
- "result": {
- "tx_id": "0x8912000000000000000000000000000000000000000000000000000000000000",
- "nonce": 0,
- "fee_rate": "1234",
- "sender_address": "sender-addr",
- "sponsored": false,
- "post_condition_mode": "allow",
- "post_conditions": [ ],
- "anchor_mode": "any",
- "tx_status": "pending",
- "receipt_time": 1594307695,
- "receipt_time_iso": "2020-07-09T15:14:55.000Z",
- "tx_type": "coinbase"
}
}, - "0x8914000000000000000000000000000000000000000000000000000000000000": {
- "found": false,
- "result": {
- "tx_id": "0x8914000000000000000000000000000000000000000000000000000000000000"
}
}
}
Retrieves transaction details for a given transaction ID
import type { Transaction } from '@stacks/stacks-blockchain-api-types';
tx_id required | string Example: 0x0a411719e3bfde95f9e227a2d7f8fac3d6c646b1e6cc186db0e2838a2c6cd9c0 Hash of transaction |
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 Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
{- "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"
}
}
Broadcasts raw transactions on the network. You can use the @stacks/transactions project to generate a raw transaction payload.
{- "error": "transaction rejected",
- "reason": "BadNonce",
- "reason_data": {
- "actual": 4,
- "expected": 0,
- "is_origin": true,
- "principal": "ST2ZRX0K27GW0SP3GJCEMHD95TQGJMKB7G9Y0X1MH"
}, - "txid": "caf6fd60ae05b0c2d19ef14ab6a7670b1095d117fa7c80224c74e76214d0a791"
}
Retrieves transactions confirmed in a single block
required | integer or string filter by block height, hash, index block hash or the constant |
{- "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_height": 51396,
- "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"
}
}
]
}
Retrieves a paginated list of confirmed transactions sent or received by a STX address or Smart Contract ID, alongside the total amount of STX sent or received and the number of STX, FT and NFT transfers contained within each transaction.
More information on Transaction types can be found here.
address required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 STX address or Smart Contract ID |
limit | integer Example: limit=20 Number of transactions to fetch |
offset | integer Example: offset=10 Index of first transaction to fetch |
{- "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",
- "events": {
- "stx": {
- "transfer": 2,
- "mint": 0,
- "burn": 0
}, - "ft": {
- "transfer": 1,
- "mint": 0,
- "burn": 0
}, - "nft": {
- "transfer": 1,
- "mint": 0,
- "burn": 0
}
}
}, - {
- "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",
- "events": {
- "stx": {
- "transfer": 1,
- "mint": 0,
- "burn": 0
}, - "ft": {
- "transfer": 0,
- "mint": 0,
- "burn": 0
}, - "nft": {
- "transfer": 0,
- "mint": 0,
- "burn": 0
}
}
}
]
}
Retrieves a paginated list of all STX, FT and NFT events concerning a STX address or Smart Contract ID within a specific transaction.
address required | string Example: SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 STX address or Smart Contract ID |
tx_id required | string Example: 0x0a411719e3bfde95f9e227a2d7f8fac3d6c646b1e6cc186db0e2838a2c6cd9c0 Transaction ID |
limit | integer Example: limit=20 Number of events to fetch |
offset | integer Example: offset=10 Index of first event to fetch |
{- "limit": 20,
- "offset": 0,
- "total": 4,
- "results": [
- {
- "type": "stx",
- "event_index": 0,
- "data": {
- "type": "transfer",
- "amount": "200",
- "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
- "recipient": "SP24Q9PK9DNTA2V89APY8WNBJ1QYKKSW9SWB04RJP"
}
}, - {
- "type": "stx",
- "event_index": 1,
- "data": {
- "type": "transfer",
- "amount": "150",
- "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
- "recipient": "SP26066SDPP4NXKGCVYZQDR5GX2QPE8KADZ0YK2J7"
}
}, - {
- "type": "ft",
- "event_index": 5,
- "data": {
- "type": "transfer",
- "amount": "103",
- "asset_identifier": "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27.miamicoin-token::miamicoin",
- "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
- "recipient": "SP24Q9PK9DNTA2V89APY8WNBJ1QYKKSW9SWB04RJP"
}
}, - {
- "type": "nft",
- "event_index": 6,
- "data": {
- "type": "transfer",
- "asset_identifier": "SP497E7RX3233ATBS2AB9G4WTHB63X5PBSP5VGAQ.boom-nfts::boom",
- "value": {
- "hex": "0x00",
- "repr": "0"
}, - "sender": "SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE",
- "recipient": "SP24Q9PK9DNTA2V89APY8WNBJ1QYKKSW9SWB04RJP"
}
}
]
}
NOTE: This endpoint is deprecated in favor of Get transactions by block.
Retrieves a list of all transactions within a block for a given block hash.
block_hash required | string Example: 0x0a83d82a65460a9e711f85a44616350280040b75317dbe486a923c1131b5ff99 Hash of block |
limit | integer Example: limit=10 max number of transactions to fetch |
offset | integer Example: offset=42000 index of first transaction to fetch |
{- "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_height": 51396,
- "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"
}
}
]
}
NOTE: This endpoint is deprecated in favor of Get transactions by block.
Retrieves all transactions within a block at a given height
height required | integer Example: 66119 Height of block |
limit | integer Example: limit=10 max number of transactions to fetch |
offset | integer Example: offset=42000 index of first transaction to fetch |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
{- "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_height": 51396,
- "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"
}
}
]
}
Retrieves all transactions for a given address that are currently in mempool
address required | string Example: SP197DVH8KTJGX4STM61QN0WJV8Y9QJWXV83ZGNR9 Transactions for the address |
limit | integer Example: limit=90 max number of transactions to fetch |
offset | integer Example: offset=42000 index of first transaction to fetch |
unanchored | boolean Default: false Example: unanchored=true Include transaction data from unanchored (i.e. unconfirmed) microblocks |
{- "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)))"
}
]
}
}
]
}
Retrieves the list of events filtered by principal (STX address or Smart Contract ID), transaction id or event types. The list of event types is ('smart_contract_log', 'stx_lock', 'stx_asset', 'fungible_token_asset', 'non_fungible_token_asset').
tx_id | string Example: tx_id=0x29e25515652dad41ef675bd0670964e3d537b80ec19cf6ca6f1dd65d5bc642c5 Hash of transaction |
address | string Example: address=ST1HB64MAJ1MBV4CQ80GF01DZS4T1DSMX20ADCRA4 Stacks address or a Contract identifier |
limit | integer Example: limit=100 number of items to return |
offset | integer Example: offset=42000 number of items to skip |
type | Array of strings Items Enum: "smart_contract_log" "stx_lock" "stx_asset" "fungible_token_asset" "non_fungible_token_asset" Example: type=stx_lock Filter the events on event type |
{- "limit": 96,
- "offset": 0,
- "events": [
- {
- "event_index": 0,
- "event_type": "non_fungible_token_asset",
- "tx_id": "0x05ccc123db703a2808afaaf88b6b3240f14391d14fde701bd20d7206c9133af6",
- "asset": {
- "asset_event_type": "transfer",
- "asset_id": "ST000000000000000000002AMW42H.bns::names",
- "sender": "STKVDRCTN8C81T22QHR9PG9GPD3V3WPQYBYFHPT4",
- "recipient": "STRWN68C36Z7WTDD1TJERTAZ4SXDRMMDB29M4VNQ",
- "value": {
- "hex": "0x0c00000002046e616d65020000000a62696c616c7465737435096e616d6573706163650200000003627463",
- "repr": "(tuple (name 0x62696c616c7465737435) (namespace 0x627463))"
}
}
}, - {
- "event_index": 1,
- "event_type": "smart_contract_log",
- "tx_id": "0x05ccc123db703a2808afaaf88b6b3240f14391d14fde701bd20d7206c9133af6",
- "contract_log": {
- "contract_id": "ST000000000000000000002AMW42H.bns",
- "topic": "print",
- "value": {
- "hex": "0x0c000000010a6174746163686d656e740c00000003106174746163686d656e742d696e646578010000000000000000000000000000028304686173680200000014b472a266d0bd89c13706a4132ccfb16f7c3b9fcb086d657461646174610c00000004046e616d65020000000a62696c616c7465737435096e616d6573706163650200000003627463026f700d0000000d6e616d652d7472616e736665720974782d73656e646572051a27b6e19aaa1880e842bc709b4130b347b1f2d7f2",
- "repr": "(tuple (attachment (tuple (attachment-index u643) (hash 0xb472a266d0bd89c13706a4132ccfb16f7c3b9fcb) (metadata (tuple (name 0x62696c616c7465737435) (namespace 0x627463) (op \"name-transfer\") (tx-sender STKVDRCTN8C81T22QHR9PG9GPD3V3WPQYBYFHPT4))))))"
}
}
}
]
}
Returns estimated fee priorities (in micro-STX) for all transactions that are currently in the mempool. Also returns priorities separated by transaction type.
{- "all": {
- "no_priority": 3000,
- "low_priority": 3000,
- "medium_priority": 6000,
- "high_priority": 401199
}, - "token_transfer": {
- "no_priority": 3000,
- "low_priority": 3000,
- "medium_priority": 6000,
- "high_priority": 401199
}, - "smart_contract": {
- "no_priority": 837500,
- "low_priority": 925000,
- "medium_priority": 1012500,
- "high_priority": 1082500
}, - "contract_call": {
- "no_priority": 3000,
- "low_priority": 10368,
- "medium_priority": 100000,
- "high_priority": 1000000
}
}
Retrieves a list of PoX cycles
limit | integer <= 60 Default: 20 max number of cycles to fetch |
offset | integer Example: offset=20 index of first cycle to fetch |
{- "limit": 20,
- "offset": 0,
- "total": 3,
- "results": [
- {
- "block_height": 50,
- "cycle_number": 14,
- "index_block_hash": "0xf5be33abc4e508bdaf2191e88339372edcb3358c44e2a31e1b9b44f2880dde09",
- "total_signers": 3,
- "total_stacked_amount": "1372502700000000000",
- "total_weight": 9
}, - {
- "block_height": 22,
- "cycle_number": 13,
- "index_block_hash": "0x5077c7d971dd83cd3ba19dca579e3cc8dcf17913186b66093c94520e50d3b7b2",
- "total_signers": 3,
- "total_stacked_amount": "1372502700000000000",
- "total_weight": 9
}, - {
- "block_height": 13,
- "cycle_number": 12,
- "index_block_hash": "0x62d06851fe03f17cb45a488ae70bd8e0c5c308c523f37814ad4df36bd2108713",
- "total_signers": 3,
- "total_stacked_amount": "1372502700000000000",
- "total_weight": 9
}
]
}
Retrieves details for a PoX cycle
cycle_number required | integer Example: 56 PoX cycle number |
{- "block_height": 50,
- "cycle_number": 14,
- "index_block_hash": "0xf5be33abc4e508bdaf2191e88339372edcb3358c44e2a31e1b9b44f2880dde09",
- "total_signers": 3,
- "total_stacked_amount": "1372502700000000000",
- "total_weight": 9
}
Retrieves a list of signers in a PoX cycle
cycle_number required | integer Example: 56 PoX cycle number |
{- "limit": 20,
- "offset": 0,
- "total": 3,
- "results": [
- {
- "signing_key": "0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d",
- "signer_address": "STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP",
- "stacked_amount": "686251350000000000",
- "stacked_amount_percent": 50,
- "weight": 5,
- "weight_percent": 55.55555555555556,
- "solo_stacker_count": 16,
- "pooled_stacker_count": 3615
}, - {
- "signing_key": "0x029874497a7952483aa23890e9d0898696f33864d3df90939930a1f45421fe3b09",
- "signer_address": "STF9B75ADQAVXQHNEQ6KGHXTG7JP305J2GRWF3A2",
- "stacked_amount": "457500900000000000",
- "stacked_amount_percent": 33.333333333333336,
- "weight": 3,
- "weight_percent": 33.33333333333333,
- "solo_stacker_count": 0,
- "pooled_stacker_count": 1456
}, - {
- "signing_key": "0x02dcde79b38787b72d8e5e0af81cffa802f0a3c8452d6b46e08859165f49a72736",
- "signer_address": "ST18MDW2PDTBSCR1ACXYRJP2JX70FWNM6YY2VX4SS",
- "stacked_amount": "228750450000000000",
- "stacked_amount_percent": 16.666666666666668,
- "weight": 1,
- "weight_percent": 11.11111111111111,
- "solo_stacker_count": 637,
- "pooled_stacker_count": 0
}
]
}
Retrieves details for a signer in a PoX cycle
cycle_number required | integer Example: 56 PoX cycle number |
signer_key required | string Example: 0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d Signer key |
{- "signing_key": "0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d",
- "signer_address": "STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP",
- "stacked_amount": "686251350000000000",
- "stacked_amount_percent": 50,
- "weight": 5,
- "weight_percent": 55.55555555555556,
- "solo_stacker_count": 16,
- "pooled_stacker_count": 3615
}
Retrieves a list of stackers for a signer in a PoX cycle
cycle_number required | integer Example: 56 PoX cycle number |
signer_key required | string Example: 0x038e3c4529395611be9abf6fa3b6987e81d402385e3d605a073f42f407565a4a3d Signer key |
{- "limit": 20,
- "offset": 0,
- "total": 1,
- "results": [
- {
- "pox_address": "15Z2sAvjgVDpcBh4vx9g2XKU8FVHYcXNaj",
- "stacked_amount": "686251350000000000",
- "stacker_address": "STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP",
- "stacker_type": "solo"
}
]
}
Retrieves the list of stacking pool members for a given delegator principal.
pool_principal required | string Example: SPSCWDV3RKV5ZRN1FQD84YE1NQFEDJ9R1F4DYQ11 Address principal of the stacking pool delegator |
after_block | integer If specified, only delegation events after the given block will be included |
unanchored | boolean Default: false Example: unanchored=true whether or not to include Stackers from unconfirmed transactions |
limit | integer <= 200 Default: 100 Example: limit=100 number of items to return |
offset | integer Default: 0 Example: offset=300 number of items to skip |
{- "limit": 200,
- "offset": 0,
- "total": 2,
- "results": [
- {
- "stacker": "SPDGWQ60E1QXTC6E4VHKK0NG34EAX554WDFFFHMF",
- "pox_addr": "bc1qxhmdufsvnuaaaer4ynz88fspdsxq2h9e9cetdj",
- "amount_ustx": "2062697998",
- "burn_block_unlock_height": 781984,
- "block_height": 65917,
- "tx_id": "0x3c81cd26ed172a7e552ed245b8b290abefa4f82dfc610a0091ac91c2eed7f9e6"
}, - {
- "stacker": "SP7RNXF7YBSS43TECXTHF7W1MAB221WWW8RKPGSN",
- "pox_addr": "1Di1YoMov6Ua3gPedfQz7TkP6iTLqbPUzi",
- "amount_ustx": "4815793194",
- "block_height": 65910,
- "tx_id": "0x1692cd26ed172a7e552ed245b8b290abefa4f82dfc610a0091ac91c2eed7f9e6"
}
]
}