UNPKG

@agoric/zoe

Version:

Zoe: the Smart Contract Framework for Offer Enforcement

42 lines 1.65 kB
/** * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; */ /** * SimpleExchange is an exchange with a simple matching algorithm, which allows * an unlimited number of parties to create new orders or accept existing * orders. The notifier allows callers to find the current list of orders. * https://agoric.com/documentation/zoe/guide/contracts/simple-exchange.html * * The SimpleExchange uses Asset and Price as its keywords. The contract treats * the two keywords symmetrically. New offers can be created and existing offers * can be accepted in either direction. * * { give: { 'Asset', simoleans(5n) }, want: { 'Price', quatloos(3) } } * { give: { 'Price', quatloos(8) }, want: { 'Asset', simoleans(3n) } } * * The Asset is treated as an exact amount to be exchanged, while the * Price is a limit that may be improved on. This simple exchange does * not partially fill orders. * * The publicFacet is returned from the contract. * * @param {ZCF} zcf */ export function start(zcf: ZCF): { publicFacet: { makeInvitation: () => Promise<Invitation<unknown, never>>; getNotifier: () => globalThis.Notifier<{ buys: any; sells: any; }>; } & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, { makeInvitation: () => Promise<Invitation<unknown, never>>; getNotifier: () => globalThis.Notifier<{ buys: any; sells: any; }>; }>; }; import type { ZCF } from '@agoric/zoe'; import type { Invitation } from '@agoric/zoe'; //# sourceMappingURL=simpleExchange.d.ts.map