Skip to main content

Control Lexe self-custody Bitcoin wallets with the Lexe Python SDK

Project description

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

Project details


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.9.tar.gz (486.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.9-py3-none-win_amd64.whl (5.1 MB view details)

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.9-py3-none-manylinux_2_28_aarch64.whl (5.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.9-py3-none-macosx_11_0_arm64.whl (5.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: lexe_sdk-0.1.9.tar.gz
  • Upload date:
  • Size: 486.2 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.9.tar.gz
Algorithm Hash digest
SHA256 73f206a36a4ad2e1d3bf1170c4151e4b4f9ca22a635475a2094dde674b935d0d
MD5 8c5692deba15e22a674569fd57ac33c9
BLAKE2b-256 6981730ed3b34d67b8ff6f2f55913416c766ad70ed5f799696de3f8e4a5de634

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.9-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.1 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.9-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3c26456fc48d14b47f5c3c3dd3222dbb3e7d777a78b5753f024897f23a0d4405
MD5 fcb51d033b3169cfc9b453f214b1fee9
BLAKE2b-256 2e1b6bb69b99a10a428a32fc6aa1df34aee22cb34af161cc8e09b38ba36cb73b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.9-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0b30441c0e4aa77f74084faaee1c64194ad401d5a2020a75b636a0a0e2b511d3
MD5 42c9a9d1a1811b3030db506318c39140
BLAKE2b-256 d7fcaae8ac0e451d4a9600fe90cb8ac9c6fe3fd47ae2d6b991d76761f2d1bf5e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3476eb01d3f3c09553f52a12a90c59dc1a666ba86779e76a8d2c68172ccc36c
MD5 a422126e930eaff2bb6b531f86063597
BLAKE2b-256 b8fef00cda64401eac7b71d9ebfc221067ce15b880e6e7b385062877083aefb1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.9-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b49ffeb07bf99186a0cf1a12b2e1d2c4e9d3c025252f910567680c9561edf24
MD5 16d30fad3149576ae788fa29a9089d0f
BLAKE2b-256 76658f07853674628458bd5cfe03a584c6e38068892a68603291f98d9d30467c

See more details on using hashes here.

Provenance

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