Agoric / documentation

User documentation
https://agoric.com/documentation/
Apache License 2.0
15 stars 38 forks source link

continuing invitation pattern #667

Open dckc opened 2 years ago

dckc commented 2 years ago

For an NFT ticketing system bounty ( https://github.com/Agoric/agoric-sdk/issues/4657 ) we (@samsiegart , @Chris-Hibbert @kennyrowe, @jeetraut and I) recommended the continuing invitation pattern in office hours. There is essentially no documentation, so we sketched something quick-n-dirty:

https://gist.github.com/dckc/9c393be1bd5a147f72c6b42ca12a1aa2#continuing-invitation-pattern

dckc commented 2 years ago

See also plans for more direct support for ocaps in the wallet https://github.com/Agoric/agoric-sdk/issues/3901

Tyrosine22 commented 1 year ago

If I understand this correctly, this will probably be taken care of when I document continuing offers. (#759)

Note: There's a very good chance I don't understand this correctly, but I have higher priority things in my queue. I'll update this bug when I have time to properly investigate.

dckc commented 1 year ago

Yes, it looks like #759 should be closed as a dup of this.

dckc commented 7 months ago

recent discussion reminded us of the somewhat canonical example in the vaults contract:

https://github.com/Agoric/agoric-sdk/blob/5dc325b8cc1d94f46ecc18a7c67a14989feade11/packages/inter-protocol/src/vaultFactory/vaultHolder.js#L73C1-L83C9

dckc commented 3 months ago

closed in #999

dckc commented 6 days ago

in office hours today... thanks Jorge...

---
title: Continuing Invitation
---
sequenceDiagram
    actor c as client
    participant sw as swartWallet
    participant i as invitations

    c ->> sw: { id: offer1, source: 'purse' }
    sw -->> sw: withdraw inv1
    sw -->> zoe: offer(inv1, ...)
    zoe -->> sw: seat1
    create participant seat1
    sw -->> seat1: getOfferResult()
    seat1 -->> sw: invitationMakers1

    note over c, sw :  offerSpec:  { id, invitationSpec, proposal, offerArgs }
    note over c, sw :  invitationSpec:  { source: 'continuing', previousOffer: offer1, invitationMakerName: 'AdjustVault', invitationArgs}
    c ->> sw : executeOffer(offerSpec) 
    sw ->> i : makeInvitationsHelper()
    i -->> sw : invitationFromSpec
    sw ->> i : invitationFromSpec(offerSpec.invitationSpec)
    i ->> i : spec.source === 'continuing' 
    i ->> sw : getInvitationContinuation(previousOffer)
    sw ->> sw : offerToInvitationMakers.get(previousOffer)
    sw -->> i : invitationMakers1
    create participant im as invitationMakers1
    i ->> im : invitationMakerName(invitationArgs)
    im -->> sw : invitation