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,27 @@
import breez_sdk
import logging
sdk_services = breez_sdk.BlockingBreezServices
def list_payments():
try:
# ANCHOR: list-payments
sdk_services.list_payments(breez_sdk.ListPaymentsRequest(breez_sdk.PaymentTypeFilter.All))
# ANCHOR_END: list-payments
except Exception as error:
logging.error(error)
raise
def list_payments_filtered():
try:
# ANCHOR: list-payments-filtered
req = breez_sdk.ListPaymentsRequest(
breez_sdk.PaymentTypeFilter.Sent,
from_timestamp = 1696880000,
include_failures = True)
sdk_services.list_payments(req)
# ANCHOR_END: list-payments-filtered
except Exception as error:
logging.error(error)
raise