Skip to main content

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

Project description

Lexe Python SDK

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,
    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.0.tar.gz (480.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.0-py3-none-win_amd64.whl (4.5 MB view details)

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.0-py3-none-manylinux_2_28_aarch64.whl (5.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.0-py3-none-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for lexe_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 664284aa65109165f877ffea77e0049eec53fd0a4e98087aba995e8bc0d824ab
MD5 5ddd3c6473204bcb75eaf1aec938c640
BLAKE2b-256 d74a9641a03152212060f6a41a6473325b554ef001efc512f6b04852f93559c3

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for lexe_sdk-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 90d714a86ac220aa9e6744c6227a04af1c6210e6c8bd3d42946664ae7a433df8
MD5 98cb32ab7ea07ab8c727520e221cb257
BLAKE2b-256 b1984cc9a0d4c92c104b2bdb007f22858f2dc9718534a186a2e61a2201498cb6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7f191e34b8b62e960f2ef9fee52fa01f225027ff97e46e274f7f2731958e38ad
MD5 c1f4657a9cbc14f5f817264a88fe2fdd
BLAKE2b-256 238072a5d6b6be74b74a0adc8fa56c11665a716633cf8108e9e005b5becee669

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 807e716e38f2ff21d52b3e05e61820784d7e9468f805ed8519ed2e55e78ba1cb
MD5 d07dbed61a8048d01d027117281ea23b
BLAKE2b-256 d13bf442638b36a9e6b540f2db6fb24cf63f861e71af2c10f5c6e2aed4a89e98

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec34bc0a16a0e27202499dbe0b3231af847dfa68f89191e7c08b9975e56b7926
MD5 8ef088a449059ceb153fce365db1c5da
BLAKE2b-256 bdcdf68a21046aae7b2c2fa59a8b9284dea449d0758b6b090425fac5a6d8cb0c

See more details on using hashes here.

Provenance

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