New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@marlowe.io/language-core-v1

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@marlowe.io/language-core-v1

Library to manipulate Marlowe Core contracts

  • 0.2.0-alpha-22
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Description

This package contains code to work with the version 1 of Marlowe Core. It exports 5 modules:

  • @{@link index | marlowe.io/language-core-v1} - Exports static types (TypeScript only) for the JSON schema as specified in the Appendix E of the {@link https://github.com/input-output-hk/marlowe/releases/download/v3/Marlowe.pdf | Marlowe specification}
  • @{@link guards | marlowe.io/language-core-v1/guards} - Exports {@link !io-ts-usage | Dynamic type guards} (both JavaScript and TypeScript) for the same schema. These are used to validate the JSON objects at runtime.
  • @{@link next | marlowe.io/language-core-v1/next} - Exports types to ask for next applicable inputs for a Marlowe Contract.
  • @{@link playground-v1 | marlowe.io/language-core-v1/playground-v1} - Exports constructors compatible with the Playground's marlowe-js internal library.
  • @{@link semantics | marlowe.io/language-core-v1/semantics} - Exports the semantics of the Core language as specified in the {@link https://github.com/input-output-hk/marlowe/releases/download/v3/Marlowe.pdf | Marlowe specification}. This can be used to simulate or unit test a contract.

Getting started

This package is released as an ESM module and can be used with a modern bundler or imported directly in the browser (without any bundler) as long as you use an import map.

Browser

<html>
  <body>
    <script src="https://cdn.jsdelivr.net/gh/input-output-hk/marlowe-ts-sdk/jsdelivr-npm-importmap.js"></script>
    <script type="module">
      import { Contract } from "@marlowe.io/language-core-v1/guards";
      const jsonObject = JSON.parse(httpResponse);

      if (Contract.is(jsonObject)) {
        // The jsonObject respects the JSON schema for Contract
      } else {
        // The jsonObject does not respect the JSON schema for Contract
      }
    </script>
  </body>
</html>

FAQs

Package last updated on 23 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc