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

Wallet selection logic for SEND BITCOIN #247

Open
BullishNode opened this issue Apr 14, 2024 · 2 comments
Open

Wallet selection logic for SEND BITCOIN #247

BullishNode opened this issue Apr 14, 2024 · 2 comments
Assignees
Labels
core feature help wanted Extra attention is needed urgent requires immediate attention

Comments

@BullishNode
Copy link
Contributor

BullishNode commented Apr 14, 2024

FOR SEND BITCOIN

Destination is Bitcoin address

  1. Check if Secure Bitcoin Wallet has enough balance
  2. Check if another Bitcoin wallet has enough balance
  3. If more than one secondary Bitcoin wallet has enough balance, choose whichever has the highest balance
  4. Check if a fiat account has enough balance (Buy Bitcoin Order)
  5. If more than one fiat account has enough balance, choose whichever is preferred currency
  6. Check if Instant Payments Wallet has enough balance (L-BTC -> BTC swap)
  7. If nothing has enough balance, return error message

Destination is Lightning

  1. Check if Instant Payment Wallet has enough balance
  2. Check if a fiat account has enough balance (Buy Bitcoin Order)
  3. If more than one fiat account has enough balance, choose whichever is preferred currency
  4. Check if Secure Bitcoin Wallet has enough balance (BTC -> LN swap)
  5. Check if another Bitcoin wallet has enough balance
  6. If more than one secondary Bitcoin wallet has enough balance, choose whichever has the highest balance
  7. If nothing has enough balance, return error message

Destination is Liquid

  1. Check if Instant Payment Wallet has enough balance
  2. Check if a fiat account has enough balance (Buy Bitcoin Order)
  3. If more than one fiat account has enough balance, choose whichever is preferred currency
  4. Check if Secure Bitcoin Wallet has enough balance (BTC -> L-BTC swap)
  5. Check if another Bitcoin wallet has enough balance
  6. If more than one secondary Bitcoin wallet has enough balance, choose whichever has the highest balance
  7. If nothing has enough balance, return error message

Destination is either Bitcoin or Lightning

  1. Check if BIP21 contains a Bolt 11
  2. If contains a Bolt 11 invoice, check if Instant Payment Wallet has enough balance
  3. If Instant Payment Wallet does not have enough balance
  4. Check if a fiat account has enough balance
  5. If fiat account has enough balance, use the fiat account for a Lightning transaction
  6. If no fiat account has enough balance, check if Secure Bitcoin Wallet has enough balance
  7. Check if another Bitcoin wallet has enough balance
  8. If no Bitcoin wallet has enough balance, return error message
@i5hi
Copy link
Collaborator

i5hi commented Sep 12, 2024

Test case:

Both Instant and Secure have similar balance.

Paste an onchain Bitcoin bip21 with an amount higher than what is available in both wallets.

Result:

Instant Wallet is selected and we show, not enough balance. If the amount is updated to a smaller amount within balance, send is still disabled.

Expected:

Secure wallet should be selected and if the amount is changed to something less, Send button should be enabled

@saiy2k saiy2k closed this as completed in 7bfa8e5 Sep 12, 2024
@i5hi i5hi reopened this Sep 24, 2024
@i5hi i5hi added help wanted Extra attention is needed urgent requires immediate attention labels Dec 13, 2024
@i5hi
Copy link
Collaborator

i5hi commented Dec 13, 2024

If a wallet is selected and a user attempts send from a specific wallet page - wallet selection should not take place - currently it does.

Wallet selection should only happen when a user attempts to send from the homepage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature help wanted Extra attention is needed urgent requires immediate attention
Projects
None yet
Development

No branches or pull requests

5 participants