UNPKG

@agoric/zoe

Version:

Zoe: the Smart Contract Framework for Offer Enforcement

34 lines 1.75 kB
/** * `isOfferSafe` checks offer safety for a single offer. * * Note: This implementation checks whether we fully satisfy * `proposal.give` (giving a refund) or whether we fully satisfy * `proposal.want`. Both can be fully satisfied. * * @param {ProposalRecord} proposal - the rules that accompanied the * escrow of payments that dictate what the user expected to get back * from Zoe. A proposal is a record with keys `give`, `want`, and * `exit`. `give` and `want` are records with keywords as keys and * amounts as values. The proposal is a user's understanding of the * contract that they are entering when they make an offer. * @param {AmountKeywordRecord} allocation - a record with keywords * as keys and amounts as values. These amounts are the reallocation * to be given to a user. */ export function isOfferSafe(proposal: ProposalRecord, allocation: AmountKeywordRecord): boolean; /** * For this allocation to satisfy what the user wanted, their * allocated amounts must be greater than or equal to proposal.want. * * @param {ProposalRecord} proposal - the rules that accompanied the * escrow of payments that dictate what the user expected to get back * from Zoe. A proposal is a record with keys `give`, `want`, and * `exit`. `give` and `want` are records with keywords as keys and * amounts as values. The proposal is a user's understanding of the * contract that they are entering when they make an offer. * @param {AmountKeywordRecord} allocation - a record with keywords * as keys and amounts as values. These amounts are the reallocation * to be given to a user. */ export function satisfiesWant(proposal: ProposalRecord, allocation: AmountKeywordRecord): 0 | 1; //# sourceMappingURL=offerSafety.d.ts.map