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:
24
snippets/python_snippets/connecting_lsp.py
Normal file
24
snippets/python_snippets/connecting_lsp.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import logging
|
||||
from breez_sdk import BlockingBreezServices
|
||||
|
||||
sdk_services = BlockingBreezServices
|
||||
|
||||
def get_lsp_info():
|
||||
try:
|
||||
# ANCHOR: get-lsp-info
|
||||
lsp_id = sdk_services.lsp_id()
|
||||
lsp_info = sdk_services.lsp_info()
|
||||
# ANCHOR_END: get-lsp-info
|
||||
return lsp_info
|
||||
except Exception as error:
|
||||
logging.log(error)
|
||||
raise
|
||||
|
||||
def connect_lsp(lsp_id):
|
||||
try:
|
||||
# ANCHOR: connect-lsp
|
||||
sdk_services.connect_lsp(lsp_id)
|
||||
# ANCHOR_END: connect-lsp
|
||||
except Exception as error:
|
||||
logging.log(error)
|
||||
raise
|
||||
Reference in New Issue
Block a user