Smart Contracts
Read-only endpoints to obtain Clarity smart contract details
Retrieves the deployment status of multiple smart contracts.
Smart Contract ID
Smart Contract ID
SP000000000000000000002Q6VF78.pox-3Pattern: ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$Default Response
Default Response
GET /extended/v2/smart-contracts/status?contract_id=SP000000000000000000002Q6VF78.pox-3 HTTP/1.1
Host: api.hiro.so/
Accept: */*
{
"ANY_ADDITIONAL_PROPERTY": {
"found": true,
"result": {
"status": "text",
"tx_id": "text",
"contract_id": "text",
"block_height": 1
}
}
}Retrieves contract log events for a given smart contract.
Contract identifier formatted as <contract_address>.<contract_name>
SP000000000000000000002Q6VF78.pox-3Results per page
20Result offset
0Cursor for transaction event pagination (block_height:microblock_sequence:tx_index:event_index)
^[0-9]+:[0-9]+:[0-9]+:[0-9]+$Default Response
2001Next page cursor
Previous page cursor
Current page cursor
Default Response
GET /extended/v2/smart-contracts/{contract_id}/logs HTTP/1.1
Host: api.hiro.so/
Accept: */*
{
"limit": 20,
"offset": 0,
"total": 1,
"next_cursor": "text",
"prev_cursor": "text",
"cursor": "text",
"results": [
{
"event_index": 1,
"event_type": "smart_contract_log",
"tx_id": "text",
"contract_log": {
"contract_id": "text",
"topic": "text",
"value": {
"hex": "text",
"repr": "text"
}
}
}
]
}Retrieves a deployed smart contract, along with the transaction that deployed it. Only successfully deployed contracts are returned; a contract id whose deploy transaction failed is not found.
Smart Contract ID
SP000000000000000000002Q6VF78.pox-3Pattern: ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$Default Response
Smart Contract ID
SP000000000000000000002Q6VF78.pox-3Pattern: ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$The Clarity version the contract runs under. Contracts deployed with a versioned payload declare their own version; for the rest it is the version the node resolved from the epoch they were deployed in. Null when it could not be determined, which only happens for contracts indexed from a chainstate predating the point where the Stacks node began reporting it.
3ID of the transaction that deployed this contract
0xf6bd5f4a7b26184a3466340b2e99fd003b4962c0e382a7e4b6a13df3dd7a91c6Pattern: ^(0x)?[a-fA-F0-9]{64}$The Clarity source code of the contract. Only present when requested via the include=source_code query param.
Default Response
GET /extended/v3/smart-contracts/{contract_id} HTTP/1.1
Host: api.hiro.so/
Accept: */*
{
"contract_id": "SP000000000000000000002Q6VF78.pox-3",
"clarity_version": 3,
"tx_id": "0xf6bd5f4a7b26184a3466340b2e99fd003b4962c0e382a7e4b6a13df3dd7a91c6",
"block": {
"height": 1,
"hash": "text",
"index_hash": "text",
"time": 1,
"tx_index": 1
},
"bitcoin_block": {
"height": 1,
"time": 1
},
"source_code": "text"
}Last updated
Was this helpful?