diff --git a/cw_bitcoin/pubspec.lock b/cw_bitcoin/pubspec.lock index 90dbdf60f..31b74aeb6 100644 --- a/cw_bitcoin/pubspec.lock +++ b/cw_bitcoin/pubspec.lock @@ -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 diff --git a/cw_core/pubspec.lock b/cw_core/pubspec.lock index dd5dbaacf..3f74f77d6 100644 --- a/cw_core/pubspec.lock +++ b/cw_core/pubspec.lock @@ -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 diff --git a/cw_core/pubspec.yaml b/cw_core/pubspec.yaml index 4dc27a062..949791eb3 100644 --- a/cw_core/pubspec.yaml +++ b/cw_core/pubspec.yaml @@ -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 diff --git a/cw_decred/pubspec.lock b/cw_decred/pubspec.lock index ab2826fa2..035874d93 100644 --- a/cw_decred/pubspec.lock +++ b/cw_decred/pubspec.lock @@ -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" diff --git a/cw_monero/pubspec.lock b/cw_monero/pubspec.lock index f9ef7a82a..9de3df0bf 100644 --- a/cw_monero/pubspec.lock +++ b/cw_monero/pubspec.lock @@ -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 diff --git a/cw_nano/pubspec.lock b/cw_nano/pubspec.lock index 42df7b8d6..f139a4f1a 100644 --- a/cw_nano/pubspec.lock +++ b/cw_nano/pubspec.lock @@ -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" diff --git a/cw_solana/lib/solana_client.dart b/cw_solana/lib/solana_client.dart index 31e9c3ab2..bd83a4cb1 100644 --- a/cw_solana/lib/solana_client.dart +++ b/cw_solana/lib/solana_client.dart @@ -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; diff --git a/cw_solana/lib/solana_wallet.dart b/cw_solana/lib/solana_wallet.dart index 7a7c2ccb2..8e78fd42f 100644 --- a/cw_solana/lib/solana_wallet.dart +++ b/cw_solana/lib/solana_wallet.dart @@ -98,7 +98,8 @@ abstract class SolanaWalletBase @override @observable - late ObservableMap balance; + ObservableMap balance = + ObservableMap(); final Completer _sharedPrefs = Completer(); diff --git a/cw_solana/pubspec.yaml b/cw_solana/pubspec.yaml index c91ca6efc..fdc946c08 100644 --- a/cw_solana/pubspec.yaml +++ b/cw_solana/pubspec.yaml @@ -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 diff --git a/cw_tron/pubspec.yaml b/cw_tron/pubspec.yaml index 57c99286c..f406f3ac6 100644 --- a/cw_tron/pubspec.yaml +++ b/cw_tron/pubspec.yaml @@ -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 diff --git a/cw_wownero/pubspec.lock b/cw_wownero/pubspec.lock index ce8192f84..fdc254a1b 100644 --- a/cw_wownero/pubspec.lock +++ b/cw_wownero/pubspec.lock @@ -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" diff --git a/cw_zano/pubspec.lock b/cw_zano/pubspec.lock index 826e385b8..152451312 100644 --- a/cw_zano/pubspec.lock +++ b/cw_zano/pubspec.lock @@ -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" diff --git a/lib/exchange/provider/jupiter_exchange_provider.dart b/lib/exchange/provider/jupiter_exchange_provider.dart index 3a91a1b56..a2bb69095 100644 --- a/lib/exchange/provider/jupiter_exchange_provider.dart +++ b/lib/exchange/provider/jupiter_exchange_provider.dart @@ -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 _notSupported = []; - static List _getSupportedPairs() { - // Only support Solana and Solana tokens - final solanaCurrencies = CryptoCurrency.all + static final List _supportedCurrencies = CryptoCurrency.all .where((c) => c.tag == 'SOL' || c == CryptoCurrency.sol) .where((c) => !_notSupported.contains(c)) .toList(); - final pairs = []; - 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); diff --git a/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart b/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart index 7f2c65876..bfdb65ae9 100644 --- a/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart +++ b/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart @@ -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, diff --git a/lib/src/screens/send/widgets/send_card.dart b/lib/src/screens/send/widgets/send_card.dart index 3cc1d50f3..a27adea41 100644 --- a/lib/src/screens/send/widgets/send_card.dart +++ b/lib/src/screens/send/widgets/send_card.dart @@ -361,7 +361,9 @@ class SendCardState extends State with AutomaticKeepAliveClientMixin - [WalletType.monero, WalletType.wownero].contains(wallet.type); + [WalletType.monero, WalletType.wownero, WalletType.zcash].contains(wallet.type); bool _useTorOnly; final Box trades; diff --git a/pubspec_base.yaml b/pubspec_base.yaml index d0c6090f1..4c119500e 100644 --- a/pubspec_base.yaml +++ b/pubspec_base.yaml @@ -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: diff --git a/test/widget_test.dart b/test/widget_test.dart index 2c7ba24a5..c79ce99ad 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -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.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);