CW-1099-Add-Doge-coin-to-Cake-Wallet (#2396)

* add wallet create, restore and server integration

* update transaction fee calculation

* Updated tool/configure.dart

* Add dogecoin support to app_config

* minor fix [skip ci]

* Update model_generator.sh

* remove cw_bitcoin import from  lib/ directory

* update bitcoin base

* update default node

* add passphrase an QR restore option

* add Dogecoin support for message signing

* add Dogecoin support across wallet features

* fix edit subaddress

Updated the isElectrum getter to include WalletType.dogecoin, ensuring Dogecoin wallets are correctly identified as Electrum-compatible.

* Update configure.dart

* fix: address label not saved

* remove unused derivationPath

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

* address review comments

* fix generateInitialAddresses type

* enable auto switching for Dogecoin nodes

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Serhii
2025-08-07 22:07:20 +03:00
committed by GitHub
co-authored by Omar Hatem
parent 9053a3d726
commit b6244cdd44
70 changed files with 1088 additions and 38 deletions
@@ -46,6 +46,7 @@ const wowneroDefaultNodeUri = 'node3.monerodevs.org:34568';
const zanoDefaultNodeUri = 'zano.cakewallet.com:11211';
const moneroWorldNodeUri = '.moneroworld.com';
const decredDefaultUri = "default-spv-nodes";
const dogecoinDefaultNodeUri = 'dogecoin.stackwallet.com:50022';
Future<void> defaultSettingsMigration(
{required int version,
@@ -514,6 +515,15 @@ Future<void> defaultSettingsMigration(
case 50:
migrateExistingNodesToUseAutoSwitching(nodes: nodes, powNodes: powNodes);
break;
case 51:
await addWalletNodeList(nodes: nodes, type: WalletType.dogecoin);
await _changeDefaultNode(
nodes: nodes,
sharedPreferences: sharedPreferences,
type: WalletType.dogecoin,
currentNodePreferenceKey: PreferencesKey.currentDogecoinNodeIdKey,
);
break;
default:
break;
}
@@ -620,6 +630,8 @@ String _getDefaultNodeUri(WalletType type) {
return zanoDefaultNodeUri;
case WalletType.decred:
return decredDefaultUri;
case WalletType.dogecoin:
return dogecoinDefaultNodeUri;
case WalletType.banano:
case WalletType.none:
return '';
@@ -1050,6 +1062,8 @@ Future<void> checkCurrentNodes(
final currentDecredNodeId = sharedPreferences.getInt(PreferencesKey.currentDecredNodeIdKey);
final currentBitcoinCashNodeId =
sharedPreferences.getInt(PreferencesKey.currentBitcoinCashNodeIdKey);
final currentDogecoinNodeId =
sharedPreferences.getInt(PreferencesKey.currentDogecoinNodeIdKey);
final currentSolanaNodeId = sharedPreferences.getInt(PreferencesKey.currentSolanaNodeIdKey);
final currentTronNodeId = sharedPreferences.getInt(PreferencesKey.currentTronNodeIdKey);
final currentWowneroNodeId = sharedPreferences.getInt(PreferencesKey.currentWowneroNodeIdKey);
@@ -1074,6 +1088,8 @@ Future<void> checkCurrentNodes(
powNodeSource.values.firstWhereOrNull((node) => node.key == currentNanoPowNodeId);
final currentBitcoinCashNodeServer =
nodeSource.values.firstWhereOrNull((node) => node.key == currentBitcoinCashNodeId);
final currentDogecoinNodeServer =
nodeSource.values.firstWhereOrNull((node) => node.key == currentDogecoinNodeId);
final currentSolanaNodeServer =
nodeSource.values.firstWhereOrNull((node) => node.key == currentSolanaNodeId);
final currentTronNodeServer =
@@ -1143,6 +1159,12 @@ Future<void> checkCurrentNodes(
await sharedPreferences.setInt(PreferencesKey.currentBitcoinCashNodeIdKey, node.key as int);
}
if (currentDogecoinNodeServer == null) {
final node = Node(uri: dogecoinDefaultNodeUri, type: WalletType.dogecoin, useSSL: true);
await nodeSource.add(node);
await sharedPreferences.setInt(PreferencesKey.currentDogecoinNodeIdKey, node.key as int);
}
if (currentPolygonNodeServer == null) {
final node = Node(uri: polygonDefaultNodeUri, type: WalletType.polygon);
await nodeSource.add(node);
+6 -1
View File
@@ -46,6 +46,9 @@ Future<List<Node>> loadDefaultNodes(WalletType type) async {
case WalletType.decred:
path = 'assets/decred_node_list.yml';
break;
case WalletType.dogecoin:
path = 'assets/dogecoin_electrum_server_list.yml';
break;
case WalletType.banano:
case WalletType.none:
path = '';
@@ -96,6 +99,7 @@ Future<void> resetToDefault(Box<Node> nodeSource) async {
final tronNodes = await loadDefaultNodes(WalletType.tron);
final decredNodes = await loadDefaultNodes(WalletType.decred);
final zanoNodes = await loadDefaultNodes(WalletType.zano);
final dogecoinElectrumServerList = await loadDefaultNodes(WalletType.dogecoin);
final nodes = moneroNodes +
bitcoinElectrumServerList +
@@ -108,7 +112,8 @@ Future<void> resetToDefault(Box<Node> nodeSource) async {
solanaNodes +
tronNodes +
zanoNodes +
decredNodes;
decredNodes +
dogecoinElectrumServerList;
await nodeSource.clear();
await nodeSource.addAll(nodes);
+1
View File
@@ -11,6 +11,7 @@ class PreferencesKey {
static const currentNanoNodeIdKey = 'current_node_id_nano';
static const currentNanoPowNodeIdKey = 'current_node_id_nano_pow';
static const currentDecredNodeIdKey = 'current_node_id_decred';
static const currentDogecoinNodeIdKey = 'current_node_id_doge';
static const currentBananoNodeIdKey = 'current_node_id_banano';
static const currentBananoPowNodeIdKey = 'current_node_id_banano_pow';
static const currentFiatCurrencyKey = 'current_fiat_currency';
@@ -1,5 +1,6 @@
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/bitcoin_cash/bitcoin_cash.dart';
import 'package:cake_wallet/dogecoin/dogecoin.dart';
import 'package:cake_wallet/ethereum/ethereum.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/polygon/polygon.dart';
@@ -23,6 +24,8 @@ List<TransactionPriority> priorityForWalletType(WalletType type) {
return ethereum!.getTransactionPriorities();
case WalletType.bitcoinCash:
return bitcoinCash!.getTransactionPriorities();
case WalletType.dogecoin:
return dogecoin!.getTransactionPriorities();
case WalletType.polygon:
return polygon!.getTransactionPriorities();
// no such thing for nano/banano/solana/tron: