Metadata-Version: 2.4
Name: cashscript-py
Version: 1.0.2
Summary: Python SDK for Bitcoin Cash (BCH) CashScript smart contracts.
Author: CashScript-Py contributors
Maintainer: CashScript-Py maintainers
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: bitcash~=1.1.1
Requires-Dist: coincurve~=21.0.0
Requires-Dist: semver~=3.0.4
Requires-Dist: typing-extensions~=4.15.0
Provides-Extra: docs
Requires-Dist: sphinx-rtd-theme>=3.0.2; extra == 'docs'
Requires-Dist: sphinx>=8.2.3; extra == 'docs'
Description-Content-Type: text/markdown

# CashScript-Py

CashScript-Py is a Python SDK for Bitcoin Cash (BCH) smart contract development. It is a port of the original TypeScript
[CashScript SDK](https://cashscript.org/). The goal is to enable Python developers (e.g., those working on server-side
tools, bots, and Electron Cash plugins) to construct and interact with smart contracts on the BCH blockchain without
re-implementing common low-level details.

CashScript-Py builds on earlier work by Jonald Fyookball on the
[anyhedge-ec-plugin](https://github.com/fyookball/anyhedge-ec-plugin).

## Installation

Install from PyPI:

```bash
pip install cashscript-py
```

If you use `uv`:

```bash
uv add cashscript-py
```

## Minimal example

```python
from cashscript_py import Contract, ElectrumNetworkProvider, SignatureTemplate, TransactionBuilder

provider = ElectrumNetworkProvider("chipnet")
contract = Contract(artifact, constructor_args, provider)

unlocker = contract.unlock["spend"](SignatureTemplate(alice_wif))
builder = TransactionBuilder(provider).add_input(contract_utxo, unlocker).add_output(...)
tx_hex = builder.build()
print(tx_hex)
```

## Documentation

- User guide: [getting-started.md](https://gitlab.com/cashscript-py/cashscript-py/-/blob/master/docs/guide/getting-started.md)
- API documentation: https://cashscript-py.readthedocs.io/
- Runnable examples: [examples/](https://gitlab.com/cashscript-py/cashscript-py/-/tree/master/examples) (e.g. `uv run python examples/op_return_memo.py`, `uv run python examples/hodl_vault.py`)

## Contributing

For local development setup, testing, documentation generation, and project workflow details, see:

- [CONTRIBUTING.md](./CONTRIBUTING.md)
- [STYLEGUIDE.md](./STYLEGUIDE.md)

## Acknowledgements
- Original CashScript SDK: https://cashscript.org/
- AnyHedge Plugin: https://github.com/fyookball/anyhedge-ec-plugin
- Bitcash library: https://pybitcash.github.io/bitcash/
