Skip to content

Commit e8d6bc8

Browse files
committed
bindings: use BitcoinAddress in python example
1 parent d7903a0 commit e8d6bc8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lwk_bindings/examples/lightning.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,15 @@ def lbtc_to_btc_swap(boltz_session, wollet, esplora_client, signer):
397397
print("Invalid amount. Please enter a valid number.")
398398

399399
# Ask for the Bitcoin claim address
400-
claim_address = input("Enter Bitcoin address to receive BTC: ").strip()
400+
claim_address_str = input("Enter Bitcoin address to receive BTC: ").strip()
401401

402402
# Get a Liquid refund address from the wallet
403403
refund_address = wollet.address(None).address()
404404
print(f"Refund address (Liquid): {refund_address}")
405405

406406
try:
407+
claim_address = BitcoinAddress(claim_address_str)
408+
407409
# Create the swap
408410
webhook_url = os.getenv('WEBHOOK')
409411
webhook = WebHook(webhook_url, status=[]) if webhook_url else None
@@ -475,9 +477,11 @@ def btc_to_lbtc_swap(boltz_session, wollet):
475477
print(f"Claim address (Liquid): {claim_address}")
476478

477479
# Ask for the Bitcoin refund address
478-
refund_address = input("Enter Bitcoin address for refunds: ").strip()
480+
refund_address_str = input("Enter Bitcoin address for refunds: ").strip()
479481

480482
try:
483+
refund_address = BitcoinAddress(refund_address_str)
484+
481485
# Create the swap
482486
webhook_url = os.getenv('WEBHOOK')
483487
webhook = WebHook(webhook_url, status=[]) if webhook_url else None

0 commit comments

Comments
 (0)