frontend-monorepo icon indicating copy to clipboard operation
frontend-monorepo copied to clipboard

Vega transaction toasts

Open mattrussell36 opened this issue 2 years ago • 1 comments

Story

As a user I want vega transactions to be shown as toasts So that I can continue to use the app whilst waiting for a tx to complete

Acceptance Criteria

  • [x] I am prompted via dialog to complete the transaction in wallet
  • [ ] I am immediately shown a rejected transaction (when rejected by wallet immediately)
  • [x] If the transaction was accepted by the wallet, I can still use the application and am not blocked by an overlay
  • [x] If the transaction is accepted I am shown a toast with the tx hash, indicating its pending
  • [ ] I can execute multiple transactions one after the other
  • [ ] When a transaction result is received, notify state by toast

Tasks

  • [ ] Create transaction store
  • [ ] Migrate to using toasts
    • [ ] https://github.com/vegaprotocol/frontend-monorepo/issues/2271
    • [ ] https://github.com/vegaprotocol/frontend-monorepo/issues/2270
    • [ ] Withdrawal creation issue TBD

Additional information

  • We may want to create a new hook/store for this. Say a useVegaTransactionV2 to make development and migration to the new pattern easier and more incremental

mattrussell36 avatar Oct 07 '22 02:10 mattrussell36

Some thoughts on this here: https://www.figma.com/file/K49Nx7XfocShhHcwwQzQkm/Console-V2?node-id=3672%3A35294

In summary, I'd suggest the prompt to approve in their wallet remains a dialog, and then the pending and result states are shown in toasts.

One area that complicates things is the 2-part processes such as deposits and withdrawals - you're in a modal for part 1, then you wait for the confirmation, and then you get another modal for part 2. I'm not sure going to toasts inbetween makes sense - what would happen to the modal while that's happening? Might make more sense to show the pending/confirmation states in modals in these scenarios… one to discuss in crit and with devs.

PeteWilliams avatar Oct 28 '22 14:10 PeteWilliams