[Cashtab] parse sats from scanned qr code amount param
Summary:
Cashtab does not parse parameters from an address nor does it remove them if they are present. However, it does validate for cashAddr format.
In its current state, Cashtab will throw a validation error after scanning a QR code with parameters.
This diff (1) Removes any scanned parameters from the address when entered into the 'to' field and
(2) parses for an amount param, and passes it to the amount field (Send BCHA screen only).
Its designed to work with mercurymessenger.io, which uses the prefix ecash: and satoshis after the amount param.
Test Plan:
- Generate a QR code at mercurymessenger.io
- npm start to run Cashtab locally
- Attempt to scan your mercurymessenger.io QR code from the Send screen
- Observe address is populated with bitcoincash: prefix and amount is populated with satoshis converted to BCHA
- Scan normal QR codes with no params and observe no amount is input into the amount field
- Scan the mercurymessenger.io QR code with param from the SendToken.js screen and observe no amount is input into the amount field
Reviewers: alcipir, majcosta, Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D8907