Using the Javascript Editor

You can use the embedded JavaScript editor to write Marlowe code.

To use the editor follow these steps:

  1. Open the Marlowe Playground.
  2. Click Start coding! and select Javascript from the menu.

You will see a window like this: 

  1. You can import values and functions from the provided library written in TypeScript. They can be used to generate Marlowe smart contracts from TypeScript or JavaScript.
  2. Describe a contract in the editor, alternatively, you can upload an example written in JavaScript. The last expression in the file needs to be of type Contract: below we define the top-level constant contract to be of that type. 
  3. Click Compile to convert this contract from Javascript into Marlowe.
  4. Then click Send to Simulator in the top right-hand corner.

You can also find more details about simulation in the Marlowe tutorial.

 

 

Find official copy of this document here:

https://docs.cardano.org/en/latest/marlowe/get-started-js.html

 

© Copyright 2020, IOHK Revision d7c21086.

 

Find this document translated into other languages at: http://CardanoForTheWorld.com