From 1eb0509d74d0a1d0fcd83bac63f3811666246f57 Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:36:07 +0200 Subject: [PATCH] Fix handling of LNURLw response types --- lib/routes/lnurl/withdraw/lnurl_withdraw_dialog.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/routes/lnurl/withdraw/lnurl_withdraw_dialog.dart b/lib/routes/lnurl/withdraw/lnurl_withdraw_dialog.dart index a65cc85ef..251ddb4e4 100644 --- a/lib/routes/lnurl/withdraw/lnurl_withdraw_dialog.dart +++ b/lib/routes/lnurl/withdraw/lnurl_withdraw_dialog.dart @@ -148,12 +148,12 @@ class _LNURLWithdrawDialogState extends State with SingleTi amountSats: widget.amountSats, description: description, ); - if (resp is sdk.LnUrlWithdrawSuccessData) { - final paymentHash = (resp as sdk.LnUrlWithdrawSuccessData).invoice.paymentHash; + if (resp is sdk.LnUrlWithdrawResult_Ok) { + final paymentHash = (resp.data as sdk.LnUrlWithdrawSuccessData).invoice.paymentHash; _log.v("LNURL withdraw success for $paymentHash"); return const LNURLPageResult(protocol: LnUrlProtocol.Withdraw); - } else if (resp is sdk.LnUrlErrorData) { - final reason = (resp as sdk.LnUrlErrorData).reason; + } else if (resp is sdk.LnUrlWithdrawResult_ErrorStatus) { + final reason = (resp.data as sdk.LnUrlErrorData).reason; _log.v("LNURL withdraw failed: $reason"); return LNURLPageResult( protocol: LnUrlProtocol.Withdraw,