Update boltz-rust and add receive payment description (#409)

* Update boltz-rust

* Store description and add to Payment struct

* Fix examples
This commit is contained in:
Ross Savage
2024-07-25 12:46:40 +02:00
committed by GitHub
parent 535be71d84
commit baa8096852
41 changed files with 855 additions and 458 deletions

View File

@@ -134,16 +134,17 @@ class _ReceivePaymentDialogState extends State<ReceivePaymentDialog> {
try {
setState(() => creatingInvoice = true);
int amountSat = int.parse(payerAmountController.text);
PrepareReceiveRequest prepareReceiveReq =
PrepareReceiveRequest(payerAmountSat: BigInt.from(amountSat));
PrepareReceiveResponse req = await widget.liquidSDK.prepareReceivePayment(
PrepareReceivePaymentRequest prepareReceiveReq =
PrepareReceivePaymentRequest(payerAmountSat: BigInt.from(amountSat));
PrepareReceivePaymentResponse prepareRes = await widget.liquidSDK.prepareReceivePayment(
req: prepareReceiveReq,
);
setState(() {
payerAmountSat = req.payerAmountSat.toInt();
feesSat = req.feesSat.toInt();
payerAmountSat = prepareRes.payerAmountSat.toInt();
feesSat = prepareRes.feesSat.toInt();
});
ReceivePaymentResponse resp = await widget.liquidSDK.receivePayment(req: req);
ReceivePaymentRequest receiveReq = ReceivePaymentRequest(prepareRes: prepareRes);
ReceivePaymentResponse resp = await widget.liquidSDK.receivePayment(req: receiveReq);
debugPrint(
"Created Invoice for $payerAmountSat sats with $feesSat sats fees.\nInvoice:${resp.invoice}",
);