@marlowe.io/language-core-v1
Advanced tools
Comparing version 0.2.0-alpha-3 to 0.2.0-alpha-4
@@ -1,42 +0,6 @@ | ||
import { l as lib, g as getDefaultExportFromCjs, _ as _function } from './index-ca7ac053.js'; | ||
import { C as Close } from './close-76c8b0ab.js'; | ||
export { c as close } from './close-76c8b0ab.js'; | ||
import { O as Observation, V as ValueId, a as Value, A as AccountId, C as ChoiceId } from './account-c787daee.js'; | ||
export { b as Accounts } from './account-c787daee.js'; | ||
import { C as Choice } from './choice-630ae815.js'; | ||
import { P as Party } from './party-2b7ee6d1.js'; | ||
import { T as Token } from './token-e1a1eafb.js'; | ||
export { P as PolicyId, a as TokenName, b as token, t as tokenToString } from './token-e1a1eafb.js'; | ||
export { TokenValue, adaValue, tokenValue } from './tokenValue.js'; | ||
import { g as getDefaultExportFromCjs, l as lib, _ as _function } from './index-c69c741e.js'; | ||
import { V as Value, T as Token, A as AccountId, P as Payee, O as Observation, a as ValueId, b as Action, C as ChoiceId, c as Party, d as adaToken } from './actions-cde491f6.js'; | ||
export { g as PolicyId, e as TokenName, l as lovelaceToken, r as role, f as token, t as tokenToString } from './actions-cde491f6.js'; | ||
import { ISO8601, datetoIso8601 } from '@marlowe.io/adapter/time'; | ||
const Assert = lib.recursion("Assert", () => lib.type({ assert: Observation, then: Contract })); | ||
const If = lib.recursion("If", () => lib.type({ if: Observation, then: Contract, else: Contract })); | ||
const Let = lib.recursion("Let", () => lib.type({ let: ValueId, be: Value, then: Contract })); | ||
const Payee = lib.union([ | ||
lib.type({ account: AccountId }), | ||
lib.type({ party: Party }), | ||
]); | ||
const Pay = lib.recursion("Pay", () => lib.type({ | ||
pay: Value, | ||
token: Token, | ||
from_account: AccountId, | ||
to: Payee, | ||
then: Contract, | ||
})); | ||
const Deposit = lib.recursion("Deposit", () => lib.type({ | ||
party: Party, | ||
deposits: Value, | ||
of_token: Token, | ||
into_account: AccountId, | ||
})); | ||
const Notify = lib.recursion("Notify", () => lib.type({ notify_if: Observation })); | ||
const Action = lib.recursion("Action", () => lib.union([Deposit, Choice, Notify])); | ||
var getUnixTime$1 = {exports: {}}; | ||
@@ -220,2 +184,14 @@ | ||
const close = "close"; | ||
const Close = lib.literal("close"); | ||
const Pay = lib.recursion("Pay", () => lib.type({ | ||
pay: Value, | ||
token: Token, | ||
from_account: AccountId, | ||
to: Payee, | ||
then: Contract, | ||
})); | ||
const If = lib.recursion("If", () => lib.type({ if: Observation, then: Contract, else: Contract })); | ||
const Let = lib.recursion("Let", () => lib.type({ let: ValueId, be: Value, then: Contract })); | ||
const Assert = lib.recursion("Assert", () => lib.type({ assert: Observation, then: Contract })); | ||
const When = lib.recursion("When", () => lib.type({ | ||
@@ -229,8 +205,5 @@ when: lib.array(Case), | ||
const datetoTimeout = (date) => _function.pipe(date, getUnixTime, (a) => a * 1000, BigInt, (a) => a.valueOf()); | ||
const timeoutToDate = (timeout) => new Date(Number(timeout)); | ||
const Contract = lib.recursion("Contract", () => lib.union([Close, Pay, If, When, Let, Assert])); | ||
const inputNotify = "input_notify"; | ||
const InputNotify = lib.literal("input_notify"); | ||
const ChosenNum = lib.bigint; | ||
@@ -241,3 +214,2 @@ const InputChoice = lib.type({ | ||
}); | ||
const InputDeposit = lib.type({ | ||
@@ -249,3 +221,4 @@ input_from_party: Party, | ||
}); | ||
const inputNotify = "input_notify"; | ||
const InputNotify = lib.literal("input_notify"); | ||
const BuiltinByteString = lib.string; | ||
@@ -263,2 +236,27 @@ const InputContent = lib.union([InputDeposit, InputChoice, InputNotify]); | ||
export { Action, Assert, BuiltinByteString, Close, Contract, If, Input, Let, Pay, Token, Value, When, datetoTimeout, inputNotify }; | ||
const Account = lib.tuple([lib.tuple([AccountId, Token]), lib.bigint]); | ||
const Accounts = lib.array(Account); | ||
const MarloweState = lib.type({ | ||
accounts: Accounts, | ||
boundValues: lib.array(lib.tuple([ValueId, lib.bigint])), | ||
choices: lib.array(lib.tuple([ChoiceId, lib.bigint])), | ||
minTime: lib.bigint, | ||
}); | ||
const TokenValue = lib.type({ amount: lib.bigint, token: Token }); | ||
const tokenValue = (amount) => (token) => ({ amount: amount, token: token }); | ||
const adaValue = (adaAmount) => ({ | ||
amount: adaAmount * 1000000n, | ||
token: adaToken, | ||
}); | ||
const mkEnvironment = (start) => (end) => ({ | ||
validityStart: datetoIso8601(start), | ||
validityEnd: datetoIso8601(end), | ||
}); | ||
const Environment = lib.type({ | ||
validityStart: ISO8601, | ||
validityEnd: ISO8601, | ||
}); | ||
export { Accounts, Action, Assert, BuiltinByteString, Case, Close, Contract, Environment, If, Input, Let, MarloweState, Party, Pay, Timeout, Token, TokenValue, Value, When, adaToken, adaValue, close, datetoTimeout, inputNotify, mkEnvironment, timeoutToDate, tokenValue }; |
@@ -1,2 +0,2 @@ | ||
import { l as lib } from './index-ca7ac053.js'; | ||
import { l as lib } from './index-c69c741e.js'; | ||
@@ -3,0 +3,0 @@ const MarloweVersion = lib.literal("v1"); |
{ | ||
"name": "@marlowe.io/language-core-v1", | ||
"version": "0.2.0-alpha-3", | ||
"version": "0.2.0-alpha-4", | ||
"description": "Library to manipulate Marlowe Core contracts", | ||
@@ -21,5 +21,5 @@ "repository": "https://github.com/input-output-hk/marlowe-ts-sdk", | ||
"type": "module", | ||
"module": "./dist/esm/semantics/contract/index.js", | ||
"main": "./dist/esm/semantics/contract/index.js", | ||
"types": "./dist/esm/semantics/contract/index.d.ts", | ||
"module": "./dist/esm/index.js", | ||
"main": "./dist/esm/index.js", | ||
"types": "./dist/esm/index.d.ts", | ||
"files": [ | ||
@@ -30,42 +30,16 @@ "dist" | ||
".": { | ||
"import": "./dist/esm/semantics/contract/index.js", | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/bundled/cjs/language-core-v1.cjs", | ||
"types": "./dist/esm/semantics/contract/index.d.ts" | ||
"types": "./dist/esm/index.d.ts" | ||
}, | ||
"./next": { | ||
"import": "./dist/esm/semantics/next/index.js", | ||
"import": "./dist/esm/next/index.js", | ||
"require": "./dist/bundled/cjs/next.cjs", | ||
"types": "./dist/esm/semantics/next/index.d.ts" | ||
"types": "./dist/esm/next/index.d.ts" | ||
}, | ||
"./environment": { | ||
"import": "./dist/esm/semantics/environment.js", | ||
"require": "./dist/bundled/cjs/environment.cjs", | ||
"types": "./dist/esm/semantics/environment.d.ts" | ||
}, | ||
"./state": { | ||
"import": "./dist/esm/semantics/state.js", | ||
"require": "./dist/bundled/cjs/state.cjs", | ||
"types": "./dist/esm/semantics/state.d.ts" | ||
}, | ||
"./token": { | ||
"import": "./dist/esm/semantics/contract/common/token.js", | ||
"require": "./dist/bundled/cjs/token.cjs", | ||
"types": "./dist/esm/semantics/contract/common/token.d.ts" | ||
}, | ||
"./tokenValue": { | ||
"import": "./dist/esm/semantics/contract/common/tokenValue.js", | ||
"require": "./dist/bundled/cjs/tokenValue.cjs", | ||
"types": "./dist/esm/semantics/contract/common/tokenValue.d.ts" | ||
}, | ||
"./version": { | ||
"import": "./dist/esm/semantics/version.js", | ||
"import": "./dist/esm/version.js", | ||
"require": "./dist/bundled/cjs/version.cjs", | ||
"types": "./dist/esm/semantics/version.d.ts" | ||
}, | ||
"./examples": { | ||
"import": "./dist/esm/examples/index.js", | ||
"require": "./dist/bundled/cjs/examples.cjs", | ||
"types": "./dist/esm/examples/index.d.ts" | ||
}, | ||
"./contract/*": "./dist/esm/semantics/contract/*.js" | ||
"types": "./dist/esm/version.d.ts" | ||
} | ||
}, | ||
@@ -72,0 +46,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
642596
18500
76
1