diff --git a/packages/komodo_defi_sdk/lib/src/withdrawals/legacy_withdrawal_manager.dart b/packages/komodo_defi_sdk/lib/src/withdrawals/legacy_withdrawal_manager.dart index 0341216a..e10c00a6 100644 --- a/packages/komodo_defi_sdk/lib/src/withdrawals/legacy_withdrawal_manager.dart +++ b/packages/komodo_defi_sdk/lib/src/withdrawals/legacy_withdrawal_manager.dart @@ -195,71 +195,6 @@ class LegacyWithdrawalManager implements WithdrawalManager { } } - /// Execute a withdrawal from a previously generated preview. - /// - /// This method broadcasts the pre-signed transaction from the preview, - /// avoiding the need to sign the transaction again. This is the ONLY - /// recommended way to execute withdrawals for Tendermint assets. - /// - /// Parameters: - /// - [preview] - The preview result from [previewWithdrawal] - /// - [assetId] - The asset identifier (coin symbol) - /// - /// Returns a [Stream] that emits progress updates. - @override - Stream executeWithdrawal( - WithdrawalPreview preview, - String assetId, - ) async* { - try { - // Initial progress update - yield WithdrawalProgress( - status: WithdrawalStatus.inProgress, - message: 'Broadcasting signed transaction...', - withdrawalResult: WithdrawalResult( - txHash: preview.txHash, - balanceChanges: preview.balanceChanges, - coin: assetId, - toAddress: preview.to.first, - fee: preview.fee, - kmdRewardsEligible: - preview.kmdRewards != null && - Decimal.parse(preview.kmdRewards!.amount) > Decimal.zero, - ), - ); - - // Broadcast the pre-signed transaction - final broadcastResponse = await _client.rpc.withdraw.sendRawTransaction( - coin: assetId, - txHex: preview.txHex, - txJson: preview.txJson, - ); - - // Final success update with actual broadcast transaction hash - yield WithdrawalProgress( - status: WithdrawalStatus.complete, - message: 'Withdrawal completed successfully', - withdrawalResult: WithdrawalResult( - txHash: broadcastResponse.txHash, - balanceChanges: preview.balanceChanges, - coin: assetId, - toAddress: preview.to.first, - fee: preview.fee, - kmdRewardsEligible: - preview.kmdRewards != null && - Decimal.parse(preview.kmdRewards!.amount) > Decimal.zero, - ), - ); - } catch (e) { - yield* Stream.error( - WithdrawalException( - 'Failed to broadcast transaction: $e', - WithdrawalErrorCode.networkError, - ), - ); - } - } - /// No-op for legacy implementation since there's no task to cancel @override Future cancelWithdrawal(int taskId) async => false;