-
Notifications
You must be signed in to change notification settings - Fork 80
feat: detect bitcoin/monero uri's #1097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fix: use uri instead of manual parsing reformat: remove braces and use efficient variables refactor: add forgotten vars
Just squashed changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better to handle all URIs for all coins. That is somewhat set up already here:
stack_wallet/lib/utilities/address_utils.dart
Line 133 in 5adfee8
static PaymentUriData? parsePaymentUri( |
That is already used in several places but mostly just for handling QR code reads such as here:
Future<void> _scanQr() async { |
That
_scanQr()
function can probably be refactored into two functions. One for the scanning and a second for handing the parsing of the content. That parsing function can then be used on paste as well.
Rather than attempting a full check and parse every time a character is typed it would be better to hook into the on paste event. See https://api.flutter.dev/flutter/material/TextField/contextMenuBuilder.html and https://api.flutter.dev/flutter/material/AdaptiveTextSelectionToolbar-class.html
Finally, this PR only applies to the standard mobile send screen when it should be consistent across all send forms where it would make sense to have this such as on desktop (and possibly some other places as well. Would need to look around the code to find out).
I think this |
Yup, I forgot about the contextMenuBuilder limitation/didn't register when looking it up. I guess It would still be good to do some kind of relatively inexpensive check in Everything else in my original comment (besides the |
Seperated the |
Closes #1069
Detects URI Schemes for Bitcoin and Monero and uses them.