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

handle invitation offer results in smart wallet #8550

Open
dckc opened this issue Nov 20, 2023 · 2 comments
Open

handle invitation offer results in smart wallet #8550

dckc opened this issue Nov 20, 2023 · 2 comments
Labels
enhancement New feature or request wallet

Comments

@dckc
Copy link
Member

dckc commented Nov 20, 2023

What is the Problem Being Solved?

A normal pattern in Zoe contracts is, as in Atomic Swap:

const invitationP = aliceSeat.getOfferResult();

But the current walletFactory doesn't know to put that in the invitation purse.

Its only support for offer results is

  • if it's primitive data (string, number, ...) put it in vstorage
  • if it has invitationMakers, keep it around for continuing invitations

Description of the Design

Use E(invitationIssuer).getAmountOf(offerResult) to see if an offer result is an invitation; if so, put it in the invitation purse.

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

@dckc dckc added enhancement New feature or request wallet labels Nov 20, 2023
@dtribble
Copy link
Member

dtribble commented Nov 27, 2023

Since in some scenarios, you might want an invitation back and some continuing invitations, perhaps this. should just extend the continuing invitation pattern with an additional category of direct invitations.

@dckc
Copy link
Member Author

dckc commented Jun 20, 2024

In Jun 12 office hours, I talked with @Jovonni and co about...

~/projects/agoric-sdk/packages/smart-wallet
11:48 connolly@bldbox$ git diff .
diff --git a/packages/smart-wallet/src/offerWatcher.js b/packages/smart-wallet/src/offerWatcher.js
index 3b2bc004f..6994d6dbd 100644
--- a/packages/smart-wallet/src/offerWatcher.js
+++ b/packages/smart-wallet/src/offerWatcher.js
@@ -191,6 +191,11 @@ export const prepareOfferWatcher = baggage => {
               }
               facets.helper.updateStatus({ result: UNPUBLISHED_RESULT });
               break;
+              case 'remotable':{
+                const amt = await E(invitationIssuer).getAmountOf(result); // isLivePayment?
+                await E(invitationPurse).deposit(result)
+              }
+
             default:
               // drop the result
               facets.helper.updateStatus({ result: UNPUBLISHED_RESULT });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wallet
Projects
None yet
Development

No branches or pull requests

2 participants