import * as t from "io-ts/lib/index.js"; import { AssocMap, Sort } from "@marlowe.io/adapter/assoc-map"; import { AccountId } from "./payee.js"; import { ValueId } from "./value-and-observation.js"; import { Token } from "./token.js"; import { ChoiceId } from "./choices.js"; export type Account = t.TypeOf; export declare const Account: t.TupleC<[t.TupleC<[t.UnionC<[t.Type, t.Type]>, t.Type]>, t.BigIntC]>; /** * The Marlowe model allows for a contract to store assets. All participants of the contract implicitly * own an account identified with an AccountId. * * All assets stored in the contract must be in an internal account for one of the parties; this way, * when the contract is closed, all remaining assets can be redeemed by their respective owners. * These accounts are local: they only exist (and are accessible) within the contract. * @category State * @see Section 2.1.3 of the {@link https://github.com/input-output-hk/marlowe/releases/download/v3/Marlowe.pdf | Marlowe spec} */ export type Accounts = AssocMap<[AccountId, Token], bigint>; /** * {@link !io-ts-usage | Dynamic type guard} for the {@link Accounts | accounts type}. * @category State */ export declare const AccountsGuard: t.Type; /** * Sorting function for Accounts * @hidden */ export declare function accountsCmp(a: [AccountId, Token], b: [AccountId, Token]): Sort; /** * The state of a Marlowe Contract is stored in the blockchain and contains the information required to move the contract * forward via computeTransaction * @see Section 2.1.8 and appendix E.14 of the {@link https://github.com/input-output-hk/marlowe/releases/download/v3/Marlowe.pdf | Marlowe spec} * @category State */ export interface MarloweState { /** * @inheritdoc Accounts */ accounts: Accounts; /** * This is a Map of the values that were bound to the contract using the {@link Let} construct. */ boundValues: AssocMap; /** * This is a Map of the choices that were made by the participants of the contract using the {@link Choice} action. */ choices: AssocMap; /** * Transactions have a validity time interval `(startTime, endTime)` which gives us a proxy for real time. * It is up to the blockchain implementation to make sure that `startTime <= now <= endTime`. The variable * `minTime` is the biggest known `startTime`. That allow us to trim a time interval and ensure that * `startTime` does not decrease between transactions. */ minTime: bigint; } /** * {@link !io-ts-usage | Dynamic type guard} for the {@link MarloweState | state type}. * @see Section 2.1.8 and appendix E.14 of the {@link https://github.com/input-output-hk/marlowe/releases/download/v3/Marlowe.pdf | Marlowe spec} * @category State */ export declare const MarloweStateGuard: t.Type; //# sourceMappingURL=state.d.ts.map