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:

Java Script

  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.

JS

  1. Click Compile to convert this contract from Javascript into Marlowe.

  2. Then click Send to Simulator in the top right-hand corner.

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

© IOHK 2015 - 2022


Cardano Logo

Cardano is an open-source project.

Cardano is a software platform ONLY and does not conduct any independent diligence on, or substantive review of, any blockchain asset, digital currency, cryptocurrency or associated funds. You are fully and solely responsible for evaluating your investments, for determining whether you will exchange blockchain assets based on your own judgement, and for all your decisions as to whether to exchange blockchain assets with Cardano. In many cases, blockchain assets you exchange on the basis of your research may not increase in value, and may decrease in value. Similarly, blockchain assets you exchange on the basis of your research may fall or rise in value after your exchange.

Past performance is not indicative of future results. Any investment in blockchain assets involves the risk of loss of part or all of your investment. The value of the blockchain assets you exchange is subject to market and other investment risks