Skip to main content

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}")

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.13.tar.gz (533.0 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.13-py3-none-win_amd64.whl (5.5 MB view details)

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.13-py3-none-manylinux_2_28_aarch64.whl (6.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.13-py3-none-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: lexe_sdk-0.1.13.tar.gz
  • Upload date:
  • Size: 533.0 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.13.tar.gz
Algorithm Hash digest
SHA256 c51375258119bf35158dde760bdc996c1deb3e4ae661db99149274ed6a289308
MD5 0375cda011d75ee3605e5e96186d88fd
BLAKE2b-256 fe4499cf6de5fd086e7b32e5b990b7302f43f50e9e6b2092b36b2192b77ca723

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.13-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.5 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.13-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6e947a6516a516c544f8d3d672401810a5ad72b90ad3a4102b64bcc658ab87c3
MD5 a18e78eaac5e80260b645fc650ab4737
BLAKE2b-256 2ec568d6e3024de1d4868de5a990eb468824a4d5d636da94ce53b3c548ee7550

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.13-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 02dd489596d31a0f8b584c31d1c37547881607247759ee846d9b9d3aaa0b5e71
MD5 d5e06e904d76c0b207381311c367dd80
BLAKE2b-256 39403214e91b5acb3aab272158d614bf948f1c7c98f50bcc17fee29aacfeeba4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 164b9f27ebd136bc958150bf853621bca4f6e157559edec08ba9a19fdb992f60
MD5 31bde8f9042021e788ddb6f1d75c56a4
BLAKE2b-256 ad784bb10503754660dd61745f32bf9422c7d0e16f06a5386c46de070968d47a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.13-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1b706878da4356a3623ed8edca6abc5dcd093d166c9a88d24b9c611ba3b548a4
MD5 ca87141863da133b584abc76bbdf193d
BLAKE2b-256 ae47e8d7f3cfe8e18a4347d4939f8e1d950ca1fb349f73350f15303492513c3e

See more details on using hashes here.

Provenance

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