Skip to content

Commit

Permalink
chore: inline makeTradeInvitation function
Browse files Browse the repository at this point in the history
  • Loading branch information
amessbee committed Jan 9, 2025
1 parent fe3e965 commit 1bc346c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions contract/src/offer-up.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import { makeDurableZone } from '@agoric/zone/durable.js';

const { Fail, quote: q } = assert;


// #region bag utilities
/** @type { (xs: bigint[]) => bigint } */
const sum = xs => xs.reduce((acc, x) => acc + x, 0n);
Expand Down Expand Up @@ -135,19 +134,10 @@ export const start = async (zcf, _privateArgs, baggage) => {
return 'trade complete';
};

/**
* Make an invitation to trade for items.
*
* Proposal Keywords used in offers using these invitations:
* - give: `Price`
* - want: `Items`
*/
const makeTradeInvitation = () =>
zcf.makeInvitation(tradeHandler, 'buy items', undefined, proposalShape);

// Use zone.exo to make a publicFacet suitable for use by remote callers.
const publicFacet = zone.exo('Items Public Facet', undefined, {
makeTradeInvitation,
makeTradeInvitation: () =>
zcf.makeInvitation(tradeHandler, 'buy items', undefined, proposalShape),
});
return harden({ publicFacet });
};
Expand Down

0 comments on commit 1bc346c

Please sign in to comment.