Skip to content

Commit

Permalink
Add fee params arg to createInvoice
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed Oct 9, 2023
1 parent 213ed2c commit 9fe452f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/bloc/account/account_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,11 @@ class AccountBloc extends Cubit<AccountState> with HydratedMixin {
Future<sdk.ReceivePaymentResponse> 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;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/routes/create_invoice/create_invoice_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,13 @@ class CreateInvoicePageState extends State<CreateInvoicePage> {
final accountBloc = context.read<AccountBloc>();
final currencyBloc = context.read<CurrencyBloc>();

final lspInfo = context.read<LSPBloc>().state?.lspInfo;
final cheapestFeeParams = lspInfo?.openingFeeParamsList.values.first;

Future<ReceivePaymentResponse> receivePaymentResponse = accountBloc.addInvoice(
description: _descriptionController.text,
amountSats: currencyBloc.state.bitcoinCurrency.parse(_amountController.text),
chosenFeeParams: cheapestFeeParams
);
navigator.pop();
Widget dialog = FutureBuilder(
Expand Down

0 comments on commit 9fe452f

Please sign in to comment.