Created
November 5, 2019 22:09
-
-
Save katelynsills/cae96071b38213516c29c04975491564 to your computer and use it in GitHub Desktop.
Mint and get exclusive payment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Alice withdraws a payment for Bob from her purse. | |
import { makeMint } from '@agoric/ertp/core/mint'; | |
const bucksMint = makeMint('bucks'); | |
const purse = bucksMint.mint(1000, `alice's purse`); | |
const paymentForBob = purse.withdraw(10, `bob's money`); | |
// The particular methods of the bobsAgent object are up to Bob. | |
bobsAgent.receivePayment(paymentForBob); | |
// Bob receives an alleged payment from Alice. | |
// Bob claims it exclusively and validates it | |
// using an assay he had gotten independently. | |
const exclusivePayment = bucksAssay.claimAll(allegedPaymentFromAlice); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment