Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Snippet of getting and using the RUN issuer #468

Closed
katelynsills opened this issue Apr 5, 2021 · 1 comment
Closed

Document Snippet of getting and using the RUN issuer #468

katelynsills opened this issue Apr 5, 2021 · 1 comment

Comments

@katelynsills
Copy link
Contributor

katelynsills commented Apr 5, 2021

Here's a snippet:

  const moneyIssuer = await E(home.agoricNames).lookup('issuer', 'RUN');
  const moneyBrand = await E(moneyIssuer).getBrand();

  const allCardNames = harden(cards);
  const pricePerCard = amountMath.make(10n, moneyBrand);

  const {
    sellItemsPublicFacet: publicFacet,
    sellItemsInstance: instance,
  } = await E(baseballCardSellerFacet).sellCards(
    allCardNames,
    moneyIssuer,
    sellItemsInstallation,
    pricePerCard,
  );

See Agoric/dapp-card-store#18 for more.

The more generalized pattern is:

  const moneyIssuer = await E(home.agoricNames).lookup('issuer', 'RUN');
E(zoe).startInstance(installation, harden({ Money: moneyIssuer }), terms);
@dckc dckc closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants