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,
    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.6.tar.gz (471.9 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.6-py3-none-win_amd64.whl (5.0 MB view details)

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.6-py3-none-manylinux_2_28_aarch64.whl (5.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.6-py3-none-macosx_11_0_arm64.whl (5.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: lexe_sdk-0.1.6.tar.gz
  • Upload date:
  • Size: 471.9 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.6.tar.gz
Algorithm Hash digest
SHA256 507f423c4cd62cd2ada7436c725589ddc43cf7cc2acc3baa884ca9d365568704
MD5 4b0a49cf98b41232db8e19b99c8bdb00
BLAKE2b-256 544987669c1c710f6e83d36ff7e5d337bde35485e1669d3fac40792ddf6f8455

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.6.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.6-py3-none-win_amd64.whl.

File metadata

  • Download URL: lexe_sdk-0.1.6-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.0 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.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f1c0983814127d8f757d20549ecbce03c3a9e58ac52306f0e7ef14af02cbccb3
MD5 1bacf72632497f3760c8f7518d478b26
BLAKE2b-256 1071e858155a00aa7d276d6d9c3c834fddfc0da7880b61104083875314eb0b7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.6-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.6-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lexe_sdk-0.1.6-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f717426cf26f0b5514696c6b445234a689ff933ffb5452c8e962d833cb272607
MD5 61cc572bcb701042c0d6880a071c366c
BLAKE2b-256 38cf54800470431b876fa491bef008e6b32af3dbd359e33315e3d99cfafe9a23

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.6-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.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lexe_sdk-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 10d2dc8962831af8262d2d8f3fc4b03ef2fa6d7e1afe4d441b40d63c1c8a7d20
MD5 e15ba7b3d603af684c8cfda3f4cd17d7
BLAKE2b-256 d059df80b410944ff08baf87343d9cfdc1020eccd1e7160017fd9ee8f441da9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.6-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.6-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lexe_sdk-0.1.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 991a552f117fdef0b30e78d407113d629ef3e08be7eb62a258c16f03851591ab
MD5 9d2038220e54cdb77f2726e17779980d
BLAKE2b-256 c67e8dd098025973e31e41dc5097b13a97ebedb7a0e6c28a9451bdc9fd6256f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for lexe_sdk-0.1.6-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