> For the complete documentation index, see [llms.txt](https://docs.citycoins.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.citycoins.co/developer-resources/integrations/stacks-transactions.md).

# Stacks Transactions

## Stacks.js Libraries

These libraries include everything you need to work with the [Stacks blockchain](https://stacks.co).

* [Stacks.js Libraries](https://github.com/hirosystems/stacks.js)
* [Stacks.js Documentation](https://stacks.js.org)
* [micro-stacks Libraries](https://github.com/fungible-systems/micro-stacks/)
* [micro-stacks Documentation](https://docs.micro-stacks.dev/)

## 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.

```
"post_conditions": [
    {
      "type": "fungible",
      "condition_code": "sent_equal_to",
      "amount": "241996",
      "principal": {
        "type_id": "principal_contract",
        "contract_name": "miamicoin-core-v1",
        "address": "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27"
      },
      "asset": {
        "contract_name": "miamicoin-token",
        "asset_name": "miamicoin",
        "contract_address": "SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27"
      }
    }
  ],
```

Examples of how to use post-conditions are outlined in the [Code Examples](/developer-resources/code-examples.md).

## 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](https://wallet.hiro.so/wallet/install-web) when integrated.

Resources to view the Stacks mempool and more about Stacks transactions are below:

* [Haystack Mempool Explorer](https://haystack.tools/mempool)
* [Stacks data center: mempool](https://stacksdata.info/#mempool)
* [CityCoins: get network status script](https://github.com/citycoins/scripts/blob/main/src/get-network-status.ts)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.citycoins.co/developer-resources/integrations/stacks-transactions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
