HomePhabricator

[Cashtab] Improve handling of URL populated txs

Description

[Cashtab] Improve handling of URL populated txs

Summary:
Improve extension behavior by updating the txInfoFromUrl case

Cashtab is able to pre-populate the SendXec screen with a transaction by the use of limited URL params. The format, for now, is slightly different compared with bip21. I plan to add bip21 string in URL support in a later diff, in a way that preserves backward compatibility.

This param in URL approach is how a webapp is able to pass transaction information to the extension. Based on user feedback from users of ecash.land, there are some high impact improvements available to improve the user experience. These are implemented in this diff.

If a Cashtab window has valid tx params in the URL that populate a valid tx,

  1. Close the window after the tx is complete.
  2. Disable multi-send as this is not currently supported by URL params or bip21
  3. Disable input fields (address and amount. For now, the Cashtab Msg field is not disabled as app-set opreturns are not yet supported).
  4. Remove forced modal confirmation (so, the modal is a user setting). Instead of forcing a confirmation modal, make sure the tx values are clearly displayed.

Test Plan:
npm test

npm run extension

Make some transactions at ecash.land.

  • Confirm the 'Multiple Recipients' switch is not visible.
  • Confirm window closes on completion
  • Confirm no send confirmation modal unless enabled in Settings
  • Confirm input is disabled in windows opened by the webapp.

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Differential Revision: https://reviews.bitcoinabc.org/D15141

Details

Provenance
bytesofmanAuthored on Jan 12 2024, 06:59
bytesofmanPushed on Jan 15 2024, 17:45
Reviewer
Restricted Project
Differential Revision
D15141: [Cashtab] Improve handling of URL populated txs
Parents
rABC6a402956ae13: Remove mempool txs in reverse topological order
Branches
Unknown
Tags
Unknown