This commit is contained in:
fosse 2024-02-27 14:24:02 -05:00
parent 4ebfcc2bbd
commit d3e830ee2d
3 changed files with 12 additions and 6 deletions

View file

@ -167,7 +167,7 @@ class LightningInvoicePage extends BasePage {
min = bitcoinAmountToLightningString(amount: int.parse(min) ~/ 1000);
return Expanded(
child: Text(
S.of(context).lightning_invoice_min(min),
/*S.of(context).lightning_invoice_min(min)*/"Needs fixing!",
maxLines: 3,
style: TextStyle(
fontSize: 14,

View file

@ -201,16 +201,21 @@ class LightningReceiveOnchainPage extends BasePage {
child: Image.asset("assets/images/warning.png"),
),
FutureBuilder(
future: lightningViewModel.invoiceLimitsSats(),
future: lightningViewModel.receiveOnchain(),
builder: (context, snapshot) {
if (snapshot.data == null) {
return SizedBox();
}
String min = (snapshot.data as List<String>)[0];
String min = (snapshot.data as List<String>)[1];
String max = (snapshot.data as List<String>)[2];
String fee = (snapshot.data as List<String>)[3];
min = bitcoinAmountToLightningString(amount: int.parse(min) ~/ 1000);
max = bitcoinAmountToLightningString(amount: int.parse(min) ~/ 1000);
fee = 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.",
// S.of(context).lightning_receive_limits(min, max, fee),
"Needs fixing!: $min, $max, $fee",
maxLines: 10,
style: TextStyle(
fontSize: 14,

View file

@ -18,13 +18,13 @@ abstract class LightningViewModelBase with Store {
ReceiveOnchainRequest req = const ReceiveOnchainRequest();
SwapInfo swapInfo = await sdk.receiveOnchain(req: req);
print(swapInfo.bitcoinAddress);
print("Minimum amount allowed to deposit in sats: ${swapInfo.minAllowedDeposit}");
print("Maximum amount allowed to deposit in sats: ${swapInfo.maxAllowedDeposit}");
return [
swapInfo.bitcoinAddress,
swapInfo.minAllowedDeposit.toString(),
swapInfo.maxAllowedDeposit.toString()
swapInfo.maxAllowedDeposit.toString(),
swapInfo.channelOpeningFees?.minMsat.toString() ?? "2000",
];
}
@ -45,6 +45,7 @@ abstract class LightningViewModelBase with Store {
description: "limits",
);
final res = await sdk.receivePayment(req: req);
final res = await sdk.
int min = (res.openingFeeMsat ?? (2500 * 1000));
int max = 1000000000 * 1000 * 10;// 10 BTC
return [min.toString(), max.toString()];