Skip to main content

/extended/v1/contract/{contract_id} REST API Endpoint

Retrieves details of a contract with a given `contract_id`.

Updated on
Oct 4, 2023

/extended/v1/contract/{contract_id} REST API Endpoint

Path Parameters

contract_id
string
REQUIRED
Contract identifier formatted as {contract_address}.{contract_name}.

Query Parameters

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

Returns

object
object
An object with the following values
tx_id
array
Array of transaction IDs.
nonce
array
Array of nonces.
fee_rate
array
Array of fee rates.
sender_address
string
Address of the transaction initiator.
sponsor_nonce
integer
Sponsor nonce.
sponsored
boolean
Denotes whether the originating account is the same as the paying account.
sponsor_address
string
Sponsor address.
post_condition_mode
string
Possible values: 'allow', 'deny'.
post_conditions
array
Array of post conditions.
anchor_mode
string
Possible values: 'on_chain_only', 'off_chain_only', 'any'.
block_hash
string
Hash of the block this transaction was associated with.
block_height
integer
Height of the block this transaction was associated with.
burn_block_time
string
Unix timestamp (in seconds) indicating when this block was mined.
burn_block_time_iso
string
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) timestamp indicating when this block was mined.
parent_burn_block_time
string
Unix timestamp (in seconds) indicating when this parent block was mined.
parent_burn_block_time_iso
string
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) timestamp indicating when this parent block was mined.
canonical
array
Set to true if block corresponds to the canonical chain tip.
tx_index
integer
Index of the transaction, indicating the order. Starts at 0 and increases with each transaction.
tx_status
string
Enum: 'success', 'abort_by_response', 'abort_by_post_condition'. Status of the transaction.
tx_result
object
Result of the transaction.
event_count
integer
Number of transaction events.
parent_block_hash
string
Hash of the previous block.
is_unanchored
boolean
True if the transaction is included in a microblock that has not been confirmed by an anchor block.
microblock_hash
string
The microblock hash that this transaction was streamed in. If the transaction was batched in an anchor block (not included within a microblock), then this value will be an empty string.
microblock_sequence
integer
The microblock sequence number that this transaction was streamed in. If the transaction was batched in an anchor block (not included within a microblock), then this value will be 2147483647 (0x7fffffff, the max int32 value). This value preserves logical transaction ordering on (block_height, microblock_sequence, tx_index).
microblock_canonical
boolean
Set to true if the microblock is anchored in the canonical chain tip, false if the transaction was orphaned in a micro-fork.
execution_cost_read_count
integer
Execution cost read count.
execution_cost_read_length
integer
Execution cost read length.
execution_cost_runtime
integer
Execution cost runtime.
execution_cost_write_count
integer
Execution cost write count.
execution_cost_write_length
integer
Execution cost write length.
events
array
List of transaction events.
tx_type
string
Value: 'token_transfer'.
token_transfer
object
Details of the token transfer.
Request
1
curl -X 'GET' \
2
'https://docs-demo.stacks-mainnet.quiknode.pro/extended/v1/contract/SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.staking-helper' \
3
-H 'Content-Type: application/json'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free