open-index/open-npm huggingface dataset:
npm package: @marlowe.io/language-core-v1
Description: Library to manipulate Marlowe Core contracts
Latest version: 0.4.0-beta

# 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 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](https://github.com/input-output-hk/marlowe-ts-sdk/blob/main/doc/modules-system.md) 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
<html>
  <body>
    <script src="https://cdn.jsdelivr.net/gh/input-output-hk/marlowe-ts-sdk@0.4.0-beta/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>
```
npm package: @marlowe.io/language-specification-client
Description: Client for the Marlowe Specification compliance test
Latest version: 0.4.0-beta

# Language Core Specification Client

This package contains a client that is used by the [Marlowe spec test](https://github.com/input-output-hk/marlowe/tree/master/marlowe-spec-test) to test that the implementation of `@marlowe.io/language-core-v1` is compliant with the Marlowe Core Specification.

## Usage

```bash
$ nix develop
[nix-shell] $ npm run build
[nix-shell] $ test-spec
```
npm package: @marlowe.io/marlowe-object
Description: Large contract support
Latest version: 0.4.0-beta

# Description

The `marlowe-object` package is an extension of {@link @marlowe.io/language-core-v1!} that allows for referencing {@link index.Party}, {@link index.Value}, {@link index.Observation}, {@link index.Token}, {@link index.Contract}, and {@link index.Action} types in a bundle. This approach flattens the tree structure a bit and allows reusability.

This package exposes a {@link index | main module} with the extended constructs and two modules to bundle them, {@link bundle-list} and {@link bundle-map}. Both bundle types provide the same information but are useful in different contexts. {@link bundle-list.ContractBundleList} is the type expected by the runtime and is used in the {@link @marlowe.io/runtime-rest-client!index.RestClient#createContractSources} of the {@link @marlowe.io/runtime-rest-client!} package. On the other hand, {@link bundle-map.ContractBundleMap} is more ergonomic for developers as it is order-independent and is used when creating source maps to have `O(1)` access. You can convert between the different bundle types using {@link index.bundleMapToList} or {@link index.bundleListToMap}.

While you can manually define a contract using {@link bundle-list.ContractBundleList} or {@link bundle-map.ContractBundleMap}, the primary intention of this package is to serve as the output of a higher-level abstraction, potentially even a new language that compiles to Marlowe. The name `marlowe-object` is inspired by the `.o` files generated when you compile a `.c` file, with {@link @marlowe.io/runtime-rest-client!index.RestClient#createContractSources} acting as a linker.

This package also simplifies the creation of large contracts. A Marlowe contract is a Tree structure, and if the tree is big enough it won't fit on the blockchain. To solve that, the Marlowe Core specification has a concept called [Merkleization](https://docs.marlowe.iohk.io/docs/platform-and-architecture/large-contracts), which represents large contracts as a Merkle tree's. The splitting and hashing of a large contract into a Merkle Tree is done through the runtime calls ({@link @marlowe.io/runtime-rest-client!index.RestClient#createContractSources}), and we use `marlowe-object` to define the large contract in a more approachable way.

The `marlowe-object` package also extends the core types with the ability to {@link index.Annotated | annotate contract nodes}. This can simplify UI development by tagging nodes with information that can be used to infere a logical state and also allow source mapping from a higer level language.
npm package: @marlowe.io/runtime-lifecycle
Description: Entry Point for Running remotely Marlowe Contracts over a backend instance of the runtime using a connected wallet.
Latest version: 0.4.0-beta

# Description

The Marlowe Lifecycle package contains code to query, create and interact with the Marlowe Contracts associated with a given wallet. In other words, it let you interact with "your" contracts.

The main exported type is the {@link api.RuntimeLifecycle} API which can be constructed {@link index | from a wallet API instance } or {@link browser | using a wallet name in the browser}.
npm package: @marlowe.io/runtime-rest-client
Description: Client of Runtime REST API
Latest version: 0.4.0-beta

# Description

The `runtime-rest-client` package provides a JS API to interact with the [runtime REST API](https://docs.marlowe.iohk.io/api/introduction). It is intended to work with version `0.0.5` of the API.

The main {@link index | module} exposes the {@link index.mkRestClient} function, which returns an instance of a {@link index.RestClient}.

## Getting started

The `@marlowe.io/runtime-rest-client` package is [released as an ESM module](https://github.com/input-output-hk/marlowe-ts-sdk/blob/main/doc/modules-system.md) 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

Instantiating a client requires a runtime URL to the desired network which can either be self hosted with instructions in [Marlowe starter kit](https://github.com/input-output-hk/marlowe-starter-kit/blob/main/docs/preliminaries.md) or through a service such as [Demeter](https://docs.demeter.run/extensions/marlowe-runtime).

The caller should run a `healthcheck` to ensure the runtime service is healthy throughout the lifecycle of the client.

```html
<html>
  <body>
    <script src="https://cdn.jsdelivr.net/gh/input-output-hk/marlowe-ts-sdk@0.4.0-beta/jsdelivr-npm-importmap.js"></script>
    <script type="module">
      import { mkRestClient } from "@marlowe.io/runtime-rest-client";

      let runtimeURL = process.env.MARLOWE_RUNTIME_URL;

      const client = mkRestClient(runtimeURL);
      const hasValidRuntime = await client.healthcheck();

      if (!hasValidRuntime) throw new Error("Invalid Marlowe Runtime instance");
    </script>
  </body>
</html>
```
npm package: @marlowe.io/wallet
Description: Cardano Wallet Capabalities for Marlowe specific environment
Latest version: 0.4.0-beta

# Description

This package provides wallet functionality for the rest of the SDK packages.

It has the following modules:

- @{@link api | marlowe.io/wallet/api}: provides an abstract interface to work with a wallet.
- @{@link browser | marlowe.io/wallet/browser}: provides a browser implementation of the api using the [CIP30 specification](https://cips.cardano.org/cips/cip30/).
- @{@link lucid | marlowe.io/wallet/lucid}: provides a implementation of the api that can work in the browser, node.js and deno using [Lucid](https://github.com/spacebudz/lucid).
- @{@link index | marlowe.io/wallet}: Re-exports of the other modules.

[comment]: # "nodejs: provides a server implementation of the api using Lucid NOTE: the underlying library might be replaced in the future - for the momment disabled until we discuss the Node module"

## Getting started

The `@marlowe.io/wallet` package is [released as an ESM module](https://github.com/input-output-hk/marlowe-ts-sdk/blob/main/doc/modules-system.md) 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
<html>
  <body>
    <script src="https://cdn.jsdelivr.net/gh/input-output-hk/marlowe-ts-sdk@0.4.0-beta/jsdelivr-npm-importmap.js"></script>
    <script type="module">
      import { mkBrowserWallet, getInstalledWalletExtensions } from "@marlowe.io/wallet";

      const installedWalletExtensions = getInstalledWalletExtensions();
      console.log(`Available Browser Wallet Extensions: ${installedWalletExtensions}`);
      const wallet = await mkBrowserWallet(installedWalletExtensions[0]);
    </script>
  </body>
</html>
```

## Examples

There is a simple HTML file in the [examples folder](https://github.com/input-output-hk/marlowe-ts-sdk/blob/main/examples/wallet-flow/index.html) that shows how to use the wallet package to connect to a wallet extension and get basic info.