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

Add the ability to exit offers to agoricWalletConnection in web-components #44

Open
WietzeSlagman opened this issue Sep 7, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@WietzeSlagman
Copy link
Contributor

What is the Problem Being Solved?

Dapp developers want their dapp users to be able to exit their offers through their own UI to give users a seamless experience, this us hard to develop at the moment and would require either of 2 solutions, which both have their own drawbacks and are not ideal.

1: dapp developers create a cancel offer function on their own contracts, which requires one of the 2 addiotnal things:

  • dapp developers have an exit subscriber that listens to offer exits that are transacted through wallet-app
  • dapp developers pass waived: null flag to their offers (currently breaks wallet-app)

2: dapp developers create their own interactive signer based on examples from wallet-app/ui-kit

Description of the Design

2 possible solutions:
1: add a method of exitOffer to makeAgoricWalletConnection

  • keeps the functionality more restricted and less error prone for the end-user
  • less freedom for dapp developers to create spendactions themselves

2: expose submitSpendAction(JSON.stringify(spendAction)) more freely

  • more freedom for dapp-developers (pro and a con)
  • smaller/cleaner code base

Security Considerations

Scaling Considerations

Test Plan

@WietzeSlagman WietzeSlagman added the enhancement New feature or request label Sep 7, 2023
@samsiegart
Copy link
Contributor

I think adding exitOffer to the wallet connection component is an ideal solution.

For dapps to watch offer status updates, the dapp can use walletUpdatesNotifier from the wallet connection. But, we probably also need to add a notifier for live offers to the component so you can see existing long-standing offers.

@samsiegart
Copy link
Contributor

I don't understand how this relates to contracts or waived: null though. Other than the fact that waived: null breaks the wallet-app currently, changing the contract is unrelated to which UI you exit the offer from.

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

No branches or pull requests

2 participants