From 4ebfcc2bbd185fbc2bedf00aa16dedb538337bfd Mon Sep 17 00:00:00 2001 From: fosse Date: Tue, 27 Feb 2024 13:58:57 -0500 Subject: [PATCH] save --- .../receive/lightning_invoice_page.dart | 2 +- .../receive/lightning_receive_page.dart | 32 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/lib/src/screens/receive/lightning_invoice_page.dart b/lib/src/screens/receive/lightning_invoice_page.dart index 1b7abe751..f69d6aad5 100644 --- a/lib/src/screens/receive/lightning_invoice_page.dart +++ b/lib/src/screens/receive/lightning_invoice_page.dart @@ -167,7 +167,7 @@ class LightningInvoicePage extends BasePage { min = bitcoinAmountToLightningString(amount: int.parse(min) ~/ 1000); return Expanded( child: Text( - "A setup fee of 0.4% with a minimum of ${min} sats will be applied upon receiving this invoice.", + S.of(context).lightning_invoice_min(min), maxLines: 3, style: TextStyle( fontSize: 14, diff --git a/lib/src/screens/receive/lightning_receive_page.dart b/lib/src/screens/receive/lightning_receive_page.dart index 23dddf724..a54bcc389 100644 --- a/lib/src/screens/receive/lightning_receive_page.dart +++ b/lib/src/screens/receive/lightning_receive_page.dart @@ -9,6 +9,7 @@ import 'package:cake_wallet/utils/brightness_util.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/view_model/dashboard/receive_option_view_model.dart'; import 'package:cake_wallet/view_model/lightning_view_model.dart'; +import 'package:cw_bitcoin/bitcoin_amount_format.dart'; import 'package:cw_core/receive_page_option.dart'; import 'package:cw_lightning/lightning_receive_page_option.dart'; import 'package:flutter/material.dart'; @@ -199,17 +200,26 @@ class LightningReceiveOnchainPage extends BasePage { margin: EdgeInsets.only(left: 12, bottom: 48, right: 12), child: Image.asset("assets/images/warning.png"), ), - Expanded( - child: Text( - "Send more than 20,029 sats and up to 3,998,387 sats to this address. A setup fee of 0.4% with a minimum of 2,079 sats will be applied upon receiving this invoice. This will convert any received Bitcoin into Lightning. An on-chain fee will be applied. This address can only be used once.", - maxLines: 10, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: Theme.of(context).extension()!.textColor, - ), - ), - ), + FutureBuilder( + future: lightningViewModel.invoiceLimitsSats(), + builder: (context, snapshot) { + if (snapshot.data == null) { + return SizedBox(); + } + String min = (snapshot.data as List)[0]; + min = bitcoinAmountToLightningString(amount: int.parse(min) ~/ 1000); + return Expanded( + child: Text( + "Send more than 20,029 sats and up to 3,998,387 sats to this address. A setup fee of 0.4% with a minimum of 2,079 sats will be applied upon receiving this invoice. This will convert any received Bitcoin into Lightning. An on-chain fee will be applied. This address can only be used once.", + maxLines: 10, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Theme.of(context).extension()!.textColor, + ), + ), + ); + }), ], ), ),