CityCoins
Search…
Stacks Transactions
Creating, monitoring, and interacting with Stacks blockchain transactions.

Stacks.js Libraries

These libraries include everything you need to work with the Stacks blockchain.

Post-Conditions

By defining post conditions, users can create transactions that include pre-defined guarantees about what might happen in that contract.
One such post condition could be "I will transfer exactly 100 of X token", where "X token" is referenced as a specific contract's fungible token. When wallets and applications implement the transfer method, they should always use post conditions to specify that the user will transfer exactly the amount of tokens that they specify in the amount argument of the transfer function. Only in very specific circumstances should such a post condition not be included.
1
"post_conditions": [
2
{
3
"type": "fungible",
4
"condition_code": "sent_equal_to",
5
"amount": "241996",
6
"principal": {
7
"type_id": "principal_contract",
8
"contract_name": "miamicoin-core-v1",
9
"address": "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27"
10
},
11
"asset": {
12
"contract_name": "miamicoin-token",
13
"asset_name": "miamicoin",
14
"contract_address": "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27"
15
}
16
}
17
],
Copied!
Examples of how to use post-conditions are outlined in the Code Examples.

Fee Estimation

Depending on the number of transactions in the mempool, setting a competitive fee on a transaction can help ensure it's processed in a timely matter by Stacks miners.
Fees are automatically calculated by the Hiro Web Wallet when integrated.
Resources to view the Stacks mempool and more about Stacks transactions are below: