This module offers dynamic type guards for the for the JSON schema of marlowe-objects.

import * as G from "@marlowe/marlowe-objects/guards"

const jsonObject = JSON.parse(fileContents)

if (G.ContractBundleMap.is(jsonObject)) {
// console.log("Object is a bundle")
// console.log("entry contract is ", jsonObject.main)
//...
} else {
// console.error(...)
}

Index

Annotation

Object

Contract

Observation

Action

Value

Payee

Party

Token

Choice

General