import { inBounds } from "./choices.js"; import { Contract } from "./contract.js"; import { Environment } from "./environment.js"; import { Input } from "./inputs.js"; import { MarloweState } from "./state.js"; import { AmbiguousTimeIntervalError, ApplyNoMatchError, AssertionFailed, HashMismatchError, NonPositivePay, PartialPay, Payment, Shadowing, SingleInputTx, Transaction, TransactionOutput, TransactionWarning } from "./transaction.js"; import { Observation, Value } from "./value-and-observation.js"; import { POSIXTime } from "@marlowe.io/adapter/time"; export { Payment, Transaction, SingleInputTx, NonPositiveDeposit, NonPositivePay, PartialPay, Shadowing, AssertionFailed, TransactionWarning, InvalidInterval, IntervalInPast, IntervalError, AmbiguousTimeIntervalError, ApplyNoMatchError, UselessTransaction, HashMismatchError, TEIntervalError, TransactionError, TransactionSuccess, TransactionOutput, } from "./transaction.js"; export { inBounds }; /** * * @param env * @param state * @param value * @returns * @category Evaluation */ export declare function evalValue(env: Environment, state: MarloweState, value: Value): bigint; /** * * @param env * @param state * @param obs * @returns * @category Evaluation */ export declare function evalObservation(env: Environment, state: MarloweState, obs: Observation): boolean; /** * TODO: Comment * @category Transaction Warning */ export type NoWarning = "NoWarning"; /** * TODO: Comment * @category Transaction Warning */ export type ReduceWarning = NoWarning | NonPositivePay | PartialPay | Shadowing | AssertionFailed; /** * @hidden */ export type ContractQuiescentReduceResult = { type: "ContractQuiescent"; reduced: boolean; state: MarloweState; warnings: ReduceWarning[]; payments: Payment[]; continuation: Contract; }; /** * @hidden */ type ReduceResult = ContractQuiescentReduceResult | AmbiguousTimeIntervalError; /** * @hidden */ export declare function reduceContractUntilQuiescent(env: Environment, state: MarloweState, cont: Contract): ReduceResult; export declare function convertReduceWarning(warnings: ReduceWarning[]): TransactionWarning[]; type ApplyAllSuccess = { type: "ApplyAllSuccess"; contractChanged: boolean; warnings: TransactionWarning[]; payments: Payment[]; state: MarloweState; continuation: Contract; }; declare const ApplyAllSuccess: (obj: { contractChanged: boolean; warnings: TransactionWarning[]; payments: Payment[]; state: MarloweState; continuation: Contract; }) => ApplyAllSuccess; type ApplyAllResult = ApplyAllSuccess | ApplyNoMatchError | AmbiguousTimeIntervalError | HashMismatchError; /** * @hidden */ export declare function applyAllInputs(env: Environment, state: MarloweState, cont: Contract, inputs: Input[]): ApplyAllResult; /** * Given a {@link Contract} in a {@link MarloweState | State}, `computeTransaction` will * apply a {@link Transaction} to move the contract forward, returning the new state and the contract * continuation, along with any {@link TransactionWarning | warnings} and {@link Payment | payments} that may be generated. * * This function is called on the blockchain as part of the transaction validation, and can * be used to simulate the execution of a contract. * @param tx The transaction to apply * @param state The current state * @param cont The current contract * @returns Wether the transaction was successful or not and the new state of the contract. * @category Evaluation */ export declare function computeTransaction(tx: Transaction, state: MarloweState, cont: Contract): TransactionOutput; /** * Creates an empty {@link MarloweState} using the given minimum time. * @param minTime A known time in the past. * @category Evaluation */ export declare function emptyState(minTime: POSIXTime): MarloweState; /** * While {@link computeTransaction} can move a contract forward with a single transaction * from a previous state, `playTrace` is used to simulate the execution of a contract from the * start, using a list of transactions. * * `playtrace` calls {@link computeTransaction} for each transaction in the list, accumulating * the warnings and payments generated by each transaction. If a transaction fails, the error * is returned. If all the transaction succeed, the resulting state and contract are returned * along with the accumulated warnings and payments. * * @param initialTime Time when the execution of the contract starts. * @param contract The contract to trace. * @param transactions The list of transactions to apply. * @returns The resulting state and contract, along with the accumulated warnings and payments or a {@link TransactionError}. * @category Evaluation */ export declare function playTrace(initialState: MarloweState, contract: Contract, transactions: Transaction[]): TransactionOutput; export declare function playSingleInputTxTrace(initialState: MarloweState, contract: Contract, transactions: SingleInputTx[]): TransactionOutput; //# sourceMappingURL=semantics.d.ts.map