diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 705ee143..1ba5d3e7 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -108,7 +108,7 @@ jobs: BUILD_CONFIGURATION: Release TESTFLIGHT_USERNAME: ${{ secrets.TESTFLIGHT_USERNAME }} TESTFLIGHT_PASSWORD: ${{ secrets.TESTFLIGHT_PASSWORD }} - IOS_VERSION_STRING: 0.3.0 + IOS_VERSION_STRING: 0.3.1 P12_BASE64: ${{ secrets.P12_BASE64 }} P12_PASSWORD: ${{ secrets.P12_PASSWORD }} GOOGLE_SERVICES_IOS: ${{ secrets.GOOGLE_SERVICES_IOS }} diff --git a/lib/utils/exceptions/exception_handler.dart b/lib/utils/exceptions/exception_handler.dart index 6be2ff0a..d7b235b1 100644 --- a/lib/utils/exceptions/exception_handler.dart +++ b/lib/utils/exceptions/exception_handler.dart @@ -10,6 +10,11 @@ class ExceptionHandler { /// Private constructor to prevent instantiation ExceptionHandler._(); + /// Shown whenever the swap service is unavailable. Liquid send & receive need no + /// swapper, so they keep working and are the way forward for the user. + static const String _swapsUnavailable = + 'Swaps are temporarily unavailable. You can still send and receive using a Liquid address.'; + /// Extracts a user-friendly message from an exception /// /// [exception] The exception to extract a message from @@ -74,6 +79,10 @@ class ExceptionHandler { if (error.err.toLowerCase().contains('non-final') || error.err.toLowerCase().contains('rpc error -26')) { message = 'The transaction cannot be broadcast at this time. Please try again later.'; + } else if (error.err.toLowerCase().contains('swap creation is disabled')) { + // Boltz keeps serving pairs while refusing to create swaps, so prepare_* succeeds + // and the refusal only surfaces here, as a 400 body flattened into a generic error. + message = _swapsUnavailable; } else { message = 'Payment error: ${error.err}'; } @@ -88,9 +97,8 @@ class ExceptionHandler { } else if (error is PaymentError_InvalidPreimage) { message = 'The generated preimage is not valid'; } else if (error is PaymentError_PairsNotFound) { - // The swapper answered but offers no BTC/L-BTC pair, which is what a suspended - // swap service looks like. Liquid send & receive need no swapper, so point there. - message = 'Swaps are temporarily unavailable. You can still send and receive using a Liquid address.'; + // The swapper answered but offers no BTC/L-BTC pair. + message = _swapsUnavailable; } else if (error is PaymentError_PaymentTimeout) { message = 'Payment start could not be verified within the configured timeout'; } else if (error is PaymentError_PersistError) { diff --git a/pubspec.yaml b/pubspec.yaml index e33ee346..fc36fbf2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: misty_breez description: "Flutter app showcasing Breez SDK - Nodeless (Liquid Implementation)." publish_to: 'none' -version: 0.3.0 +version: 0.3.1 environment: sdk: '>=3.11.1 <4.0.0'