Skip to main content

Control Lexe self-custody Bitcoin wallets with the Lexe Python SDK

Project description

Lexe Python SDK

pypi.org pypi.org - requires-python python.lexe.tech CI MIT Discord

The Lexe Python SDK provides a Python interface for developers to control self-custodial, always-online Lexe Lightning nodes.

pip install lexe-sdk

Create a wallet

from lexe import Credentials, LexeWallet, RootSeed, WalletConfig

# Configure `mainnet()` or `testnet3()`
config = WalletConfig.mainnet()

# Sample a new seed and write it to ~/.lexe/seedphrase.txt
seed = RootSeed.generate()
seed.write(config)

# Create wallet and register with Lexe (data stored in ~/.lexe)
creds = Credentials.from_root_seed(seed)
wallet = LexeWallet.fresh(config, creds)
wallet.signup(root_seed=seed, partner_pk=None)

# Create a Lightning invoice
invoice = wallet.create_invoice(
    expiration_secs=3600,
    amount_sats=1000,
    description="Initial deposit",
)
print(f"Invoice: {invoice.invoice}")

# Wait for payment
payment = wallet.wait_for_payment(index=invoice.index, timeout_secs=300)
print(f"Payment received: {payment.amount_sats} sats")

Load an existing wallet

from lexe import Credentials, LexeWallet, RootSeed, WalletConfig

# Load existing wallet from ~/.lexe
config = WalletConfig.mainnet()
seed = RootSeed.read(config)
creds = Credentials.from_root_seed(seed)
wallet = LexeWallet.load(config, creds)

# Update to the latest node software
wallet.provision(creds)

# Pay a Lightning invoice
payment = wallet.pay_invoice(
    invoice="lnbc...",
    fallback_amount_sats=None,
    personal_note="Paying for coffee",
)
payment = wallet.wait_for_payment(index=payment.index, timeout_secs=15)
print(f"Payment: {payment.status}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lexe_sdk-0.1.11.tar.gz (503.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lexe_sdk-0.1.11-py3-none-win_amd64.whl (5.3 MB view details)

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.11-py3-none-manylinux_2_28_aarch64.whl (6.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.11-py3-none-macosx_11_0_arm64.whl (5.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file lexe_sdk-0.1.11.tar.gz.

File metadata

  • Download URL: lexe_sdk-0.1.11.tar.gz
  • Upload date:
  • Size: 503.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lexe_sdk-0.1.11.tar.gz
Algorithm Hash digest
SHA256 625d7a0d2ccf4928dcb186db7469ab9c0a0751e49d1b72a4aa673ab6acedc0b6
MD5 bf700195ba907366a533ea6381eef278
BLAKE2b-256 f3ec2f3644ed36ab9cbc62046bc13ebc64982e5690ef616fcc4095e4918e41d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.11.tar.gz:

Publisher: release-sdk-python.yml on lexe-app/lexe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lexe_sdk-0.1.11-py3-none-win_amd64.whl.

File metadata

  • Download URL: lexe_sdk-0.1.11-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lexe_sdk-0.1.11-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 38c19f60e1a93cba114e17664cf2a40255d12c7176566a7c323cd74d1174380e
MD5 fc0993eceb559f601d8e36abb04d3b4e
BLAKE2b-256 5e60e8718a3e30662f8ee629e98f0b49bc155f866caf959616004af5e1e962bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.11-py3-none-win_amd64.whl:

Publisher: release-sdk-python.yml on lexe-app/lexe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lexe_sdk-0.1.11-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lexe_sdk-0.1.11-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 222cc670a66ef59db67d606bc88be30366f53d251345d8525c1ea0f35ef4b8de
MD5 93c8589a1eff4bbae5f7603612b0ac74
BLAKE2b-256 4b92f706b8534f4cff3360c6a66cea9f730ef258e876f3e2de9c983d6d6f5590

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.11-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release-sdk-python.yml on lexe-app/lexe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lexe_sdk-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lexe_sdk-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 87f3e2e1722e6e38bf2e28ebbfe17a885666319c5da9a43027bcc8a4bd3ed7f7
MD5 f581c0f45304e89d0e37f78bb51082c3
BLAKE2b-256 5cc66c068b3d819cf31b3175cc643afbaca879f1231f382a098172211bd1f155

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-sdk-python.yml on lexe-app/lexe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lexe_sdk-0.1.11-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lexe_sdk-0.1.11-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 da593b2e4e22f2083e091e980ce199b7f2488385dd62852efe20d0a9888ebae6
MD5 978d95f4a55073c9c819a3aa6b057398
BLAKE2b-256 7eb56b9d7db35030e9f7d859e3f89508c2214a625c771560b1ec97512b7c5ef7

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.11-py3-none-macosx_11_0_arm64.whl:

Publisher: release-sdk-python.yml on lexe-app/lexe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page