invoice fixes

This commit is contained in:
fosse 2024-02-26 13:01:39 -05:00
parent 90e66ab4bf
commit 88a882e7f4
2 changed files with 9 additions and 5 deletions

View file

@ -113,8 +113,10 @@ abstract class LightningInvoicePageViewModelBase with Store {
Future<void> _fetchLimits() async {
List<String> limits = await lightningViewModel.invoiceLimits();
minimum = double.tryParse(limits[0]);
maximum = double.tryParse(limits[1]);
minimum = double.tryParse(limits[0]) ?? 0;
maximum = double.tryParse(limits[1]) ?? (100000000 * 10);
minimum = minimum! / 100000000;
maximum = maximum! / 100000000;
}
@action

View file

@ -41,10 +41,12 @@ abstract class LightningViewModelBase with Store {
Future<List<String>> invoiceLimits() async {
final sdk = await BreezSDK();
final req = ReceivePaymentRequest(
amountMsat: 2500000,
description: 'limits',
amountMsat: 3000000,
description: "limits",
);
final res = await sdk.receivePayment(req: req);
return [(res.openingFeeMsat).toString(), '10000'];
int min = (res.openingFeeMsat ?? 2500000);
int max = 1000000000;
return [min.toString(), max.toString()];
}
}