Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olofblomqvist/marlowe-py
Cardano Marlowe smart contract utils for python
https://github.com/olofblomqvist/marlowe-py
cardano marlowe
Last synced: 14 days ago
JSON representation
Cardano Marlowe smart contract utils for python
- Host: GitHub
- URL: https://github.com/olofblomqvist/marlowe-py
- Owner: OlofBlomqvist
- Created: 2023-07-09T18:44:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-21T16:52:13.000Z (8 months ago)
- Last Synced: 2024-05-22T16:31:33.540Z (8 months ago)
- Topics: cardano, marlowe
- Language: Rust
- Homepage:
- Size: 19.3 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
[![PyPI version](https://badge.fury.io/py/marlowe.svg)](https://pypi.org/project/marlowe/)
[![Downloads](https://static.pepy.tech/badge/marlowe)](https://pepy.tech/project/marlowe)## MARLOWE-PY
**Python bindings for Marlowe_Lang [marlowe-rs](https://github.com/OlofBlomqvist/marlowe-rs).**
### Features
- Deserialize contracts from: cbor-hex, dsl, json.
- Deserialize datums & redeemers from cbor-hex,json.
- Serialize contracts to json, dsl.
- Serialize datums & redeemers to cbor-hex, json.
- Unstable: View contract expected next inputs and other state info.
- Unstable: Define contracts directly in Python.
- Unstable: Code generator: Convert any contract to equivalent Python code### Project goals
- Provide easy to use API's for everything marlowe-rs supports.
- Provide easy to use way of designing Marlowe contracts in Python.### How to install
```bash
pip install marlowe
```Alternatives:
- pip install wlh files directly using builds artifacts from CI: https://github.com/OlofBlomqvist/marlowe-py/actions/workflows/build_wheels.yml
- clone the repo, install prereqs: rust,python,maturin; run wheels.ps1 or wheels.sh### How to use
See the example notebook [here](https://github.com/OlofBlomqvist/marlowe-py/blob/main/example.ipynb).
Basic contract construction:
```python
When(
case=[
Deposit(
by = Role("GUY1"),
value = Constant(42000000),
of_token = ADA,
into_account = Role("GUY2"),
then_continue_with = raw(Close()) # or merkleized("some hash")
)
],
timeout = TimeConst(999999999),
timeout_continuation = Close()
)
```### Building from source
- See [development.md](https://github.com/OlofBlomqvist/marlowe-py/blob/main/development.md)