- disable Arbitrum - Minor fixes - Code cleanup
- disable Arbitrum - Minor fixes - Code cleanup
OmarHatem committed
Nov 6, 2025 at 01:04 UTC
df11f87e325312a3e2e86b1389ed1b84ea6f4a0d
10 files changed
+106
-107
cakewallet.bat
+1
-1
@@ -1,5 +1,5 @@
1
@echo off
2
-set cw_win_app_config=--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --dogecoin --base --arbitrum
2
+set cw_win_app_config=--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --dogecoin --base
3
set cw_root=%cd%
4
set cw_archive_name=Cake Wallet.zip
5
set cw_archive_path=%cw_root%\%cw_archive_name%
cw_core/lib/wallet_base.dart
+1
-1
@@ -86,7 +86,7 @@ abstract class WalletBase<BalanceType extends Balance, HistoryType extends Trans
86
87
int calculateEstimatedFee(TransactionPriority priority, int? amount);
88
89
- Future<void> updateEstimatedFeesParams(TransactionPriority priority) async {}
89
+ Future<void> updateEstimatedFeesParams(TransactionPriority? priority) async {}
90
91
// void fetchTransactionsAsync(
92
// void Function(TransactionType transaction) onTransactionLoaded,
cw_evm/lib/evm_chain_wallet.dart
+1
-1
@@ -277,7 +277,7 @@ abstract class EVMChainWalletBase
277
int calculateEstimatedFee(TransactionPriority priority, int? amount) => 0;
278
279
@override
280
- Future<void> updateEstimatedFeesParams(TransactionPriority priority) async =>
280
+ Future<void> updateEstimatedFeesParams(TransactionPriority? priority) async =>
281
await _getEstimatedFees(priority);
282
283
Future<void> _getEstimatedFees(TransactionPriority? priority) async {
cw_nano/lib/nano_client.dart
+24
-25
@@ -446,35 +446,34 @@ class NanoClient {
446
required String destinationAddress,
447
required String privateKey,
448
}) async {
449
- final receivableResponse = await ProxyWrapper().post(
450
- clearnetUri: _node!.uri,
451
- headers: getHeaders(_node!.uri.host),
452
- body: jsonEncode({
453
- "action": "receivable",
454
- "account": destinationAddress,
455
- "count": "-1",
456
- "source": true,
457
- }),
458
- );
459
- final receivableData = jsonDecode(receivableResponse.body) as Map<String, dynamic>;
460
- if (receivableData["blocks"] == "" || receivableData["blocks"] == null) {
461
- return 0;
462
- }
463
-
464
- dynamic blocks;
465
- if (receivableData["blocks"] is List<dynamic>) {
466
- var listBlocks = receivableData["blocks"] as List<dynamic>;
467
- if (listBlocks.isEmpty) {
449
+ try {
450
+ final receivableResponse = await ProxyWrapper().post(
451
+ clearnetUri: _node!.uri,
452
+ headers: getHeaders(_node!.uri.host),
453
+ body: jsonEncode({
454
+ "action": "receivable",
455
+ "account": destinationAddress,
456
+ "count": "-1",
457
+ "source": true,
458
+ }),
459
+ );
460
+ final receivableData = jsonDecode(receivableResponse.body) as Map<String, dynamic>;
461
+ if (receivableData["blocks"] == "" || receivableData["blocks"] == null) {
462
return 0;
463
}
470
- blocks = {for (var block in listBlocks) block['hash']: block};
471
- } else {
472
- blocks = receivableData["blocks"] as Map<String, dynamic>;
473
- }
464
475
- blocks = blocks as Map<String, dynamic>;
465
+ dynamic blocks;
466
+ if (receivableData["blocks"] is List<dynamic>) {
467
+ var listBlocks = receivableData["blocks"] as List<dynamic>;
468
+ if (listBlocks.isEmpty) {
469
+ return 0;
470
+ }
471
+ blocks = {for (var block in listBlocks) block['hash']: block};
472
+ } else {
473
+ blocks = receivableData["blocks"] as Map<String, dynamic>;
474
+ }
475
477
- try {
476
+ blocks = blocks as Map<String, dynamic>;
477
// confirm all receivable blocks:
478
for (final blockHash in blocks.keys) {
479
final block = blocks[blockHash];
cw_wownero/lib/api/account_list.dart
+3
@@ -19,6 +19,8 @@ wownero.SubaddressAccount? subaddressAccount;
19
bool isUpdating = false;
20
21
void refreshAccounts() {
22
+ if (wptr == null) return;
23
+
24
try {
25
isUpdating = true;
26
subaddressAccount = wownero.Wallet_subaddressAccount(wptr!);
@@ -31,6 +33,7 @@ void refreshAccounts() {
33
}
34
35
List<wownero.SubaddressAccountRow> getAllAccount() {
36
+ if (wptr == null) return [];
37
// final size = wownero.Wallet_numSubaddressAccounts(wptr!);
38
refreshAccounts();
39
int size = wownero.SubaddressAccount_getAll_size(subaddressAccount!);
lib/view_model/send/output.dart
+72
-75
@@ -162,100 +162,96 @@ abstract class OutputBase with Store {
162
@action
163
Future<void> calculateEstimatedFee() async {
164
try {
165
- if (_wallet.type == WalletType.tron) {
166
- if (cryptoCurrencyHandler() == CryptoCurrency.trx) {
167
- final nativeEstimatedFee = tron!.getTronNativeEstimatedFee(_wallet) ?? '0';
168
- estimatedFee = double.parse(nativeEstimatedFee);
169
- } else {
170
- final trc20EstimatedFee = tron!.getTronTRC20EstimatedFee(_wallet) ?? '0';
171
- estimatedFee = double.parse(trc20EstimatedFee);
172
- }
173
- }
174
-
165
if (isEVMCompatibleChain(_wallet.type)) {
176
- if (_wallet.type == WalletType.arbitrum) {
177
- String? fee = cryptoCurrencyHandler() == CryptoCurrency.arbEth
178
- ? arbitrum!.getArbitrumNativeEstimatedFee(_wallet)
179
- : arbitrum!.getArbitrumERC20EstimatedFee(_wallet);
180
-
181
- estimatedFee = arbitrum!
182
- .formatterArbitrumAmountToDouble(amount: BigInt.from(double.parse(fee ?? '0.0')));
183
- return;
184
- }
185
-
166
await _wallet.updateEstimatedFeesParams(_settingsStore.priority[_wallet.type]!);
167
+ }
168
188
- double calculatedFee = 0.0;
169
+ int? fee = _wallet.calculateEstimatedFee(
170
+ _settingsStore.priority[_wallet.type]!,
171
+ formattedCryptoAmount,
172
+ );
173
190
- if (_wallet.type == WalletType.ethereum) {
174
+ switch (_wallet.type) {
175
+ case WalletType.monero:
176
+ estimatedFee = monero!.formatterMoneroAmountToDouble(amount: fee);
177
+ break;
178
+ case WalletType.bitcoin:
179
+ if (_settingsStore.priority[_wallet.type] ==
180
+ bitcoin!.getBitcoinTransactionPriorityCustom()) {
181
+ fee = bitcoin!.getEstimatedFeeWithFeeRate(
182
+ _wallet, _settingsStore.customBitcoinFeeRate, formattedCryptoAmount);
183
+ }
184
+
185
+ estimatedFee = bitcoin!.formatterBitcoinAmountToDouble(amount: fee);
186
+ break;
187
+ case WalletType.litecoin:
188
+ case WalletType.bitcoinCash:
189
+ case WalletType.dogecoin:
190
+ estimatedFee = bitcoin!.formatterBitcoinAmountToDouble(amount: fee);
191
+ break;
192
+ case WalletType.solana:
193
+ estimatedFee = solana!.getEstimateFees(_wallet) ?? 0.0;
194
+ break;
195
+ case WalletType.wownero:
196
+ estimatedFee = wownero!.formatterWowneroAmountToDouble(amount: fee);
197
+ break;
198
+ case WalletType.zano:
199
+ estimatedFee = zano!.formatterIntAmountToDouble(
200
+ amount: fee, currency: cryptoCurrencyHandler(), forFee: true);
201
+ break;
202
+ case WalletType.decred:
203
+ estimatedFee = decred!.formatterDecredAmountToDouble(amount: fee);
204
+ break;
205
+ case WalletType.tron:
206
+ if (cryptoCurrencyHandler() == CryptoCurrency.trx) {
207
+ final nativeEstimatedFee = tron!.getTronNativeEstimatedFee(_wallet) ?? '0';
208
+ estimatedFee = double.parse(nativeEstimatedFee);
209
+ } else {
210
+ final trc20EstimatedFee = tron!.getTronTRC20EstimatedFee(_wallet) ?? '0';
211
+ estimatedFee = double.parse(trc20EstimatedFee);
212
+ }
213
+ break;
214
+
215
+ /// EVMs
216
+ case WalletType.ethereum:
217
String? fee = cryptoCurrencyHandler() == CryptoCurrency.eth
218
? ethereum!.getEthereumNativeEstimatedFee(_wallet)
219
: ethereum!.getEthereumERC20EstimatedFee(_wallet);
220
195
- calculatedFee = ethereum!
221
+ estimatedFee = ethereum!
222
.formatterEthereumAmountToDouble(amount: BigInt.from(double.parse(fee ?? '0.0')));
197
- }
198
-
199
- if (_wallet.type == WalletType.polygon) {
223
+ break;
224
+ case WalletType.polygon:
225
String? fee = cryptoCurrencyHandler() == CryptoCurrency.maticpoly
226
? polygon!.getPolygonNativeEstimatedFee(_wallet)
227
: polygon!.getPolygonERC20EstimatedFee(_wallet);
228
204
- calculatedFee = polygon!
229
+ estimatedFee = polygon!
230
.formatterPolygonAmountToDouble(amount: BigInt.from(double.parse(fee ?? '0.0')));
206
- }
207
-
208
- if (_wallet.type == WalletType.base) {
231
+ break;
232
+ case WalletType.base:
233
String? fee = cryptoCurrencyHandler() == CryptoCurrency.baseEth
234
? base!.getBaseNativeEstimatedFee(_wallet)
235
: base!.getBaseERC20EstimatedFee(_wallet);
212
- calculatedFee =
236
+ estimatedFee =
237
base!.formatterBaseAmountToDouble(amount: BigInt.from(double.parse(fee ?? '0.0')));
214
- }
215
-
216
- estimatedFee = calculatedFee;
217
- }
218
-
219
- if (_wallet.type == WalletType.solana) {
220
- estimatedFee = solana!.getEstimateFees(_wallet) ?? 0.0;
221
- }
222
-
223
- int? fee = _wallet.calculateEstimatedFee(
224
- _settingsStore.priority[_wallet.type]!,
225
- formattedCryptoAmount,
226
- );
227
-
228
- if (_wallet.type == WalletType.bitcoin) {
229
- if (_settingsStore.priority[_wallet.type] ==
230
- bitcoin!.getBitcoinTransactionPriorityCustom()) {
231
- fee = bitcoin!.getEstimatedFeeWithFeeRate(
232
- _wallet, _settingsStore.customBitcoinFeeRate, formattedCryptoAmount);
233
- }
234
-
235
- estimatedFee = bitcoin!.formatterBitcoinAmountToDouble(amount: fee);
236
- }
237
-
238
- if (_wallet.type == WalletType.litecoin ||
239
- _wallet.type == WalletType.bitcoinCash ||
240
- _wallet.type == WalletType.dogecoin) {
241
- estimatedFee = bitcoin!.formatterBitcoinAmountToDouble(amount: fee);
242
- }
243
-
244
- if (_wallet.type == WalletType.monero) {
245
- estimatedFee = monero!.formatterMoneroAmountToDouble(amount: fee);
246
- }
247
-
248
- if (_wallet.type == WalletType.wownero) {
249
- estimatedFee = wownero!.formatterWowneroAmountToDouble(amount: fee);
250
- }
251
-
252
- if (_wallet.type == WalletType.zano) {
253
- estimatedFee = zano!.formatterIntAmountToDouble(
254
- amount: fee, currency: cryptoCurrencyHandler(), forFee: true);
255
- }
238
+ break;
239
+ case WalletType.arbitrum:
240
+ String? fee = cryptoCurrencyHandler() == CryptoCurrency.arbEth
241
+ ? arbitrum!.getArbitrumNativeEstimatedFee(_wallet)
242
+ : arbitrum!.getArbitrumERC20EstimatedFee(_wallet);
243
257
- if (_wallet.type == WalletType.decred) {
258
- estimatedFee = decred!.formatterDecredAmountToDouble(amount: fee);
244
+ estimatedFee = arbitrum!
245
+ .formatterArbitrumAmountToDouble(amount: BigInt.from(double.parse(fee ?? '0.0')));
246
+ break;
247
+ /// end EVMs
248
+
249
+ case WalletType.haven:
250
+ case WalletType.nano:
251
+ case WalletType.banano:
252
+ case WalletType.none:
253
+ // will not reach here as it doesn't have priority and this function is triggered only when priority changes
254
+ break;
255
}
256
} catch (e) {
257
printV(e.toString());
@@ -288,6 +284,7 @@ abstract class OutputBase with Store {
284
final SettingsStore _settingsStore;
285
final FiatConversionStore _fiatConversationStore;
286
final NumberFormat _cryptoNumberFormat;
287
+
288
@action
289
void setSendAll(String fullBalance) {
290
cryptoFullBalance = fullBalance;
scripts/android/pubspec_gen.sh
+1
-1
@@ -10,7 +10,7 @@ case $APP_ANDROID_TYPE in
10
CONFIG_ARGS="--monero"
11
;;
12
$CAKEWALLET)
13
- CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --zano --decred --dogecoin --base --arbitrum"
13
+ CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --zano --decred --dogecoin --base" # --arbitrum
14
;;
15
esac
16
scripts/ios/app_config.sh
+1
-1
@@ -31,7 +31,7 @@ case $APP_IOS_TYPE in
31
;;
32
33
$CAKEWALLET)
34
- CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --zano --decred --dogecoin --base --arbitrum"
34
+ CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --zano --decred --dogecoin --base" # --arbitrum
35
;;
36
esac
37
scripts/linux/app_config.sh
+1
-1
@@ -13,7 +13,7 @@ CONFIG_ARGS=""
13
14
case $APP_LINUX_TYPE in
15
$CAKEWALLET)
16
- CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --dogecoin --base --arbitrum --excludeFlutterSecureStorage";;
16
+ CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --dogecoin --base --excludeFlutterSecureStorage";; # --arbitrum
17
esac
18
19
cp -rf pubspec_description.yaml pubspec.yaml
scripts/macos/app_config.sh
+1
-1
@@ -36,7 +36,7 @@ case $APP_MACOS_TYPE in
36
$MONERO_COM)
37
CONFIG_ARGS="--monero";;
38
$CAKEWALLET)
39
- CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --dogecoin --base --arbitrum";;
39
+ CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --dogecoin --base";; # --arbitrum
40
esac
41
42
cp -rf pubspec_description.yaml pubspec.yaml