Skip to content
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

UX: Switch assets based on address/invoice input #374

Closed
michael1011 opened this issue Dec 19, 2023 · 4 comments · Fixed by #503
Closed

UX: Switch assets based on address/invoice input #374

michael1011 opened this issue Dec 19, 2023 · 4 comments · Fixed by #503
Assignees
Labels
enhancement New feature or request P1

Comments

@michael1011
Copy link
Member

When a Liquid address is entered/scanned, the frontend should switch the receiving symbol the L-BTC. Similar concept for Bitcoin addresses and lightning invoices/lnurls/sat domains

@michael1011 michael1011 added the enhancement New feature or request label Dec 19, 2023
@kilrau kilrau added the P2 label Dec 20, 2023
@kilrau kilrau changed the title Switch assets based on address/invoice input UX: Switch assets based on address/invoice input Dec 30, 2023
@kilrau
Copy link
Member

kilrau commented Jan 9, 2024

Also gets rid of this error where web app should revalidate my liquid address when I am switchin to Liquid:
Screencast from 01-09-2024 04:31:44 PM.webm

@dni
Copy link
Contributor

dni commented Feb 11, 2024

Also gets rid of this error where web app should revalidate my liquid address when I am switchin to Liquid: Screencast from 01-09-2024 04:31:44 PM.webm

unrelated opened a new issue

@dni
Copy link
Contributor

dni commented Feb 11, 2024

        try {
            const assetName = asset();
            decodeAddress(assetName, address);
            input.setCustomValidity("");
            input.classList.remove("invalid");
            setAddressValid(true);
            setOnchainAddress(address);
        } catch (e) {

i dont like it, i think the natural flow is people will choose the asset first and then paste. maybe even people will be confused and trying to send liquid to a btc address and not noticing that the asset magically switched to btc, expecting lbtc to receive.

either way i think this optimisation is too much. and currently we validate the address by trying top decode the address with the asset the user selected.

@kilrau
Copy link
Member

kilrau commented Feb 12, 2024

either way i think this optimisation is too much

It is not, I am 100% convinced we want to do this. You don't know the support cases that Michael and I handled where we explained folks to switch the asset to Liquid "because it said invalid address". I see virtually no chance of anyone pasting an liquid address expecting to use mainchain.

dni added a commit that referenced this issue Mar 13, 2024
dni added a commit that referenced this issue Mar 19, 2024
closes #374

add direction switch on invoice paste

switch direction on pasting address intop invoice

clear invoice and address on asset switch

unhardcore prefixes
michael1011 added a commit that referenced this issue Mar 22, 2024
* feat: switch assets based on address

closes #374

add direction switch on invoice paste

switch direction on pasting address intop invoice

clear invoice and address on asset switch

unhardcore prefixes

* refactor: asset switch logic

prettier

* fixup!

* remove test

* fix: missing notification for LN -> address

* test: add tests for asset switch

---------

Co-authored-by: michael1011 <me@michael1011.at>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants