python snippets

This commit is contained in:
ruben beck
2023-10-25 17:17:08 +02:00
committed by ok300
parent f16fd23a21
commit 1f6c87c774
26 changed files with 388 additions and 175 deletions

View File

@@ -0,0 +1,17 @@
import breez_sdk
import logging
sdk_services = breez_sdk.BlockingBreezServices
def receive_payment():
try:
# ANCHOR: receive-payment
req = breez_sdk.ReceivePaymentRequest(
amount_msat=300000,
description="Invoice for 300 000 sats")
result = sdk_services.receive_payment(req)
# ANCHOR_END: receive-payment
return result
except Exception as error:
logging.error(error)
raise