Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
a