{"id":23412669,"url":"https://github.com/olofblomqvist/marlowe-rs","last_synced_at":"2025-04-09T04:10:30.058Z","repository":{"id":41250563,"uuid":"507931683","full_name":"OlofBlomqvist/marlowe-rs","owner":"OlofBlomqvist","description":" A Rust library for working with the Marlowe DSL for Cardano financial smart contracts.","archived":false,"fork":false,"pushed_at":"2024-10-29T16:39:47.000Z","size":12825,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T08:23:52.771Z","etag":null,"topics":["blockchain","cardano","dsl","marlowe","parser","rust","smart-contracts"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OlofBlomqvist.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-27T13:58:54.000Z","updated_at":"2024-10-29T16:39:51.000Z","dependencies_parsed_at":"2023-11-19T00:26:08.800Z","dependency_job_id":"b378219e-7b55-4ad0-8914-89d93069c8d3","html_url":"https://github.com/OlofBlomqvist/marlowe-rs","commit_stats":null,"previous_names":["olofblomqvist/marlowe_rust","olofblomqvist/marlowe_lang"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlofBlomqvist%2Fmarlowe-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlofBlomqvist%2Fmarlowe-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlofBlomqvist%2Fmarlowe-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlofBlomqvist%2Fmarlowe-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OlofBlomqvist","download_url":"https://codeload.github.com/OlofBlomqvist/marlowe-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247974731,"owners_count":21026742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","cardano","dsl","marlowe","parser","rust","smart-contracts"],"created_at":"2024-12-22T18:17:58.982Z","updated_at":"2025-04-09T04:10:30.029Z","avatar_url":"https://github.com/OlofBlomqvist.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Marlowe Lang\n\n[![crates.io](https://img.shields.io/crates/v/marlowe_lang.svg)](https://crates.io/crates/marlowe_lang)\n[![Documentation](https://docs.rs/marlowe_lang/badge.svg)](https://docs.rs/marlowe_lang)\n[![BuildAndTest](https://github.com/OlofBlomqvist/marlowe_rust/actions/workflows/rust.yml/badge.svg?branch=master)](https://github.com/OlofBlomqvist/marlowe_rust/actions/workflows/rust.yml)\n[![npm version](https://badge.fury.io/js/marlowe_lang.svg)](https://www.npmjs.com/package/marlowe_lang)\n[![PyPI version](https://badge.fury.io/py/marlowe.svg)](https://pypi.org/project/marlowe/)\n\n\u003e If you just want to decode some marlowe datum from cborHex to json, [go here](https://marlowe-rs.cruma.io/)\n\n\nAn **experimental** Rust implementation of  Marlowe for Cardano smart (financial) contracts. See the examples dir for use with node/deno/react etc.\n\nNote that while there is support for encoding and decoding on-chain data, this crate focuses on the off-chain parts, making it as easy as possible to create, manage and understand contracts in Rust; there will not be any support for creating actual transactions.\n\nThere is also no support for directly communicating with any Cardano or Marlowe infrastructure - this is purely an implementation of the datatypes, semantics and serialization for Marlowe.\n\n### Main Features\n- Encode/Decode Marlowe types between: MarloweDSL/Rust/Json/CborHex\n- List contract parameters used in a contract (extended marlowe)\n- Initialization of contract parameters (extended-marlowe).\n\n### Unstable features\n* enabled via the 'unstable' feature.\n- Contract simulation (semantics::ContractInstance)\n- List expected input actions (semantics::ContractInstance)\n\n### Consuming the library\n\nThis crate can be used in Rust, React, Node, Python, Deno, wasmtime/wasmer etc., see the examples directory for more details. \n\n## CLI Tool:\n\n### Installation:\n```bash\nrustup default nightly\ncargo install marlowe_lang\n```\n\n### Examples \n\n#### marlowe_lang_cli -h\n```text\nUsage: marlowe_lang_cli \u003cCOMMAND\u003e\n\nCommands:\n  datum        Tools for working with datums\n  state        Tools for working with state\n  redeemer     Tools for working with inputs/redeemers (marlowe actions)\n  contract     Tools for working with contracts\n  plutus-data  Tools for working with unknown plutus data\n  help         Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help     Print help information\n  -V, --version  Print version information\n```\n\n#### marlowe_lang_cli decoding a datum\n```text\n./marlowe_lang datum from-string d8799fd8799f40ffd8799fa1d8799fd8799fd87a80d8799fd8799f581c1cb51be3ab4e4b540e86bd4c9be02682db8150f69c3cded2422cc1bfffd87a80ffffd8799f4040ffff1a002dc6c0a0a001ffd87c9f9fd8799fd8799fd8799fd87a80d8799fd8799f581c1cb51be3ab4e4b540e86bd4c9be02682db8150f69c3cded2422cc1bfffd87a80ffffd8799fd87a80d8799fd8799f581c1cb51be3ab4e4b540e86bd4c9be02682db8150f69c3cded2422cc1bfffd87a80ffffd8799f581ca7f7e57db27c9e2f80c205ccb30f73e57f0ee8fc21aff7b86b5daf7845476c6f6265ffd87a9f19012cffffd87c9f9fd8799fd8799fd8799fd87a80d8799fd8799f581cfd37884bbd044c72e5f29de1b777a9c1c1d531773535cd5b55e2f6ffffd87a80ffffd8799fd87a80d8799fd8799f581cfd37884bbd044c72e5f29de1b777a9c1c1d531773535cd5b55e2f6ffffd87a80ffffd8799f581cecc8ad61b973946ee1cc666b259acabb3edf38a73f1b8779d93ba28a445377616effd87a9f1901f4ffffd87a9fd8799fd87a80d8799fd8799f581c1cb51be3ab4e4b540e86bd4c9be02682db8150f69c3cded2422cc1bfffd87a80ffffd87a9fd8799fd87a80d8799fd8799f581cfd37884bbd044c72e5f29de1b777a9c1c1d531773535cd5b55e2f6ffffd87a80ffffffd8799f581ca7f7e57db27c9e2f80c205ccb30f73e57f0ee8fc21aff7b86b5daf7845476c6f6265ffd87a9f19012cffd87a9fd8799fd87a80d8799fd8799f581cfd37884bbd044c72e5f29de1b777a9c1c1d531773535cd5b55e2f6ffffd87a80ffffd87a9fd8799fd87a80d8799fd8799f581c1cb51be3ab4e4b540e86bd4c9be02682db8150f69c3cded2422cc1bfffd87a80ffffffd8799f581cecc8ad61b973946ee1cc666b259acabb3edf38a73f1b8779d93ba28a445377616effd87a9f1901f4ffd87980ffffffff1b0000018386dd2358d87980ffffff1b000001838449f558d87980ffff cbor-hex detailed-text`\n\nState: (MarloweDatumState Accounts([{ (Address \"addr1vywt2xlr4d8yk4qws675exlqy6pdhq2s76wrehkjggkvr0czta9gx\"),(Token \"\" \"\"),3000000 },]) Bound_Values({}) Choices({}) MinTime(1))    \n\nContinuation: Contract (Marlowe-DSL): When [ (Case (Deposit (Address \"addr1vywt2xlr4d8yk4qws675exlqy6pdhq2s76wrehkjggkvr0czta9gx\") (Address \"addr1vywt2xlr4d8yk4qws675exlqy6pdhq2s76wrehkjggkvr0czta9gx\") (Token \"a7f7e57db27c9e2f80c205ccb30f73e57f0ee8fc21aff7b86b5daf78\" \"Globe\") (Constant 300)) (When [ (Case (Deposit (Address \"addr1v87n0zzth5zycuh972w7rdmh48qur4f3wu6ntn2m2h30dlchhlqt3\") (Address \"addr1v87n0zzth5zycuh972w7rdmh48qur4f3wu6ntn2m2h30dlchhlqt3\") (Token \"ecc8ad61b973946ee1cc666b259acabb3edf38a73f1b8779d93ba28a\" \"Swan\") (Constant 500)) (Pay (Address \"addr1vywt2xlr4d8yk4qws675exlqy6pdhq2s76wrehkjggkvr0czta9gx\") (Party (Address \"addr1v87n0zzth5zycuh972w7rdmh48qur4f3wu6ntn2m2h30dlchhlqt3\")) (Token \"a7f7e57db27c9e2f80c205ccb30f73e57f0ee8fc21aff7b86b5daf78\" \"Globe\") (Constant 300) (Pay (Address \"addr1v87n0zzth5zycuh972w7rdmh48qur4f3wu6ntn2m2h30dlchhlqt3\") (Party (Address \"addr1vywt2xlr4d8yk4qws675exlqy6pdhq2s76wrehkjggkvr0czta9gx\")) (Token \"ecc8ad61b973946ee1cc666b259acabb3edf38a73f1b8779d93ba28a\" \"Swan\") (Constant 500) Close))) ] 1664414983000 Close)) ] 1664371783000 Close\n```\n#### marlowe_lang_cli decoding redeemer / input actions\n```text \n./marlowe_lang redeemer from-string 9fd8799fd8799fd8799fd87a80d8799fd8799f581c1cb51be3ab4e4b540e86bd4c9be02682db8150f69c3cded2422cc1bfffd87a80ffffd8799fd87a80d8799fd8799f581c1cb51be3ab4e4b540e86bd4c9be02682db8150f69c3cded2422cc1bfffd87a80ffffd8799f581ca7f7e57db27c9e2f80c205ccb30f73e57f0ee8fc21aff7b86b5daf7845476c6f6265ff19012cffffff cbor-hex marlowe-dsl\n\nRESULT:\n (Deposit (Address \"addr1vywt2xlr4d8yk4qws675exlqy6pdhq2s76wrehkjggkvr0czta9gx\") (Address \"addr1vywt2xlr4d8yk4qws675exlqy6pdhq2s76wrehkjggkvr0czta9gx\") (Token \"a7f7e57db27c9e2f80c205ccb30f73e57f0ee8fc21aff7b86b5daf78\" \"Globe\") 300)\n```\n\n#### marlowe_lang_cli query contract for expected inputs\n```\nmarlowe_lang_clicontract from-file .\\test_data\\swap.marlowe marlowe-dsl expected-actions -i \"Timeout for Ada deposit=9999999999,Amount of Ada=4994,Amount of dollars=99,Timeout for dollar deposit=994\"`\n```\n\n    Log output:\n    --\u003e INITIALIZED BY MARLOWE LANG STATE MACHINE AT 1672581873\n    --\u003e Processing When contract\n\n**Result (current contract state):**\n```json\n{\n  \"WaitingForInput\": [\n    {\n      \"Deposit\": {\n        \"who_is_expected_to_pay\": {\n          \"role_token\": \"Ada provider\"\n        },\n        \"expected_asset_type\": {\n          \"token_name\": \"\",\n          \"currency_symbol\": \"\"\n        },\n        \"expected_amount\": {\n          \"and\": 4994,\n          \"add\": 1000000\n        },\n        \"expected_target_account\": {\n          \"account\": {\n            \"role_token\": \"Ada provider\"\n          }\n        },\n        \"continuation\": {\n          \"when\": [\n            ... // removed from example output for brevity \n          ],\n          \"timeout_continuation\": \"close\",\n          \"timeout\": 994\n        }\n      }\n    }\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folofblomqvist%2Fmarlowe-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folofblomqvist%2Fmarlowe-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folofblomqvist%2Fmarlowe-rs/lists"}