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.15.tar.gz (535.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.15-py3-none-win_amd64.whl (5.6 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.15-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.15-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.15.tar.gz.

File metadata

  • Download URL: lexe_sdk-0.1.15.tar.gz
  • Upload date:
  • Size: 535.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lexe_sdk-0.1.15.tar.gz
Algorithm Hash digest
SHA256 3662b32aa43e770a88328154017aeaf26dedf5d5a79dd9d9d57db2f91c462a43
MD5 66b0401f6c54c200b95821e4a25148cb
BLAKE2b-256 06812f30c38d676d231d653271cf4b7292a1ef15e106fcdbd633c79f763e59d7

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for lexe_sdk-0.1.15-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a9ac3b51e5eb4e78dff0310cbc29248058445cad2ea0a521f5d3fbece5f29c67
MD5 19c153617b79a97ce3de3ac369db95dc
BLAKE2b-256 cf44b716d125c487cc4c82241b29b5c79f1ac8d789480bc401392ab9b189d640

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.15-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ea76fa4861b9a8f7adf0b3e29b3f5a4651218609f9c5e506370d6fe7950f0bf7
MD5 980cb97bbe68844dbe5221182031e234
BLAKE2b-256 25e1c07ddf88168840a3a79147f43ff15cbbd12fc317f3cd368fbf6ebde9f0f0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a52cad76545e8ecfccd4132a523534460cadb28e7ff387f87ebd2d8cc678ee8a
MD5 dbdff405ef5370e29ddb42974aa0df32
BLAKE2b-256 9404bf439c7d25025d7277f79a8ec952f8cce1423f89bb1205637c0f86aa7e04

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.15-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 295d51371a05815a25337e24280090b02f9379ea8b927c36975b44cc557882b2
MD5 39298a32274bd572b0853b726f55c6ae
BLAKE2b-256 129051a978898e16c626444ddca6d3c42673c63bae1b010263d0ab0e31c50b06

See more details on using hashes here.

Provenance

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