From 9fe452f62fe6aab5ba0bdbf55f115c0c0f42d0ad Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:32:49 +0200 Subject: [PATCH] Add fee params arg to createInvoice --- lib/bloc/account/account_bloc.dart | 3 ++- lib/routes/create_invoice/create_invoice_page.dart | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/bloc/account/account_bloc.dart b/lib/bloc/account/account_bloc.dart index c26a9e5fc..04ab059fb 100644 --- a/lib/bloc/account/account_bloc.dart +++ b/lib/bloc/account/account_bloc.dart @@ -273,10 +273,11 @@ class AccountBloc extends Cubit with HydratedMixin { Future addInvoice({ String description = "", required int amountSats, + required sdk.OpeningFeeParams? chosenFeeParams, }) async { _log.fine("addInvoice: $description, $amountSats"); - final requestData = sdk.ReceivePaymentRequest(amountSats: amountSats, description: description); + final requestData = sdk.ReceivePaymentRequest(amountSats: amountSats, description: description, openingFeeParams: chosenFeeParams); final responseData = await _breezLib.receivePayment(reqData: requestData); return responseData; } diff --git a/lib/routes/create_invoice/create_invoice_page.dart b/lib/routes/create_invoice/create_invoice_page.dart index 202eeb033..f0b9d4018 100644 --- a/lib/routes/create_invoice/create_invoice_page.dart +++ b/lib/routes/create_invoice/create_invoice_page.dart @@ -198,9 +198,13 @@ class CreateInvoicePageState extends State { final accountBloc = context.read(); final currencyBloc = context.read(); + final lspInfo = context.read().state?.lspInfo; + final cheapestFeeParams = lspInfo?.openingFeeParamsList.values.first; + Future receivePaymentResponse = accountBloc.addInvoice( description: _descriptionController.text, amountSats: currencyBloc.state.bitcoinCurrency.parse(_amountController.text), + chosenFeeParams: cheapestFeeParams ); navigator.pop(); Widget dialog = FutureBuilder(