mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Consolidate "receive payment" snippets, expose invoice
This commit is contained in:
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user