Solana enhancements (#1907)

* fix: Confirm widget is still mounted * feat: Modify balance display to include full balance * fix: Modifying balance * chore: Feature cleanup * fix: Add frozen balance into consideration when taking available balance and add field to make full balance display only on bitcoin and litecoin wallets * fix: Adjust balance card to display correct available and unavailable balance, unavailable balance should only be displayed when there is one WIP * fix: Cleanup balance page and balance page view_model * chore: Revert formatting * fix: Remove full balance * fix: Remove full balance * fix: Remove full balance * chore: Rever formating [skip ci] * feat: Finalize display only available and unavailable balance * fix: Modify the way balance is displayed, activate frozen balance with label, remove unavailable/additional balance for bitcoin wallet type * fix: Issues coming from syncing with main * fix: Modify additional balance label * fix: Monero and Wownero balances display bug * fix: Resolve merge conflicts * feat: Activate CPFP for BTC, LTC and BCH, also fix issues with frozen balance display * - minor fix - remove unused functions * Fix conflicts * Temporarily remove misused function Ignore creating associated account for receiver (testing) * revert associated recipient account removal * Migrate eth and polygon nodes to new urls and https --------- Co-authored-by: Blazebrain <davidadegoke16@gmail.com> Co-authored-by: tuxsudo <tuxsudo@tux.pizza>

Omar Hatem committed Dec 28, 2024 at 00:18 UTC 4bba9f6ddb4a1c76f74b9bc5f5855e1469795c3a
4 files changed +50 -14
assets/ethereum_server_list.yml
+3 -1
@@ -1,5 +1,7 @@
1 -
2 - uri: ethereum.publicnode.com
2 + uri: ethereum-rpc.publicnode.com
3 + useSSL: true
4 + isDefault: true
5 -
6 uri: eth.llamarpc.com
7 -
assets/polygon_node_list.yml
+3 -1
@@ -1,7 +1,9 @@
1 -
2 uri: polygon-rpc.com
3 -
4 - uri: polygon-bor.publicnode.com
4 + uri: polygon-bor-rpc.publicnode.com
5 + useSSL: true
6 + isDefault: true
7 -
8 uri: polygon.llamarpc.com
9 -
cw_solana/lib/solana_client.dart
+12 -10
@@ -379,16 +379,18 @@ class SolanaWalletClient {
379 required double solBalance,
380 required double fee,
381 }) async {
382 - final rent =
383 - await _client!.getMinimumBalanceForMintRentExemption(commitment: Commitment.confirmed);
384 -
385 - final rentInSol = (rent / lamportsPerSol).toDouble();
386 -
387 - final remnant = solBalance - (inputAmount + fee);
388 -
389 - if (remnant > rentInSol) return true;
390 -
391 - return false;
382 + return true;
383 + // TODO: this is not doing what the name inclines
384 + // final rent =
385 + // await _client!.getMinimumBalanceForMintRentExemption(commitment: Commitment.confirmed);
386 + //
387 + // final rentInSol = (rent / lamportsPerSol).toDouble();
388 + //
389 + // final remnant = solBalance - (inputAmount + fee);
390 + //
391 + // if (remnant > rentInSol) return true;
392 + //
393 + // return false;
394 }
395
396 Future<PendingSolanaTransaction> _signNativeTokenTransaction({
lib/entities/default_settings_migration.dart
+32 -2
@@ -35,8 +35,8 @@ const publicBitcoinTestnetElectrumUri =
35 '$publicBitcoinTestnetElectrumAddress:$publicBitcoinTestnetElectrumPort';
36 const cakeWalletLitecoinElectrumUri = 'ltc-electrum.cakewallet.com:50002';
37 const havenDefaultNodeUri = 'nodes.havenprotocol.org:443';
38 -const ethereumDefaultNodeUri = 'ethereum.publicnode.com';
39 -const polygonDefaultNodeUri = 'polygon-bor.publicnode.com';
38 +const ethereumDefaultNodeUri = 'ethereum-rpc.publicnode.com';
39 +const polygonDefaultNodeUri = 'polygon-bor-rpc.publicnode.com';
40 const cakeWalletBitcoinCashDefaultNodeUri = 'bitcoincash.stackwallet.com:50002';
41 const nanoDefaultNodeUri = 'nano.nownodes.io';
42 const nanoDefaultPowNodeUri = 'rpc.nano.to';
@@ -360,6 +360,18 @@ Future<void> defaultSettingsMigration(
360 'solana-rpc.publicnode.com:443',
361 ],
362 );
363 + _updateNode(
364 + nodes: nodes,
365 + currentUri: "ethereum.publicnode.com",
366 + newUri: "ethereum-rpc.publicnode.com",
367 + useSSL: true,
368 + );
369 + _updateNode(
370 + nodes: nodes,
371 + currentUri: "polygon-bor.publicnode.com",
372 + newUri: "polygon-bor-rpc.publicnode.com",
373 + useSSL: true,
374 + );
375 break;
376 default:
377 break;
@@ -375,6 +387,24 @@ Future<void> defaultSettingsMigration(
387 await sharedPreferences.setInt(PreferencesKey.currentDefaultSettingsMigrationVersion, version);
388 }
389
390 +void _updateNode({
391 + required Box<Node> nodes,
392 + required String currentUri,
393 + String? newUri,
394 + bool? useSSL,
395 +}) {
396 + for (Node node in nodes.values) {
397 + if (node.uriRaw == currentUri) {
398 + if (newUri != null) {
399 + node.uriRaw = newUri;
400 + }
401 + if (useSSL != null) {
402 + node.useSSL = useSSL;
403 + }
404 + }
405 + }
406 +}
407 +
408 Future<void> _backupHavenSeeds(Box<HavenSeedStore> havenSeedStore) async {
409 final future = haven?.backupHavenSeeds(havenSeedStore);
410 if (future != null) {