minor fixes

This commit is contained in:
OmarHatem
2026-01-17 21:04:49 +01:00
parent 5c166f0e4b
commit 6cb28d4648
18 changed files with 39 additions and 36 deletions
+1 -1
View File
@@ -718,7 +718,7 @@ packages:
dependency: transitive
description:
path: "."
ref: cake-update-v2
ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
resolved-ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
url: "https://github.com/cake-tech/on_chain.git"
source: git
+1 -1
View File
@@ -478,7 +478,7 @@ packages:
dependency: "direct main"
description:
path: "."
ref: cake-update-v2
ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
resolved-ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
url: "https://github.com/cake-tech/on_chain.git"
source: git
+1 -1
View File
@@ -33,7 +33,7 @@ dependencies:
on_chain:
git:
url: https://github.com/cake-tech/on_chain.git
ref: cake-update-v2
ref: 096865a8c6b89c260beadfec04f7e184c40a3273
socks_socket:
git:
url: https://github.com/sneurlax/socks_socket
+2 -2
View File
@@ -501,8 +501,8 @@ packages:
dependency: transitive
description:
path: "."
ref: cake-update-v2
resolved-ref: "93440dc5126369b873ca1fccc13c3c1240b1c5c2"
ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
resolved-ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
url: "https://github.com/cake-tech/on_chain.git"
source: git
version: "3.7.0"
+1 -1
View File
@@ -598,7 +598,7 @@ packages:
dependency: transitive
description:
path: "."
ref: cake-update-v2
ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
resolved-ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
url: "https://github.com/cake-tech/on_chain.git"
source: git
+2 -2
View File
@@ -563,8 +563,8 @@ packages:
dependency: transitive
description:
path: "."
ref: cake-update-v2
resolved-ref: "01cbbacbb05d2113aafa8b7c4a2bb766f749d8d8"
ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
resolved-ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
url: "https://github.com/cake-tech/on_chain.git"
source: git
version: "3.7.0"
-1
View File
@@ -33,7 +33,6 @@ class TransactionFetchResult {
class SolanaWalletClient {
// Minimum amount in SOL to consider a transaction valid (to filter spam)
static const double minValidAmount = 0.00000003;
final httpClient = ProxyWrapper().getHttpClient();
late final client = ProxyWrapper().getHttpIOClient();
SolanaRPC? _provider;
+2 -1
View File
@@ -98,7 +98,8 @@ abstract class SolanaWalletBase
@override
@observable
late ObservableMap<CryptoCurrency, SolanaBalance> balance;
ObservableMap<CryptoCurrency, SolanaBalance> balance =
ObservableMap<CryptoCurrency, SolanaBalance>();
final Completer<SharedPreferences> _sharedPrefs = Completer();
+1 -1
View File
@@ -23,7 +23,7 @@ dependencies:
on_chain:
git:
url: https://github.com/cake-tech/on_chain.git
ref: cake-update-v2
ref: 096865a8c6b89c260beadfec04f7e184c40a3273
blockchain_utils:
git:
url: https://github.com/cake-tech/blockchain_utils
+1 -1
View File
@@ -18,7 +18,7 @@ dependencies:
on_chain:
git:
url: https://github.com/cake-tech/on_chain.git
ref: cake-update-v2
ref: 096865a8c6b89c260beadfec04f7e184c40a3273
blockchain_utils:
git:
url: https://github.com/cake-tech/blockchain_utils
+2 -2
View File
@@ -518,8 +518,8 @@ packages:
dependency: transitive
description:
path: "."
ref: cake-update-v2
resolved-ref: "93440dc5126369b873ca1fccc13c3c1240b1c5c2"
ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
resolved-ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
url: "https://github.com/cake-tech/on_chain.git"
source: git
version: "3.7.0"
+2 -2
View File
@@ -515,8 +515,8 @@ packages:
dependency: transitive
description:
path: "."
ref: cake-update-v2
resolved-ref: "93440dc5126369b873ca1fccc13c3c1240b1c5c2"
ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
resolved-ref: "096865a8c6b89c260beadfec04f7e184c40a3273"
url: "https://github.com/cake-tech/on_chain.git"
source: git
version: "3.7.0"
@@ -17,29 +17,16 @@ import 'package:cw_core/utils/print_verbose.dart';
import 'package:cw_core/utils/proxy_wrapper.dart';
class JupiterExchangeProvider extends ExchangeProvider {
JupiterExchangeProvider() : super(pairList: _getSupportedPairs());
JupiterExchangeProvider();
// Jupiter only supports Solana tokens
static const List<CryptoCurrency> _notSupported = [];
static List<ExchangePair> _getSupportedPairs() {
// Only support Solana and Solana tokens
final solanaCurrencies = CryptoCurrency.all
static final List<CryptoCurrency> _supportedCurrencies = CryptoCurrency.all
.where((c) => c.tag == 'SOL' || c == CryptoCurrency.sol)
.where((c) => !_notSupported.contains(c))
.toList();
final pairs = <ExchangePair>[];
for (final from in solanaCurrencies) {
for (final to in solanaCurrencies) {
if (from != to) {
pairs.add(ExchangePair(from: from, to: to, reverse: true));
}
}
}
return pairs;
}
static const _baseUrl = 'api.jup.ag';
static const _orderPath = '/ultra/v1/order';
static const _executePath = '/ultra/v1/execute';
@@ -148,6 +135,10 @@ class JupiterExchangeProvider extends ExchangeProvider {
required bool isReceiveAmount,
}) async {
try {
// must support both
if (!_supportedCurrencies.contains(from) || !_supportedCurrencies.contains(to)) {
return 0.0;
}
final inputMint = _getTokenMint(from);
final outputMint = _getTokenMint(to);
@@ -235,6 +226,12 @@ class JupiterExchangeProvider extends ExchangeProvider {
required bool isSendAll,
}) async {
try {
// must support both
if (!_supportedCurrencies.contains(request.fromCurrency) ||
!_supportedCurrencies.contains(request.toCurrency)) {
throw "not supported currencies";
}
final inputMint = _getTokenMint(request.fromCurrency);
final outputMint = _getTokenMint(request.toCurrency);
@@ -300,7 +300,7 @@ class _AdvancedPrivacySettingsBodyState extends State<_AdvancedPrivacySettingsBo
bottomSectionPadding: EdgeInsets.all(24),
bottomSection: Column(
children: [
const SizedBox(height: 24),
const SizedBox(height: 4),
LayoutBuilder(
builder: (_, constraints) => SizedBox(
width: constraints.maxWidth * 0.8,
+3 -1
View File
@@ -361,7 +361,9 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
}
await Future.delayed(const Duration(seconds: 2));
if (loadingBottomSheetContext != null && loadingBottomSheetContext!.mounted) {
if (loadingBottomSheetContext != null &&
loadingBottomSheetContext!.mounted &&
Navigator.canPop(loadingBottomSheetContext!)) {
Navigator.of(loadingBottomSheetContext!).pop();
}
@@ -213,7 +213,7 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
].contains(wallet.type);
bool get hideAddressAfterExchange =>
[WalletType.monero, WalletType.wownero].contains(wallet.type);
[WalletType.monero, WalletType.wownero, WalletType.zcash].contains(wallet.type);
bool _useTorOnly;
final Box<Trade> trades;
+1 -1
View File
@@ -126,7 +126,7 @@ dependencies:
on_chain:
git:
url: https://github.com/cake-tech/on_chain.git
ref: cake-update-v2
ref: 096865a8c6b89c260beadfec04f7e184c40a3273
reown_walletkit:
path: ./scripts/reown_flutter/packages/reown_walletkit
blockchain_utils:
+5 -1
View File
@@ -5,15 +5,19 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:cake_wallet/main.dart';
final quickActionsStream = StreamController<Uri?>.broadcast();
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(App());
await tester.pumpWidget(App(quickActionsStream: quickActionsStream.stream));
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);