UNPKG

@agoric/zoe

Version:

Zoe: the Smart Contract Framework for Offer Enforcement

78 lines 3.28 kB
/** * NOT TO BE USED IN PRODUCTION CODE. BIDS ARE PUBLIC. An auction * contract in which the seller offers an Asset for sale, and states a * minimum price. The auction closes at the deadline specified by the * timeAuthority, bidDuration, winnerPriceOption parameters in the terms provided by * the creator of the contract instance. * Winner price option can be `first-price` or `second-price`, default to `second-price`. * * startInstance() specifies the issuers and the terms. An invitation * for the seller is returned as the creatorInvitation. The seller's * offer should look like { give: { Asset: asset }, want: { Ask: * minimumBidAmount}} The asset can be non-fungible, but the Ask * amount should be of a fungible brand. The bidder invitations can be * made by calling makeBidInvitation on the object returned from the * seller's offer. Each bidder can submit an offer: { give: { Bid: * null } want: { Asset: null } }. * * @param {ZCF<{ * timeAuthority: import('@agoric/time').TimerService, * winnerPriceOption?: FIRST_PRICE | SECOND_PRICE, * bidDuration: bigint, * }>} zcf */ export function start(zcf: ZCF<{ timeAuthority: import("@agoric/time").TimerService; winnerPriceOption?: "first-price" | "second-price"; bidDuration: bigint; }>): { creatorInvitation: Promise<globalThis.Invitation<{ makeBidInvitation: () => Promise<globalThis.Invitation<unknown, never>>; getSessionDetails: () => { auctionedAssets: any; minimumBid: any; winnerPriceOption: string; closesAfter: any; bidDuration: bigint; timeAuthority: import("@agoric/time").TimerService; bids: string | any[]; }; } & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, { makeBidInvitation: () => Promise<globalThis.Invitation<unknown, never>>; getSessionDetails: () => { auctionedAssets: any; minimumBid: any; winnerPriceOption: string; closesAfter: any; bidDuration: bigint; timeAuthority: import("@agoric/time").TimerService; bids: string | any[]; }; }>, undefined>>; publicFacet: { getCurrentBids: () => any[] | "Bids are hidden for \"second price\" auctions"; getSessionDetails: () => { auctionedAssets: any; minimumBid: any; winnerPriceOption: string; closesAfter: any; bidDuration: bigint; timeAuthority: import("@agoric/time").TimerService; bids: string | any[]; }; } & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, { getCurrentBids: () => any[] | "Bids are hidden for \"second price\" auctions"; getSessionDetails: () => { auctionedAssets: any; minimumBid: any; winnerPriceOption: string; closesAfter: any; bidDuration: bigint; timeAuthority: import("@agoric/time").TimerService; bids: string | any[]; }; }>; }; export const FIRST_PRICE: "first-price"; export const SECOND_PRICE: "second-price"; //# sourceMappingURL=index.d.ts.map