Agoric / ui-kit

Components and tools for building graphical UIs
https://ui-kit-dwm.pages.dev/
Apache License 2.0
3 stars 3 forks source link

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

Open WietzeSlagman opened 11 months ago

WietzeSlagman commented 11 months ago

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:

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

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

Security Considerations

Scaling Considerations

Test Plan

samsiegart commented 11 months ago

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 commented 11 months ago

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.