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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.14-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.14-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.14.tar.gz.

File metadata

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

File hashes

Hashes for lexe_sdk-0.1.14.tar.gz
Algorithm Hash digest
SHA256 adb8874de4b7950fe16eb2bbd3a1131b4c4b0f83d0efbaec470ae4bd5ae14c1e
MD5 b21ca9f8d911cd71134bbc7f00e4625b
BLAKE2b-256 03018558ec056a71592a5139ba45795957467dbea9ea188a5c5f5bb844c7ef7c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.14-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/6.1.0 CPython/3.13.14

File hashes

Hashes for lexe_sdk-0.1.14-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4a5ae1fa85d8cc6babd9e9c6c2185828dd8a16ecf774406f73383fff28a862ef
MD5 563bf362129aa4634c0e9cf94d5cc55b
BLAKE2b-256 ea487f758f55dd4e92e1e7b64d5980507543bd49ffe4646457739dc75f5e3516

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.14-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ba961176306c7cf45fa001e45a52d8497b78e243c472a6cb1852c6dc6ef3a5aa
MD5 c835b721e0268b9b8b6b78bbb6d01c39
BLAKE2b-256 6108b6b6c6e9de0a2896c457a39d0a764f55851eaf9b3dae376ff3ef89df598b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f7166ff512e40064176e653a6df144cf805b907cbbfd4b6322204f406ad7bfbd
MD5 aa41d5f68195240ae560f50c12741127
BLAKE2b-256 2394792f85031cf42838e6b0adb6783b844c65ccdbf9e62287ddcf033b14dd3c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.14-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adbacb2393b59dd327aebc2e6cf08587bd42d42408f4b2e3c7f8d0e7849a192d
MD5 9dbb505247b02b47933b5add2bc30d3d
BLAKE2b-256 0f779c5a9afbdd78fe66f39198696db564ff4b276d022e552a0c48dc3b4dca84

See more details on using hashes here.

Provenance

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