bullbitcoin-mobile
bullbitcoin-mobile copied to clipboard
Wallet selection logic for SEND BITCOIN
FOR SEND BITCOIN
Destination is Bitcoin address
- Check if Secure Bitcoin Wallet has enough balance
- Check if another Bitcoin wallet has enough balance
- If more than one secondary Bitcoin wallet has enough balance, choose whichever has the highest balance
- Check if a fiat account has enough balance (Buy Bitcoin Order)
- If more than one fiat account has enough balance, choose whichever is preferred currency
- Check if Instant Payments Wallet has enough balance (L-BTC -> BTC swap)
- If nothing has enough balance, return error message
Destination is Lightning
- Check if Instant Payment Wallet has enough balance
- Check if a fiat account has enough balance (Buy Bitcoin Order)
- If more than one fiat account has enough balance, choose whichever is preferred currency
- Check if Secure Bitcoin Wallet has enough balance (BTC -> LN swap)
- Check if another Bitcoin wallet has enough balance
- If more than one secondary Bitcoin wallet has enough balance, choose whichever has the highest balance
- If nothing has enough balance, return error message
Destination is Liquid
- Check if Instant Payment Wallet has enough balance
- Check if a fiat account has enough balance (Buy Bitcoin Order)
- If more than one fiat account has enough balance, choose whichever is preferred currency
- Check if Secure Bitcoin Wallet has enough balance (BTC -> L-BTC swap)
- Check if another Bitcoin wallet has enough balance
- If more than one secondary Bitcoin wallet has enough balance, choose whichever has the highest balance
- If nothing has enough balance, return error message
Destination is either Bitcoin or Lightning
- Check if BIP21 contains a Bolt 11
- If contains a Bolt 11 invoice, check if Instant Payment Wallet has enough balance
- If Instant Payment Wallet does not have enough balance
- Check if a fiat account has enough balance
- If fiat account has enough balance, use the fiat account for a Lightning transaction
- If no fiat account has enough balance, check if Secure Bitcoin Wallet has enough balance
- Check if another Bitcoin wallet has enough balance
- If no Bitcoin wallet has enough balance, return error message