From 0685715c042fcb87671ad096b62ac591c94062aa Mon Sep 17 00:00:00 2001 From: i5hi Date: Fri, 3 May 2024 09:06:17 +0530 Subject: [PATCH] Added delay only for liquid claim (requires time to allow mempool propogation - removed delays for refund and bitcoin claim --- lib/_pkg/boltz/swap.dart | 3 ++- lib/swap/bloc/watchtxs_bloc.dart | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/_pkg/boltz/swap.dart b/lib/_pkg/boltz/swap.dart index a4b36712..c1e32daa 100644 --- a/lib/_pkg/boltz/swap.dart +++ b/lib/_pkg/boltz/swap.dart @@ -9,6 +9,7 @@ import 'package:bb_mobile/_pkg/error.dart'; import 'package:bb_mobile/_pkg/storage/secure_storage.dart'; import 'package:bb_mobile/_pkg/storage/storage.dart'; import 'package:boltz_dart/boltz_dart.dart'; +import 'package:flutter_animate/flutter_animate.dart'; class SwapBoltz { SwapBoltz({ @@ -439,7 +440,7 @@ class SwapBoltz { if (claimFeesEstimate == null) throw 'Fees estimate not found'; final swap = swapTx.toLbtcLnV2Swap(swapSensitive); - + Future.delayed(17.seconds); final resp = await swap.claim( outAddress: address, absFee: claimFeesEstimate, diff --git a/lib/swap/bloc/watchtxs_bloc.dart b/lib/swap/bloc/watchtxs_bloc.dart index 5c2feb12..0eab74b2 100644 --- a/lib/swap/bloc/watchtxs_bloc.dart +++ b/lib/swap/bloc/watchtxs_bloc.dart @@ -207,7 +207,7 @@ class WatchTxsBloc extends Bloc { ), ); - await Future.delayed(10.seconds); + // await Future.delayed(10.seconds); final (txid, err) = await _swapBoltz.refundV2SubmarineSwap( swapTx: swapTx, @@ -267,7 +267,7 @@ class WatchTxsBloc extends Bloc { ), ); - await Future.delayed(10.seconds); + // await Future.delayed(10.seconds); final (txid, err) = await _swapBoltz.claimV2ReverseSwap( swapTx: swapTx, @@ -331,7 +331,7 @@ class WatchTxsBloc extends Bloc { ), ); - await Future.delayed(10.seconds); + await Future.delayed(7.seconds); final err = await _swapBoltz.cooperativeSubmarineClose( swapTx: swapTx,