Consolidate "receive payment" snippets, expose invoice

This commit is contained in:
ok300
2024-01-12 10:17:29 +01:00
parent 464a29816d
commit fd10bbc286
8 changed files with 28 additions and 15 deletions

View File

@@ -9,10 +9,12 @@ import BreezSDK
func receivePayment(sdk: BlockingBreezServices) -> ReceivePaymentResponse? {
// ANCHOR: receive-payment
let repsonse = try? sdk.receivePayment(
let receivePaymentResponse = try? sdk.receivePayment(
req: ReceivePaymentRequest(
amountMsat: 3_000_000,
description: "Invoice for 3 000 000 sats"))
description: "Invoice for 3 000 sats"))
let invoice = receivePaymentResponse?.lnInvoice;
// ANCHOR_END: receive-payment
return repsonse
return receivePaymentResponse
}