Skip to content

Instantly share code, notes, and snippets.

@kyranjamie
Last active October 20, 2021 10:57
Show Gist options
  • Save kyranjamie/b54d2b78894ffbc7cc2816f73afd983f to your computer and use it in GitHub Desktop.
Save kyranjamie/b54d2b78894ffbc7cc2816f73afd983f to your computer and use it in GitHub Desktop.
Restish with Stacks Blockchain API
This file has been truncated, but you can view the full file.
# Setting up Restish for Stacks Blockchain API
[Read about Restish here](https://rest.sh/#/configuration)
## Install
```
# Add the tap
$ brew tap danielgtaylor/restish
# Install the executable
$ brew install restish
```
## Step 1: Generate a flattened `openapi.yaml` schema doing magic in API repo
Demo here:
<details>
<summary></summary>
```
openapi: 3.0.2
servers:
- url: 'https://stacks-node-api.mainnet.stacks.co'
description: Mainnet
- url: 'https://stacks-node-api.testnet.stacks.co'
description: Testnet
- url: 'http://localhost:3999'
description: Local
info:
title: Stacks 2.0 Blockchain API
version: STACKS_API_VERSION
contact:
name: API developers
url: 'https://github.com/blockstack/stacks-blockchain-api/issues'
email: info@hiro.so
description: >
This is the documentation for the Stacks 2.0 Blockchain API. It is comprised
of two parts; the Stacks Blockchain API and the Stacks Core API. <a
href="collection.json" download="collection.json">Download Postman
collection</a>
paths:
/extended/v1/faucets/stx:
parameters:
- name: address
in: query
description: STX address
required: true
schema:
type: string
- name: stacking
in: query
description: Request the amount of STX needed for stacking
required: false
schema:
type: boolean
default: false
post:
summary: Get STX tokens
description: Get STX tokens for the testnet
tags:
- Faucets
operationId: run_faucet_stx
responses:
'200':
description: Success
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: POST request that runs the faucet
title: RunFaucetResponse
type: object
additionalProperties: false
required:
- success
properties:
success:
type: boolean
description: Indicates if the faucet call was successful
txId:
type: string
description: The transaction ID for the faucet call
txRaw:
type: string
description: Raw transaction in hex string representation
example:
success: true
txId: >-
0xf2f0402f9f4c4d43b382690c4f7b97e24d5ff5dd5c619e3615daa64dca7ef4bc
txRaw: >-
80800000000400164247d6f2b425ac5771423ae6c80c754f7172b0000000000000003200000000000000b400008537046ff1008368baaa3ff2235122c556b89dad4f9df0639b924cf32a44b866497e49846b24191e711b21faaae96ca0542e4a140168484740b94211cececb3303020000000000051ab52c45b1a7977204f17ac0b6f48306aea2dbb8e9000000000007a12046617563657400000000000000000000000000000000000000000000000000000000
'500':
description: Failed to run faucet
/extended/v1/faucets/btc:
parameters:
- name: address
in: query
description: BTC address
required: true
schema:
type: string
post:
summary: Get BTC tokens
description: Get BTC tokens for the testnet
tags:
- Faucets
operationId: run_faucet_btc
responses:
'200':
description: Success
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: POST request that runs the faucet
title: RunFaucetResponse
type: object
additionalProperties: false
required:
- success
properties:
success:
type: boolean
description: Indicates if the faucet call was successful
txId:
type: string
description: The transaction ID for the faucet call
txRaw:
type: string
description: Raw transaction in hex string representation
example:
success: true
txId: >-
0xf2f0402f9f4c4d43b382690c4f7b97e24d5ff5dd5c619e3615daa64dca7ef4bc
txRaw: >-
80800000000400164247d6f2b425ac5771423ae6c80c754f7172b0000000000000003200000000000000b400008537046ff1008368baaa3ff2235122c556b89dad4f9df0639b924cf32a44b866497e49846b24191e711b21faaae96ca0542e4a140168484740b94211cececb3303020000000000051ab52c45b1a7977204f17ac0b6f48306aea2dbb8e9000000000007a12046617563657400000000000000000000000000000000000000000000000000000000
'500':
description: Failed to run faucet
/extended/v1/tx:
get:
summary: Get recent transactions
tags:
- Transactions
operationId: get_transaction_list
description: >
Get all recently mined transactions
If using TypeScript, import typings for this response from our types
package:
`import type { TransactionResults } from
'@stacks/stacks-blockchain-api-types';`
parameters:
- name: limit
in: query
description: max number of transactions to fetch
required: false
schema:
type: integer
- name: offset
in: query
description: index of first transaction to fetch
required: false
schema:
type: integer
- name: type
in: query
description: Filter by transaction type
required: false
schema:
type: array
items:
type: string
enum:
- coinbase
- token_transfer
- smart_contract
- contract_call
- poison_microblock
- name: unanchored
in: query
description: >-
Include transaction data from unanchored (i.e. unconfirmed)
microblocks
required: false
schema:
type: boolean
default: false
responses:
'200':
description: List of transactions
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: GET request that returns transactions
title: TransactionResults
type: object
required:
- results
- limit
- offset
- total
properties:
limit:
type: integer
maximum: 200
description: The number of transactions to return
offset:
type: integer
description: The number to transactions to skip (starting at `0`)
total:
type: integer
description: The number of transactions available
results:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: Transaction
description: Describes all transaction types on Stacks 2.0 blockchain
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: TokenTransferTransaction
description: >-
Describes representation of a Type-0 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-0-transferring-an-asset
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All
mined/anchored Stacks transactions have these
properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions
was associated with
block_height:
type: integer
description: >-
Height of the block this transactions
was associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent
block was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to
the canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with
each transaction
tx_status:
description: >-
Status of the transaction. Can be
included in a block with a success or
aborted status. Or pending in the
mempool. Or dropped from the mempool
from being replaced by a transaction
with the same nonce but a higher fee,
replaced by a transaction with the same
nonce but in the canonical fork, the
transaction is too expensive to include
in a block, or because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract
calls, this will show the value returned
by the call. For other transaction
types, this will return a boolean
indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: >-
Readable string of the transaction
result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed
by an anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored
in the canonical chain tip, `false` if
the transaction was orphaned in a
micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: TokenTransferTransactionMetadata
description: >-
Metadata associated with token-transfer type
transactions
type: object
required:
- tx_type
- token_transfer
additionalProperties: false
properties:
tx_type:
type: string
enum:
- token_transfer
token_transfer:
type: object
required:
- recipient_address
- amount
- memo
additionalProperties: false
properties:
recipient_address:
type: string
amount:
type: string
description: >-
Transfer amount as Integer string
(64-bit unsigned integer)
memo:
type: string
description: >-
Hex encoded arbitrary message, up to 34
bytes length (should try decoding to an
ASCII string)
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: SmartContractTransaction
description: >-
Describes representation of a Type-1 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All
mined/anchored Stacks transactions have these
properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions
was associated with
block_height:
type: integer
description: >-
Height of the block this transactions
was associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent
block was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to
the canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with
each transaction
tx_status:
description: >-
Status of the transaction. Can be
included in a block with a success or
aborted status. Or pending in the
mempool. Or dropped from the mempool
from being replaced by a transaction
with the same nonce but a higher fee,
replaced by a transaction with the same
nonce but in the canonical fork, the
transaction is too expensive to include
in a block, or because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract
calls, this will show the value returned
by the call. For other transaction
types, this will return a boolean
indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: >-
Readable string of the transaction
result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed
by an anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored
in the canonical chain tip, `false` if
the transaction was orphaned in a
micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: SmartContractTransactionMetadata
description: >-
Metadata associated with a contract-deploy type
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract
required:
- tx_type
- smart_contract
additionalProperties: false
properties:
tx_type:
type: string
enum:
- smart_contract
smart_contract:
type: object
additionalProperties: false
required:
- contract_id
- source_code
properties:
contract_id:
type: string
description: >-
Contract identifier formatted as
`<principaladdress>.<contract_name>`
source_code:
type: string
description: >-
Clarity code of the smart contract being
deployed
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: ContractCallTransaction
description: >-
Describes representation of a Type 2 Stacks 2.0
transaction: Contract Call
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All
mined/anchored Stacks transactions have these
properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions
was associated with
block_height:
type: integer
description: >-
Height of the block this transactions
was associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent
block was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to
the canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with
each transaction
tx_status:
description: >-
Status of the transaction. Can be
included in a block with a success or
aborted status. Or pending in the
mempool. Or dropped from the mempool
from being replaced by a transaction
with the same nonce but a higher fee,
replaced by a transaction with the same
nonce but in the canonical fork, the
transaction is too expensive to include
in a block, or because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract
calls, this will show the value returned
by the call. For other transaction
types, this will return a boolean
indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: >-
Readable string of the transaction
result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed
by an anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored
in the canonical chain tip, `false` if
the transaction was orphaned in a
micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: ContractCallTransactionMetadata
description: >-
Metadata associated with a contract-call type
transaction
required:
- tx_type
- contract_call
additionalProperties: false
properties:
tx_type:
type: string
enum:
- contract_call
contract_call:
type: object
additionalProperties: false
required:
- contract_id
- function_name
- function_signature
properties:
contract_id:
type: string
description: >-
Contract identifier formatted as
`<principaladdress>.<contract_name>`
function_name:
type: string
description: >-
Name of the Clarity function to be
invoked
function_signature:
type: string
description: >-
Function definition, including function
name and type as well as parameter names
and types
function_args:
type: array
description: >-
List of arguments used to invoke the
function
items:
type: object
additionalProperties: false
required:
- hex
- repr
- name
- type
properties:
hex:
type: string
repr:
type: string
name:
type: string
type:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: PoisonMicroblockTransaction
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All
mined/anchored Stacks transactions have these
properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions
was associated with
block_height:
type: integer
description: >-
Height of the block this transactions
was associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent
block was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to
the canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with
each transaction
tx_status:
description: >-
Status of the transaction. Can be
included in a block with a success or
aborted status. Or pending in the
mempool. Or dropped from the mempool
from being replaced by a transaction
with the same nonce but a higher fee,
replaced by a transaction with the same
nonce but in the canonical fork, the
transaction is too expensive to include
in a block, or because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract
calls, this will show the value returned
by the call. For other transaction
types, this will return a boolean
indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: >-
Readable string of the transaction
result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed
by an anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored
in the canonical chain tip, `false` if
the transaction was orphaned in a
micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: PoisonMicroblockTransactionMetadata
description: >-
Metadata associated with a poison-microblock
type transaction
required:
- tx_type
- poison_microblock
additionalProperties: false
properties:
tx_type:
type: string
enum:
- poison_microblock
poison_microblock:
type: object
required:
- microblock_header_1
- microblock_header_2
additionalProperties: false
properties:
microblock_header_1:
type: string
description: Hex encoded microblock header
microblock_header_2:
type: string
description: Hex encoded microblock header
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: CoinbaseTransaction
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All
mined/anchored Stacks transactions have these
properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions
was associated with
block_height:
type: integer
description: >-
Height of the block this transactions
was associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating
when this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent
block was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to
the canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with
each transaction
tx_status:
description: >-
Status of the transaction. Can be
included in a block with a success or
aborted status. Or pending in the
mempool. Or dropped from the mempool
from being replaced by a transaction
with the same nonce but a higher fee,
replaced by a transaction with the same
nonce but in the canonical fork, the
transaction is too expensive to include
in a block, or because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract
calls, this will show the value returned
by the call. For other transaction
types, this will return a boolean
indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: >-
Readable string of the transaction
result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed
by an anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored
in the canonical chain tip, `false` if
the transaction was orphaned in a
micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: CoinbaseTransactionMetadata
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
required:
- tx_type
- coinbase_payload
additionalProperties: false
properties:
tx_type:
type: string
enum:
- coinbase
coinbase_payload:
type: object
additionalProperties: false
required:
- data
properties:
data:
type: string
description: >-
Hex encoded 32-byte scratch space for
block leader's use
example:
limit: 10
offset: 0
total: 101922
results:
- tx_id: >-
0x20dedbef812e44d712569224411b27324b68ab4667321a4badd5e81ba76bf0eb
nonce: 269
fee_rate: '0'
sender_address: SPQXK10DBF5ECAM30XVE3EJA8DNZF3VE0BK4MKV
sponsored: false
post_condition_mode: deny
post_conditions: []
anchor_mode: on_chain_only
is_unanchored: false
block_hash: >-
0x28a9e2749b82bdc058776781a5abd5c9a6efed38f05545a8a51152655b8e1f4b
parent_block_hash: >-
0x3789b75ccfe7f2acf85c3f069fd5b8f95f73aba5332fa618243957d1c017a2a3
block_height: 21709
burn_block_time: 1626286436
burn_block_time_iso: '2021-07-14T18:13:56.000Z'
canonical: true
tx_index: 0
tx_status: success
tx_result:
hex: '0x0703'
repr: (ok true)
microblock_hash: ''
microblock_sequence: 2147483647
microblock_canonical: true
event_count: 0
events: []
tx_type: coinbase
coinbase_payload:
data: >-
0x0000000000000000000000000000000000000000000000000000000000000000
/extended/v1/tx/mempool:
get:
summary: Get mempool transactions
tags:
- Transactions
operationId: get_mempool_transaction_list
description: Get all recently-broadcast mempool transactions
parameters:
- name: sender_address
in: query
description: Filter to only return transactions with this sender address.
required: false
schema:
type: string
- name: recipient_address
in: query
description: >-
Filter to only return transactions with this recipient address (only
applicable for STX transfer tx types).
required: false
schema:
type: string
- name: address
in: query
description: >-
Filter to only return transactions with this address as the sender
or recipient (recipient only applicable for STX transfer tx types).
required: false
schema:
type: string
- name: limit
in: query
description: max number of mempool transactions to fetch
required: false
schema:
type: integer
- name: offset
in: query
description: index of first mempool transaction to fetch
required: false
schema:
type: integer
- name: unanchored
in: query
description: >-
Include transaction data from unanchored (i.e. unconfirmed)
microblocks
required: false
schema:
type: boolean
default: false
responses:
'200':
description: List of mempool transactions
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: GET request that returns transactions
title: MempoolTransactionListResponse
type: object
required:
- results
- limit
- offset
- total
properties:
limit:
type: integer
offset:
type: integer
total:
type: integer
results:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolTransaction
description: Describes all transaction types on Stacks 2.0 blockchain
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTokenTransferTransaction
description: >-
Describes representation of a Type-0 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-0-transferring-an-asset
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
title: TokenTransferTransactionMetadata
description: >-
Metadata associated with token-transfer type
transactions
type: object
required:
- tx_type
- token_transfer
additionalProperties: false
properties:
tx_type:
type: string
enum:
- token_transfer
token_transfer:
type: object
required:
- recipient_address
- amount
- memo
additionalProperties: false
properties:
recipient_address:
type: string
amount:
type: string
description: >-
Transfer amount as Integer string
(64-bit unsigned integer)
memo:
type: string
description: >-
Hex encoded arbitrary message, up to 34
bytes length (should try decoding to an
ASCII string)
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolSmartContractTransaction
description: >-
Describes representation of a Type-1 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: SmartContractTransactionMetadata
description: >-
Metadata associated with a contract-deploy type
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract
required:
- tx_type
- smart_contract
additionalProperties: false
properties:
tx_type:
type: string
enum:
- smart_contract
smart_contract:
type: object
additionalProperties: false
required:
- contract_id
- source_code
properties:
contract_id:
type: string
description: >-
Contract identifier formatted as
`<principaladdress>.<contract_name>`
source_code:
type: string
description: >-
Clarity code of the smart contract being
deployed
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolContractCallTransaction
description: >-
Describes representation of a Type 2 Stacks 2.0
transaction: Contract Call
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: ContractCallTransactionMetadata
description: >-
Metadata associated with a contract-call type
transaction
required:
- tx_type
- contract_call
additionalProperties: false
properties:
tx_type:
type: string
enum:
- contract_call
contract_call:
type: object
additionalProperties: false
required:
- contract_id
- function_name
- function_signature
properties:
contract_id:
type: string
description: >-
Contract identifier formatted as
`<principaladdress>.<contract_name>`
function_name:
type: string
description: >-
Name of the Clarity function to be
invoked
function_signature:
type: string
description: >-
Function definition, including function
name and type as well as parameter names
and types
function_args:
type: array
description: >-
List of arguments used to invoke the
function
items:
type: object
additionalProperties: false
required:
- hex
- repr
- name
- type
properties:
hex:
type: string
repr:
type: string
name:
type: string
type:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolPoisonMicroblockTransaction
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: PoisonMicroblockTransactionMetadata
description: >-
Metadata associated with a poison-microblock
type transaction
required:
- tx_type
- poison_microblock
additionalProperties: false
properties:
tx_type:
type: string
enum:
- poison_microblock
poison_microblock:
type: object
required:
- microblock_header_1
- microblock_header_2
additionalProperties: false
properties:
microblock_header_1:
type: string
description: Hex encoded microblock header
microblock_header_2:
type: string
description: Hex encoded microblock header
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolCoinbaseTransaction
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: CoinbaseTransactionMetadata
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
required:
- tx_type
- coinbase_payload
additionalProperties: false
properties:
tx_type:
type: string
enum:
- coinbase
coinbase_payload:
type: object
additionalProperties: false
required:
- data
properties:
data:
type: string
description: >-
Hex encoded 32-byte scratch space for
block leader's use
example:
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)
(define-data-var lockup-period int 0)
(define-data-var stx-return int 0)
(define-public (get-stx-return (stx uint) (months uint))
(ok
(begin
(var-set stx-loaned (to-int(stx))
(var-set lockup-period (to-int(months))
(calculate-stx-return)
(print (var-get stx-return))
(transfer-to-server)
)
)
)
(define-private (calculate-stx-return)
(ok
(begin
(var-set stx-return (- (+ (* (/ (* (var-get stx-loaned) 5) 100) (var-get lockup-period)) (var-get stx-loaned)) 5))
)
)
)
(define-private (transfer-to-server)
(begin
(unwrap-panic (stx-transfer? (to-uint (var-get stx-loaned)) tx-sender 'ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8))
(ok (to-uint (var-get stx-loaned)))
)
)
- 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
(define-read-only (subs (source (buff 10))
(start int)
(end int))
(begin
(unwrap-panic (if (and (<= 0 start) (<= start 10)) (ok 1) (err "Out of bounds: start")))
(unwrap-panic (if (and (<= 0 end) (<= end 10)) (ok 1) (err "Out of bounds: end")))
(let ((temp1 (fold subs1 source
{start: start, end: end, cursor: 1, data: ""})))
(let ((data (get data temp1)))
data))))
;; Call the function to extract the substring between
the bounds:
;; (subs "123456789" 2 5)
(define-read-only (subs1
(ch (buff 1))
(acc {data: (buff 10),
start: int,
end: int,
cursor: int}))
(let ((data (get data acc))
(start (get start acc))
(cursor (get cursor acc))
(end (get end acc)))
(let ((temp2
{cursor: (+ 1 cursor),
data: (default-to ""
(as-max-len?
(concat data
(if (let ((temp3 start)
(temp4 cursor)
(temp5 end))
(and (<= temp3 temp4)
(<= temp4 temp5)))
ch
""))
u10))}))
{start: (get start acc),
end: (get end acc),
cursor: (get cursor temp2),
data: (get data temp2)})))
- 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
(ch (buff 1))
(acc {data: (buff 10),
start: int,
end: int,
cursor: int}))
(begin
(unwrap-panic (if (and (<= 1 (get start acc)) (<= (get start acc) 10)) (ok 1) (err "Out of bounds: start")))
(unwrap-panic (if (and (<= 1 (get end acc)) (<= (get end acc) 10)) (ok 1) (err "Out of bounds: end")))
(unwrap-panic (if (and (<= 1 (get cursor acc)) (<= (get cursor acc) 10)) (ok 1) (err "Out of bounds: cursor")))
(let ((data (get data acc))
(start (get start acc))
(cursor (get cursor acc))
(end (get end acc)))
(let ((temp1
{cursor: (+ 1 cursor),
data: (default-to ""
(as-max-len?
(concat data
(if (let ((temp2 start)
(temp3 cursor)
(temp4 end))
(and (<= temp2 temp3)
(<= temp3 temp4)))
ch
""))
u10))}))
{start: (get start acc),
end: (get end acc),
cursor: (get cursor temp1),
data: (get data temp1)}))))
- 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)))
/extended/v1/tx/mempool/dropped:
get:
summary: Get dropped mempool transactions
tags:
- Transactions
operationId: get_dropped_mempool_transaction_list
description: Get all recently-broadcast mempool transactions
parameters:
- name: limit
in: query
description: max number of mempool transactions to fetch
required: false
schema:
type: integer
- name: offset
in: query
description: index of first mempool transaction to fetch
required: false
schema:
type: integer
responses:
'200':
description: List of dropped mempool transactions
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: GET request that returns transactions
title: MempoolTransactionListResponse
type: object
required:
- results
- limit
- offset
- total
properties:
limit:
type: integer
offset:
type: integer
total:
type: integer
results:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolTransaction
description: Describes all transaction types on Stacks 2.0 blockchain
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTokenTransferTransaction
description: >-
Describes representation of a Type-0 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-0-transferring-an-asset
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
title: TokenTransferTransactionMetadata
description: >-
Metadata associated with token-transfer type
transactions
type: object
required:
- tx_type
- token_transfer
additionalProperties: false
properties:
tx_type:
type: string
enum:
- token_transfer
token_transfer:
type: object
required:
- recipient_address
- amount
- memo
additionalProperties: false
properties:
recipient_address:
type: string
amount:
type: string
description: >-
Transfer amount as Integer string
(64-bit unsigned integer)
memo:
type: string
description: >-
Hex encoded arbitrary message, up to 34
bytes length (should try decoding to an
ASCII string)
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolSmartContractTransaction
description: >-
Describes representation of a Type-1 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: SmartContractTransactionMetadata
description: >-
Metadata associated with a contract-deploy type
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract
required:
- tx_type
- smart_contract
additionalProperties: false
properties:
tx_type:
type: string
enum:
- smart_contract
smart_contract:
type: object
additionalProperties: false
required:
- contract_id
- source_code
properties:
contract_id:
type: string
description: >-
Contract identifier formatted as
`<principaladdress>.<contract_name>`
source_code:
type: string
description: >-
Clarity code of the smart contract being
deployed
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolContractCallTransaction
description: >-
Describes representation of a Type 2 Stacks 2.0
transaction: Contract Call
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: ContractCallTransactionMetadata
description: >-
Metadata associated with a contract-call type
transaction
required:
- tx_type
- contract_call
additionalProperties: false
properties:
tx_type:
type: string
enum:
- contract_call
contract_call:
type: object
additionalProperties: false
required:
- contract_id
- function_name
- function_signature
properties:
contract_id:
type: string
description: >-
Contract identifier formatted as
`<principaladdress>.<contract_name>`
function_name:
type: string
description: >-
Name of the Clarity function to be
invoked
function_signature:
type: string
description: >-
Function definition, including function
name and type as well as parameter names
and types
function_args:
type: array
description: >-
List of arguments used to invoke the
function
items:
type: object
additionalProperties: false
required:
- hex
- repr
- name
- type
properties:
hex:
type: string
repr:
type: string
name:
type: string
type:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolPoisonMicroblockTransaction
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: PoisonMicroblockTransactionMetadata
description: >-
Metadata associated with a poison-microblock
type transaction
required:
- tx_type
- poison_microblock
additionalProperties: false
properties:
tx_type:
type: string
enum:
- poison_microblock
poison_microblock:
type: object
required:
- microblock_header_1
- microblock_header_2
additionalProperties: false
properties:
microblock_header_1:
type: string
description: Hex encoded microblock header
microblock_header_2:
type: string
description: Hex encoded microblock header
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: MempoolCoinbaseTransaction
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractMempoolTransaction
description: >-
Abstract transaction. This schema makes up all
properties common between all Stacks 2.0
transaction types
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST
be included in a microblock, `any`: the
leader can choose where to include the
transaction.
- required:
- tx_status
- receipt_time
- receipt_time_iso
additionalProperties: false
properties:
tx_status:
type: string
description: >-
Status of the transaction in the
mempool. Can be pending in the mempool.
Or dropped from the mempool from being
replaced by a transaction with the same
nonce but a higher fee, replaced by a
transaction with the same nonce but in
the canonical fork, the transaction is
too expensive to include in a block, or
because it became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: MempoolTransactionStatus
enum:
- pending
- dropped_replace_by_fee
- dropped_replace_across_fork
- dropped_too_expensive
- dropped_stale_garbage_collect
receipt_time:
type: number
description: >-
A unix timestamp (in seconds) indicating
when the transaction broadcast was
received by the node.
receipt_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when the
transaction broadcast was received by
the node.
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: CoinbaseTransactionMetadata
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
required:
- tx_type
- coinbase_payload
additionalProperties: false
properties:
tx_type:
type: string
enum:
- coinbase
coinbase_payload:
type: object
additionalProperties: false
required:
- data
properties:
data:
type: string
description: >-
Hex encoded 32-byte scratch space for
block leader's use
example:
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)
(define-data-var lockup-period int 0)
(define-data-var stx-return int 0)
(define-public (get-stx-return (stx uint) (months uint))
(ok
(begin
(var-set stx-loaned (to-int(stx))
(var-set lockup-period (to-int(months))
(calculate-stx-return)
(print (var-get stx-return))
(transfer-to-server)
)
)
)
(define-private (calculate-stx-return)
(ok
(begin
(var-set stx-return (- (+ (* (/ (* (var-get stx-loaned) 5) 100) (var-get lockup-period)) (var-get stx-loaned)) 5))
)
)
)
(define-private (transfer-to-server)
(begin
(unwrap-panic (stx-transfer? (to-uint (var-get stx-loaned)) tx-sender 'ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8))
(ok (to-uint (var-get stx-loaned)))
)
)
- 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
(define-read-only (subs (source (buff 10))
(start int)
(end int))
(begin
(unwrap-panic (if (and (<= 0 start) (<= start 10)) (ok 1) (err "Out of bounds: start")))
(unwrap-panic (if (and (<= 0 end) (<= end 10)) (ok 1) (err "Out of bounds: end")))
(let ((temp1 (fold subs1 source
{start: start, end: end, cursor: 1, data: ""})))
(let ((data (get data temp1)))
data))))
;; Call the function to extract the substring between
the bounds:
;; (subs "123456789" 2 5)
(define-read-only (subs1
(ch (buff 1))
(acc {data: (buff 10),
start: int,
end: int,
cursor: int}))
(let ((data (get data acc))
(start (get start acc))
(cursor (get cursor acc))
(end (get end acc)))
(let ((temp2
{cursor: (+ 1 cursor),
data: (default-to ""
(as-max-len?
(concat data
(if (let ((temp3 start)
(temp4 cursor)
(temp5 end))
(and (<= temp3 temp4)
(<= temp4 temp5)))
ch
""))
u10))}))
{start: (get start acc),
end: (get end acc),
cursor: (get cursor temp2),
data: (get data temp2)})))
- 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
(ch (buff 1))
(acc {data: (buff 10),
start: int,
end: int,
cursor: int}))
(begin
(unwrap-panic (if (and (<= 1 (get start acc)) (<= (get start acc) 10)) (ok 1) (err "Out of bounds: start")))
(unwrap-panic (if (and (<= 1 (get end acc)) (<= (get end acc) 10)) (ok 1) (err "Out of bounds: end")))
(unwrap-panic (if (and (<= 1 (get cursor acc)) (<= (get cursor acc) 10)) (ok 1) (err "Out of bounds: cursor")))
(let ((data (get data acc))
(start (get start acc))
(cursor (get cursor acc))
(end (get end acc)))
(let ((temp1
{cursor: (+ 1 cursor),
data: (default-to ""
(as-max-len?
(concat data
(if (let ((temp2 start)
(temp3 cursor)
(temp4 end))
(and (<= temp2 temp3)
(<= temp3 temp4)))
ch
""))
u10))}))
{start: (get start acc),
end: (get end acc),
cursor: (get cursor temp1),
data: (get data temp1)}))))
- 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)))
'/extended/v1/tx/{tx_id}':
parameters:
- name: tx_id
in: path
description: Hash of transaction
required: true
schema:
type: string
- name: event_offset
in: query
schema:
type: integer
default: 0
description: The number of events to skip
- name: event_limit
in: query
schema:
type: integer
default: 96
description: The numbers of events to return
- name: unanchored
in: query
description: >-
Include transaction data from unanchored (i.e. unconfirmed)
microblocks
required: false
schema:
type: boolean
default: false
get:
summary: Get transaction
tags:
- Transactions
operationId: get_transaction_by_id
description: >
Get a specific transaction by ID
`import type { Transaction } from
'@stacks/stacks-blockchain-api-types';`
responses:
'200':
description: Transaction
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: Transaction
description: Describes all transaction types on Stacks 2.0 blockchain
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: TokenTransferTransaction
description: >-
Describes representation of a Type-0 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-0-transferring-an-asset
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All mined/anchored
Stacks transactions have these properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available from a
raw serialized transactions. These are available
for transactions in the mempool as well as mined
transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions originating
from and paying from an account. The nonce
ensures that a transaction is processed at
most once. The nonce counts the number of
times an account's owner(s) have authorized a
transaction. The first transaction from an
account will have a nonce value equal to 0,
the second will have a nonce value equal to 1,
and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string (64-bit
unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account is the
same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done to
a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST be
included in a microblock, `any`: the leader
can choose where to include the transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions was
associated with
block_height:
type: integer
description: >-
Height of the block this transactions was
associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent block
was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to the
canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with each
transaction
tx_status:
description: >-
Status of the transaction. Can be included in
a block with a success or aborted status. Or
pending in the mempool. Or dropped from the
mempool from being replaced by a transaction
with the same nonce but a higher fee, replaced
by a transaction with the same nonce but in
the canonical fork, the transaction is too
expensive to include in a block, or because it
became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract calls,
this will show the value returned by the call.
For other transaction types, this will return
a boolean indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: Readable string of the transaction result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed by an
anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored in the
canonical chain tip, `false` if the
transaction was orphaned in a micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: TokenTransferTransactionMetadata
description: >-
Metadata associated with token-transfer type
transactions
type: object
required:
- tx_type
- token_transfer
additionalProperties: false
properties:
tx_type:
type: string
enum:
- token_transfer
token_transfer:
type: object
required:
- recipient_address
- amount
- memo
additionalProperties: false
properties:
recipient_address:
type: string
amount:
type: string
description: >-
Transfer amount as Integer string (64-bit
unsigned integer)
memo:
type: string
description: >-
Hex encoded arbitrary message, up to 34 bytes
length (should try decoding to an ASCII
string)
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: SmartContractTransaction
description: >-
Describes representation of a Type-1 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All mined/anchored
Stacks transactions have these properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available from a
raw serialized transactions. These are available
for transactions in the mempool as well as mined
transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions originating
from and paying from an account. The nonce
ensures that a transaction is processed at
most once. The nonce counts the number of
times an account's owner(s) have authorized a
transaction. The first transaction from an
account will have a nonce value equal to 0,
the second will have a nonce value equal to 1,
and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string (64-bit
unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account is the
same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done to
a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST be
included in a microblock, `any`: the leader
can choose where to include the transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions was
associated with
block_height:
type: integer
description: >-
Height of the block this transactions was
associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent block
was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to the
canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with each
transaction
tx_status:
description: >-
Status of the transaction. Can be included in
a block with a success or aborted status. Or
pending in the mempool. Or dropped from the
mempool from being replaced by a transaction
with the same nonce but a higher fee, replaced
by a transaction with the same nonce but in
the canonical fork, the transaction is too
expensive to include in a block, or because it
became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract calls,
this will show the value returned by the call.
For other transaction types, this will return
a boolean indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: Readable string of the transaction result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed by an
anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored in the
canonical chain tip, `false` if the
transaction was orphaned in a micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: SmartContractTransactionMetadata
description: >-
Metadata associated with a contract-deploy type
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract
required:
- tx_type
- smart_contract
additionalProperties: false
properties:
tx_type:
type: string
enum:
- smart_contract
smart_contract:
type: object
additionalProperties: false
required:
- contract_id
- source_code
properties:
contract_id:
type: string
description: >-
Contract identifier formatted as
`<principaladdress>.<contract_name>`
source_code:
type: string
description: >-
Clarity code of the smart contract being
deployed
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: ContractCallTransaction
description: >-
Describes representation of a Type 2 Stacks 2.0
transaction: Contract Call
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All mined/anchored
Stacks transactions have these properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available from a
raw serialized transactions. These are available
for transactions in the mempool as well as mined
transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions originating
from and paying from an account. The nonce
ensures that a transaction is processed at
most once. The nonce counts the number of
times an account's owner(s) have authorized a
transaction. The first transaction from an
account will have a nonce value equal to 0,
the second will have a nonce value equal to 1,
and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string (64-bit
unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account is the
same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done to
a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST be
included in a microblock, `any`: the leader
can choose where to include the transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions was
associated with
block_height:
type: integer
description: >-
Height of the block this transactions was
associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent block
was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to the
canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with each
transaction
tx_status:
description: >-
Status of the transaction. Can be included in
a block with a success or aborted status. Or
pending in the mempool. Or dropped from the
mempool from being replaced by a transaction
with the same nonce but a higher fee, replaced
by a transaction with the same nonce but in
the canonical fork, the transaction is too
expensive to include in a block, or because it
became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract calls,
this will show the value returned by the call.
For other transaction types, this will return
a boolean indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: Readable string of the transaction result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed by an
anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored in the
canonical chain tip, `false` if the
transaction was orphaned in a micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: ContractCallTransactionMetadata
description: >-
Metadata associated with a contract-call type
transaction
required:
- tx_type
- contract_call
additionalProperties: false
properties:
tx_type:
type: string
enum:
- contract_call
contract_call:
type: object
additionalProperties: false
required:
- contract_id
- function_name
- function_signature
properties:
contract_id:
type: string
description: >-
Contract identifier formatted as
`<principaladdress>.<contract_name>`
function_name:
type: string
description: Name of the Clarity function to be invoked
function_signature:
type: string
description: >-
Function definition, including function name
and type as well as parameter names and types
function_args:
type: array
description: List of arguments used to invoke the function
items:
type: object
additionalProperties: false
required:
- hex
- repr
- name
- type
properties:
hex:
type: string
repr:
type: string
name:
type: string
type:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: PoisonMicroblockTransaction
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All mined/anchored
Stacks transactions have these properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available from a
raw serialized transactions. These are available
for transactions in the mempool as well as mined
transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions originating
from and paying from an account. The nonce
ensures that a transaction is processed at
most once. The nonce counts the number of
times an account's owner(s) have authorized a
transaction. The first transaction from an
account will have a nonce value equal to 0,
the second will have a nonce value equal to 1,
and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string (64-bit
unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account is the
same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done to
a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST be
included in a microblock, `any`: the leader
can choose where to include the transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions was
associated with
block_height:
type: integer
description: >-
Height of the block this transactions was
associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent block
was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to the
canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with each
transaction
tx_status:
description: >-
Status of the transaction. Can be included in
a block with a success or aborted status. Or
pending in the mempool. Or dropped from the
mempool from being replaced by a transaction
with the same nonce but a higher fee, replaced
by a transaction with the same nonce but in
the canonical fork, the transaction is too
expensive to include in a block, or because it
became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract calls,
this will show the value returned by the call.
For other transaction types, this will return
a boolean indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: Readable string of the transaction result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed by an
anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored in the
canonical chain tip, `false` if the
transaction was orphaned in a micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: PoisonMicroblockTransactionMetadata
description: >-
Metadata associated with a poison-microblock type
transaction
required:
- tx_type
- poison_microblock
additionalProperties: false
properties:
tx_type:
type: string
enum:
- poison_microblock
poison_microblock:
type: object
required:
- microblock_header_1
- microblock_header_2
additionalProperties: false
properties:
microblock_header_1:
type: string
description: Hex encoded microblock header
microblock_header_2:
type: string
description: Hex encoded microblock header
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: CoinbaseTransaction
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All mined/anchored
Stacks transactions have these properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available from a
raw serialized transactions. These are available
for transactions in the mempool as well as mined
transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions originating
from and paying from an account. The nonce
ensures that a transaction is processed at
most once. The nonce counts the number of
times an account's owner(s) have authorized a
transaction. The first transaction from an
account will have a nonce value equal to 0,
the second will have a nonce value equal to 1,
and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string (64-bit
unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account is the
same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done to
a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
amount:
type: string
type:
enum:
- stx
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_equal_to
type:
enum:
- fungible
type: string
amount:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungible
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- type
- asset_value
- asset
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionNonFungibleConditionCode
description: >-
A non-fungible condition code encodes a
statement being made about a
non-fungible token, with respect to
whether or not the particular
non-fungible token is owned by the
account.
type: string
enum:
- sent
- not_sent
type:
enum:
- non_fungible
type: string
asset_value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
asset:
type: object
required:
- asset_name
- contract_address
- contract_name
additionalProperties: false
properties:
asset_name:
type: string
contract_address:
type: string
contract_name:
type: string
anchor_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionAnchorModeType
type: string
enum:
- on_chain_only
- off_chain_only
- any
description: >-
`on_chain_only`: the transaction MUST be
included in an anchored block,
`off_chain_only`: the transaction MUST be
included in a microblock, `any`: the leader
can choose where to include the transaction.
- required:
- tx_index
- block_hash
- block_height
- burn_block_time
- burn_block_time_iso
- parent_burn_block_time
- parent_burn_block_time_iso
- canonical
- tx_status
- tx_result
- events
- event_count
- parent_block_hash
- is_unanchored
- microblock_hash
- microblock_sequence
- microblock_canonical
- execution_cost_read_count
- execution_cost_read_length
- execution_cost_runtime
- execution_cost_write_count
- execution_cost_write_length
additionalProperties: false
properties:
block_hash:
type: string
description: >-
Hash of the blocked this transactions was
associated with
block_height:
type: integer
description: >-
Height of the block this transactions was
associated with
burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this block was mined
burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this block was
mined.
parent_burn_block_time:
type: integer
description: >-
Unix timestamp (in seconds) indicating when
this parent block was mined
parent_burn_block_time_iso:
type: string
description: >-
An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
timestamp indicating when this parent block
was mined.
canonical:
type: boolean
description: >-
Set to `true` if block corresponds to the
canonical chain tip
tx_index:
type: integer
description: >-
Index of the transaction, indicating the
order. Starts at `0` and increases with each
transaction
tx_status:
description: >-
Status of the transaction. Can be included in
a block with a success or aborted status. Or
pending in the mempool. Or dropped from the
mempool from being replaced by a transaction
with the same nonce but a higher fee, replaced
by a transaction with the same nonce but in
the canonical fork, the transaction is too
expensive to include in a block, or because it
became stale.
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionStatus
type: string
enum:
- success
- abort_by_response
- abort_by_post_condition
tx_result:
type: object
required:
- hex
- repr
description: >-
Result of the transaction. For contract calls,
this will show the value returned by the call.
For other transaction types, this will return
a boolean indicating the success of the
transaction.
additionalProperties: false
properties:
hex:
type: string
description: >-
Hex string representing the value fo the
transaction result
repr:
type: string
description: Readable string of the transaction result
event_count:
type: integer
description: Number of transaction events
parent_block_hash:
type: string
description: Hash of the previous block.
is_unanchored:
type: boolean
description: >-
True if the transaction is included in a
microblock that has not been confirmed by an
anchor block.
microblock_hash:
type: string
description: >-
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:
type: integer
description: >-
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:
type: boolean
description: >-
Set to `true` if microblock is anchored in the
canonical chain tip, `false` if the
transaction was orphaned in a micro-fork.
execution_cost_read_count:
type: integer
description: Execution cost read count.
execution_cost_read_length:
type: integer
description: Execution cost read length.
execution_cost_runtime:
type: integer
description: Execution cost runtime.
execution_cost_write_count:
type: integer
description: Execution cost write count.
execution_cost_write_length:
type: integer
description: Execution cost write length.
events:
type: array
description: List of transaction events
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEvent
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventSmartContractLog
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- contract_log
properties:
event_type:
type: string
enum:
- smart_contract_log
tx_id:
type: string
contract_log:
type: object
additionalProperties: false
required:
- contract_id
- topic
- value
properties:
contract_id:
type: string
topic:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxLock
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- stx_lock_event
properties:
event_type:
type: string
enum:
- stx_lock
tx_id:
type: string
stx_lock_event:
type: object
additionalProperties: false
required:
- locked_amount
- unlock_height
- locked_address
properties:
locked_amount:
type: string
unlock_height:
type: integer
locked_address:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventStxAsset
description: >-
Only present in `smart_contract` and
`contract_call` tx types.
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- stx_asset
tx_id:
type: string
asset:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventAsset
additionalProperties: false
properties:
asset_event_type:
$schema: 'http://json-schema.org/draft-07/schema#'
title: TransactionEventAssetType
type: string
enum:
- transfer
- mint
- burn
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
value:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- amount
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
amount:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: TransactionEventNonFungibleAsset
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
required:
- event_index
properties:
event_index:
type: integer
- type: object
required:
- event_type
- tx_id
- asset
properties:
event_type:
type: string
enum:
- non_fungible_token_asset
tx_id:
type: string
asset:
type: object
additionalProperties: false
required:
- asset_event_type
- asset_id
- sender
- recipient
- value
properties:
asset_event_type:
type: string
asset_id:
type: string
sender:
type: string
recipient:
type: string
value:
type: object
additionalProperties: false
required:
- hex
- repr
properties:
hex:
type: string
repr:
type: string
- $schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: CoinbaseTransactionMetadata
description: >-
Describes representation of a Type 3 Stacks 2.0
transaction: Poison Microblock
required:
- tx_type
- coinbase_payload
additionalProperties: false
properties:
tx_type:
type: string
enum:
- coinbase
coinbase_payload:
type: object
additionalProperties: false
required:
- data
properties:
data:
type: string
description: >-
Hex encoded 32-byte scratch space for block
leader's use
example:
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
'404':
description: Cannot find transaction for given ID
'/extended/v1/tx/{tx_id}/raw':
parameters:
- name: tx_id
in: path
description: Hash of transaction
required: true
schema:
type: string
get:
summary: Get Raw Transaction
tags:
- Transactions
operationId: get_raw_transaction_by_id
description: |
Get raw transaction by ID
responses:
'200':
description: Hex encoded serialized transaction
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: GET raw transaction
title: GetRawTransactionResult
type: object
required:
- raw_tx
properties:
raw_tx:
type: string
description: A hex encoded serialized transaction
example:
raw_tx: '0x1234'
'404':
description: Cannot find transaction for given ID
/v2/transactions:
post:
summary: Broadcast raw transaction
tags:
- Transactions
description: >-
Broadcast raw transactions on the network. You can use the
[@stacks/transactions](https://github.com/blockstack/stacks.js) project
to generate a raw transaction payload.
operationId: post_core_node_transactions
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
example: >-
binary format of
00000000010400bed38c2aadffa348931bcb542880ff79d607afec000000000000000000000000000000c800012b0b1fff6cccd0974966dcd665835838f0985be508e1322e09fb3d751eca132c492bda720f9ef1768d14fdabed6127560ba52d5e3ac470dcb60b784e97dc88c9030200000000000516df0ba3e79792be7be5e50a370289accfc8c9e032000000000000303974657374206d656d6f00000000000000000000000000000000000000000000000000
responses:
'200':
description: Transaction id of successful post of a raw tx to the node's mempool
content:
text/plain:
schema:
type: string
example: >-
"e161978626f216b2141b156ade10501207ae535fa365a13ef5d7a7c9310a09f2"
'400':
description: Rejections result in a 400 error
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: GET request that returns transactions
title: PostCoreNodeTransactionsError
type: object
required:
- error
- reason
- reason_data
- txid
properties:
error:
type: string
description: The error
reason:
type: string
description: The reason for the error
reason_data:
type: object
description: More details about the reason
txid:
type: string
description: The relevant transaction id
example:
error: transaction rejected
reason: BadNonce
reason_data:
actual: 4
expected: 0
is_origin: true
principal: ST2ZRX0K27GW0SP3GJCEMHD95TQGJMKB7G9Y0X1MH
txid: >-
caf6fd60ae05b0c2d19ef14ab6a7670b1095d117fa7c80224c74e76214d0a791
/extended/v1/microblock:
get:
summary: Get recent microblocks
tags:
- Microblocks
operationId: get_microblock_list
parameters:
- name: limit
in: query
description: Max number of microblocks to fetch
required: false
schema:
type: integer
- name: offset
in: query
description: Index of the first microblock to fetch
required: false
schema:
type: integer
responses:
'200':
description: List of microblocks
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: GET request that returns microblocks
additionalProperties: false
title: MicroblockListResponse
type: object
required:
- results
- limit
- offset
- total
properties:
limit:
type: integer
maximum: 30
description: The number of microblocks to return
offset:
type: integer
description: The number to microblocks to skip (starting at `0`)
default: 0
total:
type: integer
description: The number of microblocks available
results:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: Microblock
description: A microblock
type: object
required:
- canonical
- microblock_canonical
- microblock_hash
- microblock_sequence
- microblock_parent_hash
- parent_index_block_hash
- block_height
- parent_block_height
- parent_block_hash
- block_hash
- txs
- parent_burn_block_time
- parent_burn_block_time_iso
- parent_burn_block_hash
- parent_burn_block_height
additionalProperties: false
properties:
canonical:
type: boolean
description: >-
Set to `true` if the microblock corresponds to the
canonical chain tip.
microblock_canonical:
type: boolean
description: >-
Set to `true` if the microblock was not orphaned in
a following anchor block. Defaults to `true` if the
following anchor block has not yet been created.
microblock_hash:
type: string
description: The SHA512/256 hash of this microblock.
microblock_sequence:
type: integer
description: >-
A hint to describe how to order a set of
microblocks. Starts at 0.
microblock_parent_hash:
type: string
description: >-
The SHA512/256 hash of the previous signed
microblock in this stream.
block_height:
type: integer
description: >-
The anchor block height that confirmed this
microblock.
parent_block_height:
type: integer
description: >-
The height of the anchor block that preceded this
microblock.
parent_block_hash:
type: string
description: >-
The hash of the anchor block that preceded this
microblock.
parent_burn_block_hash:
type: string
description: >-
The hash of the Bitcoin block that preceded this
microblock.
parent_burn_block_time:
type: integer
description: >-
The block timestamp of the Bitcoin block that
preceded this microblock.
parent_burn_block_time_iso:
type: string
description: >-
The ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) formatted
block time of the bitcoin block that preceded this
microblock.
parent_burn_block_height:
type: integer
description: >-
The height of the Bitcoin block that preceded this
microblock.
block_hash:
type: string
description: >-
The hash of the anchor block that confirmed this
microblock. This wil be empty for unanchored
microblocks
nullable: true
txs:
type: array
description: List of transactions included in the microblock
items:
type: string
description: Transaction ID
'/extended/v1/microblock/{hash}':
parameters:
- name: hash
in: path
description: Hash of the microblock
required: true
schema:
type: string
get:
summary: Get microblock
description: Get a specific microblock by hash
tags:
- Microblocks
operationId: get_microblock_by_hash
responses:
'200':
description: Microblock
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
title: Microblock
description: A microblock
type: object
required:
- canonical
- microblock_canonical
- microblock_hash
- microblock_sequence
- microblock_parent_hash
- parent_index_block_hash
- block_height
- parent_block_height
- parent_block_hash
- block_hash
- txs
- parent_burn_block_time
- parent_burn_block_time_iso
- parent_burn_block_hash
- parent_burn_block_height
additionalProperties: false
properties:
canonical:
type: boolean
description: >-
Set to `true` if the microblock corresponds to the
canonical chain tip.
microblock_canonical:
type: boolean
description: >-
Set to `true` if the microblock was not orphaned in a
following anchor block. Defaults to `true` if the
following anchor block has not yet been created.
microblock_hash:
type: string
description: The SHA512/256 hash of this microblock.
microblock_sequence:
type: integer
description: >-
A hint to describe how to order a set of microblocks.
Starts at 0.
microblock_parent_hash:
type: string
description: >-
The SHA512/256 hash of the previous signed microblock in
this stream.
block_height:
type: integer
description: The anchor block height that confirmed this microblock.
parent_block_height:
type: integer
description: >-
The height of the anchor block that preceded this
microblock.
parent_block_hash:
type: string
description: >-
The hash of the anchor block that preceded this
microblock.
parent_burn_block_hash:
type: string
description: >-
The hash of the Bitcoin block that preceded this
microblock.
parent_burn_block_time:
type: integer
description: >-
The block timestamp of the Bitcoin block that preceded
this microblock.
parent_burn_block_time_iso:
type: string
description: >-
The ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) formatted block
time of the bitcoin block that preceded this microblock.
parent_burn_block_height:
type: integer
description: >-
The height of the Bitcoin block that preceded this
microblock.
block_hash:
type: string
description: >-
The hash of the anchor block that confirmed this
microblock. This wil be empty for unanchored microblocks
nullable: true
txs:
type: array
description: List of transactions included in the microblock
items:
type: string
description: Transaction ID
'404':
description: Cannot find microblock with given hash
content:
application/json:
example:
error: cannot find microblock by hash 0xabc123
/extended/v1/microblock/unanchored/txs:
get:
summary: >-
Get the list of current transactions that belong to unanchored
microblocks
description: >-
This contains transactions that have been streamed in microblocks but
not yet accepted or rejected in an anchor block
tags:
- Microblocks
operationId: get_unanchored_txs
responses:
'200':
description: Transactions
content:
application/json:
schema:
$schema: 'http://json-schema.org/draft-07/schema#'
description: GET request that returns unanchored transactions
additionalProperties: false
title: UnanchoredTransactionListResponse
type: object
required:
- results
- total
properties:
total:
type: integer
description: The number of unanchored transactions available
results:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
type: object
title: Transaction
description: Describes all transaction types on Stacks 2.0 blockchain
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: TokenTransferTransaction
description: >-
Describes representation of a Type-0 Stacks 2.0
transaction.
https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-005-blocks-and-transactions.md#type-0-transferring-an-asset
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: AbstractTransaction
description: >-
Anchored transaction metadata. All
mined/anchored Stacks transactions have these
properties.
type: object
allOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: BaseTransaction
description: >-
Transaction properties that are available
from a raw serialized transactions. These
are available for transactions in the
mempool as well as mined transactions.
type: object
required:
- tx_id
- nonce
- fee_rate
- sender_address
- sponsored
- post_condition_mode
- post_conditions
- anchor_mode
additionalProperties: false
properties:
tx_id:
type: string
description: Transaction ID
nonce:
type: integer
description: >-
Used for ordering the transactions
originating from and paying from an
account. The nonce ensures that a
transaction is processed at most once.
The nonce counts the number of times an
account's owner(s) have authorized a
transaction. The first transaction from
an account will have a nonce value equal
to 0, the second will have a nonce value
equal to 1, and so on.
fee_rate:
type: string
description: >-
Transaction fee as Integer string
(64-bit unsigned integer).
sender_address:
type: string
description: Address of the transaction initiator
sponsored:
type: boolean
description: >-
Denotes whether the originating account
is the same as the paying account
sponsor_address:
type: string
post_condition_mode:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionMode
description: ''
type: string
enum:
- allow
- deny
post_conditions:
type: array
items:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostCondition
description: >-
Post-conditionscan limit the damage done
to a user's assets
anyOf:
- $schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionStx
type: object
allOf:
- type: object
required:
- principal
properties:
principal:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionPrincipal
type: object
anyOf:
- type: object
additionalProperties: false
description: Principal Origin
required:
- type_id
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_origin
- type: object
description: Principal Standard
required:
- type_id
- address
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_standard
address:
type: string
- type: object
description: Principal Contract
required:
- type_id
- address
- contract_name
additionalProperties: false
properties:
type_id:
type: string
description: >-
String literal of type
`PostConditionPrincipalType`
enum:
- principal_contract
address:
type: string
contract_name:
type: string
- type: object
required:
- condition_code
- amount
- type
properties:
condition_code:
$schema: 'http://json-schema.org/draft-07/schema#'
title: PostConditionFungibleConditionCode
description: >-
A fungible condition code encodes a
statement being made for either STX or a
fungible token, with respect to the
originating account.
type: string
enum:
- sent_equal_to
- sent_greater_than
- sent_greater_than_or_equal_to
- sent_less_than
- sent_less_than_or_e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment