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.12.tar.gz (516.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.12-py3-none-win_amd64.whl (5.4 MB view details)

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.12-py3-none-manylinux_2_28_aarch64.whl (6.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.12-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.12-py3-none-macosx_11_0_arm64.whl (5.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: lexe_sdk-0.1.12.tar.gz
  • Upload date:
  • Size: 516.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.12.tar.gz
Algorithm Hash digest
SHA256 b9d9f14ef44a8bef4566f4dde71b33dd68b317765dfedf5d623d7bc8a5fa87a3
MD5 23243bcfe165a3e218d3a9829ea33736
BLAKE2b-256 c7363f7554add138b1582195742724e5622e303d5c11bbef433c2ef37d400c04

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.12-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.4 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.12-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a12ca5dcc43eb968eeaebedaa94d5f1c8dcce69bf1f1fff76cde1ee92b42d831
MD5 624a385fad2f069aefc20da4014e3d20
BLAKE2b-256 494ad6a2601296589e378b2c800b1eb04b555089e79be55918a81e0e5e7c01d2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.12-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 43860ae687afdd33e51c70929db56d84930c27a7269cf20ff412731a1a1c4df4
MD5 5c3f56ed91cf3ab011f17a864fe8b2be
BLAKE2b-256 7dab973e811e57a3a786c4df7a31c756388fc035e50f83c52da150e7d6af6290

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.12-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d77cb3a0cbb8294bbaf19f3be7b38923b9535ecdaac80d759d0a4a71e72e31a
MD5 0effeead3336d8dccbd0ba3c2c15f0e9
BLAKE2b-256 f6bdebbff351ab07b0ffca020fde105669f090c78cb8f53ff0019f8b90ab451e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.12-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c692ea468b01d3165451f819cc766f7c398e429bcbe7a6606cae60db7769cfd6
MD5 c548e53a8cf2f92ec5d14a1c1ed35bf1
BLAKE2b-256 05469961cede07763c38bfacbbd71f5132e5a4b34de375254cb4464e4b116804

See more details on using hashes here.

Provenance

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