mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
python snippets
This commit is contained in:
27
snippets/python_snippets/list_payments.py
Normal file
27
snippets/python_snippets/list_payments.py
Normal 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
|
||||
Reference in New Issue
Block a user