Marlowe Lang

crates.io Documentation BuildAndTest

An experimental Rust implementation of the Marlowe DSL for Cardano smart (financial) contracts. It allows you to create Marlowe contracts from Rust rather than using Marlowe directly.

It is used by the MarloweLSP VSCode Extention (Syntax highlighting for Marlowe in VSCode).

Main Features

Disclaimers

Example usage

```rust use marlowelang::types::marlowe::*; use marlowelang::parsing::{ deserialization::deserialize, serialization::serialize, };

let mycontract = Contract::When { cases: vec![ Some(Case { action: Some(Action::Notify { notifyif: Some(Observation::TrueObs) }), contract: Some(Contract::Close.boxed()) } ) ], timeout: Some(imeout::TimeParam("test".into())), timeout_continuation: Some(Contract::Close.boxed()), };

let serialized = serialize(my_contract); let deserialized : Contract = deserialize(&serialized).unwrap(); println!("{serialized}"); ```

Where 'println!("{serialized}")' would output this:

text When [ Case (Notify (TrueObs)) Close ] (TimeParam "test") Close