SatoshiPortal / bullbitcoin-mobile

The Bull Bitcoin Mobile Wallet and Exchange App
MIT License
54 stars 18 forks source link

Wallet selection logic for SEND BITCOIN #247

Open BullishNode opened 2 months ago

BullishNode commented 2 months ago

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