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

@@ -5,13 +5,15 @@ use breez_sdk_core::*;
async fn receive_payment(sdk: Arc<BreezServices>) -> Result<()> {
// ANCHOR: receive-payment
let res = sdk
let receive_payment_response = sdk
.receive_payment(ReceivePaymentRequest {
amount_msat: 3_000_000,
description: "Invoice for 3000 sats".into(),
..Default::default()
})
.await?;
let invoice = receive_payment_response.ln_invoice;
// ANCHOR_END: receive-payment
Ok(())