mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-09 12:29:31 +00:00
invoice fixes
This commit is contained in:
parent
90e66ab4bf
commit
88a882e7f4
2 changed files with 9 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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()];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue