mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
parent
b77c22b0df
commit
d332377a2b
36 changed files with 402 additions and 667 deletions
|
@ -213,9 +213,9 @@ class CWBitcoin extends Bitcoin {
|
|||
return bitcoinWallet.unspentCoins.where((element) {
|
||||
switch (coinTypeToSpendFrom) {
|
||||
case UnspentCoinType.mweb:
|
||||
return element.bitcoinAddressRecord.type == SegwitAddressType.mweb;
|
||||
return element.bitcoinAddressRecord.type == SegwitAddresType.mweb;
|
||||
case UnspentCoinType.nonMweb:
|
||||
return element.bitcoinAddressRecord.type != SegwitAddressType.mweb;
|
||||
return element.bitcoinAddressRecord.type != SegwitAddresType.mweb;
|
||||
case UnspentCoinType.any:
|
||||
return true;
|
||||
}
|
||||
|
@ -296,14 +296,14 @@ class CWBitcoin extends Bitcoin {
|
|||
case BitcoinReceivePageOption.p2sh:
|
||||
return P2shAddressType.p2wpkhInP2sh;
|
||||
case BitcoinReceivePageOption.p2tr:
|
||||
return SegwitAddressType.p2tr;
|
||||
return SegwitAddresType.p2tr;
|
||||
case BitcoinReceivePageOption.p2wsh:
|
||||
return SegwitAddressType.p2wsh;
|
||||
return SegwitAddresType.p2wsh;
|
||||
case BitcoinReceivePageOption.mweb:
|
||||
return SegwitAddressType.mweb;
|
||||
return SegwitAddresType.mweb;
|
||||
case BitcoinReceivePageOption.p2wpkh:
|
||||
default:
|
||||
return SegwitAddressType.p2wpkh;
|
||||
return SegwitAddresType.p2wpkh;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -527,7 +527,7 @@ class CWBitcoin extends Bitcoin {
|
|||
List<ElectrumSubAddress> getSilentPaymentAddresses(Object wallet) {
|
||||
final bitcoinWallet = wallet as ElectrumWallet;
|
||||
return bitcoinWallet.walletAddresses.silentAddresses
|
||||
.where((addr) => addr.type != SegwitAddressType.p2tr)
|
||||
.where((addr) => addr.type != SegwitAddresType.p2tr)
|
||||
.map((addr) => ElectrumSubAddress(
|
||||
id: addr.index,
|
||||
name: addr.name,
|
||||
|
@ -542,7 +542,7 @@ class CWBitcoin extends Bitcoin {
|
|||
List<ElectrumSubAddress> getSilentPaymentReceivedAddresses(Object wallet) {
|
||||
final bitcoinWallet = wallet as ElectrumWallet;
|
||||
return bitcoinWallet.walletAddresses.silentAddresses
|
||||
.where((addr) => addr.type == SegwitAddressType.p2tr)
|
||||
.where((addr) => addr.type == SegwitAddresType.p2tr)
|
||||
.map((addr) => ElectrumSubAddress(
|
||||
id: addr.index,
|
||||
name: addr.name,
|
||||
|
@ -712,7 +712,7 @@ class CWBitcoin extends Bitcoin {
|
|||
try {
|
||||
final electrumWallet = wallet as ElectrumWallet;
|
||||
final segwitAddress = electrumWallet.walletAddresses.allAddresses
|
||||
.firstWhere((element) => !element.isUsed && element.type == SegwitAddressType.p2wpkh);
|
||||
.firstWhere((element) => !element.isUsed && element.type == SegwitAddresType.p2wpkh);
|
||||
return segwitAddress.address;
|
||||
} catch (_) {
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue