Skip to content

Gamblez/lndhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LndHub

travis-badge codecov-badge pypi-badge license-badge

With lndhub you can interact with wallets that provide a LndHub URL like BlueWallet or lntxbot.

This library is still in pre-alpha and it can change a lot. The idea is to be able to interact with all API endpoints defined in the BlueWallet/LndHub documentation:

  • ...: /create
  • ...: /oauth2/token
  • Wallet.authenticate(): /auth
  • Wallet.get_info(): /getinfo
  • Wallet.get_balance(): /balance
  • Wallet.get_transactions(): /gettxs
  • Wallet.get_transaction(id): /gettx
  • Wallet.get_pending_transactions(): /getpending
  • Wallet.get_invoices(): /getuserinvoices
  • Wallet.create_invoice(amount, description): /addinvoice
  • Wallet.decode_invoice(bolt11): /decodeinvoice
  • ...: /checkrouteinvoice at the momment does nothing.
  • Wallet.pay_invoice(bolt11): /payinvoice
  • ...: /sendcoins
  • Wallet.get_btc_addresses(): /getbtc
  • Wallet.create_btc_address(): /newbtc

Basic usage

import os

from lndhub import Wallet

wallet = Wallet(os.environ['LNDHUB_WALLET'])  # lndhub://user:pass@https://endpoint.com
balance = wallet.get_balance()
invoice = wallet.create_invoice(amount=200, description='Thanks!')