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).
This crate was created as a learning exercise and should not be trusted anywhere near a production environment at this time.
It is a side-project and might be dropped completely at any time (it may already be dead!)
The pest.rs grammar file is just an initial attempt to make sense of the language from a high level. It will likely have to be rebuilt from the ground up when Marlowe v3 is official.
```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}"); ```
text
When [ Case (Notify (TrueObs)) Close ] (TimeParam "test") Close