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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.16-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.16-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.16.tar.gz.

File metadata

  • Download URL: lexe_sdk-0.1.16.tar.gz
  • Upload date:
  • Size: 546.2 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.16.tar.gz
Algorithm Hash digest
SHA256 030156650133444725c8f46e44cb5ab5265414a9de6322f561a0d2d32b89c814
MD5 c0e56da555a5800bcbf6c635ebd1da7c
BLAKE2b-256 be969d171327fccc5044a8ef110ba6f3b4d9aead29eac8a6d39827e3b71afb9d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.16-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.16-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1e205cb113a8e6407d738a0ae4d5395b56e89b04d2891b8f80b5f03f513a1739
MD5 fa21387c2f499679ea8cffc978668ac5
BLAKE2b-256 8a1ab61ae30dcb1eb8fbd989a08e5d14f95a9d081263c26f29fc15e39d9543cc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.16-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7cb22f9c46bf9a10c08599a80702bcddcfe09793cfee4940941a3b640bf6208e
MD5 2e914d3a3cd59c6a86275f572aaa9d57
BLAKE2b-256 b5ef0f738d8786ba6acebf26b7986935bc73070c5c4c2002dbd1817a7a2c653b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.16-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6999c1aa74b2faa6f90183e41e0914a316d6ab7bcfca2815fc4f17eb5c6717e7
MD5 57c94230f3145000569e28c15445e159
BLAKE2b-256 752d3ef2e5eca26feec7a18ea438fbca4de06db601bd5ede4de5af267bd2d64e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.16-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cdc747beb87b984c214187fbfc1a75e4a3f3c248b4bf33c6a2150945f1b95e59
MD5 5251598019c75186a63ef8bc9b9cb763
BLAKE2b-256 56b194d765a17a79804f13d86bdb880194d628ffa762cab38986a2d319507603

See more details on using hashes here.

Provenance

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