givelotus / lotus-vase

A simple reference wallet for Lotus which supports mobile devices.
GNU General Public License v3.0
4 stars 2 forks source link

Fix Parsing/Validation function for Bitcoincash only addresses #73

Open chinitadelrey opened 3 years ago

chinitadelrey commented 3 years ago

The Bitcoin.com wallet offers an option to request specific amounts via the QR code. For example,

image

The above QR code returns bitcoincash:qpgrfvqlz0cvsd3k0htqjhvrguf2yjndgy696yh5ne?amount=0.6522571159537545 in the Cashew address field currently (TestFlight), which would cause more errors 😆

Similarly, a BitcoinSV wallet returns bitcoin:1Fs8vv3SR4mAHcrDMbEze2bo8WmQ6mt9Th?sv&amount=6000.

We should parse this at the time of scan and updating the sendTo and amount fields in the SendModel or throw errors as necessary.

This is a helpful library. https://github.com/videah/bip21-dart/blob/master/lib/src/bip21_base.dart

I'd be happy to work on it as I'm currently working on the receipt dialogs and updating the sendInfo UI screen.

chinitadelrey commented 3 years ago

Currently the latest build works to paste the amount and addresses for the following, which we do NOT want:

bitcoin:1Fs8vv3SR4mAHcrDMbEze2bo8WmQ6mt9Th?sv&amount=6000 bitcoifsddsncash:qpgrfvqlz0cvsd3k0htqjhvrguf2yjndgy696yh5ne?amount=0.6522571159537545

chinitadelrey commented 3 years ago

Pasting bitcoifsddsncash:qpgrfvqlz0cvsd3k0htqjhvrguf2yjndgy696yh5ne?amount=0.6522571159537545 still works in send info screen, which we do not want.