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

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.2-py3-none-manylinux_2_28_aarch64.whl (5.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.2-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.2.tar.gz.

File metadata

  • Download URL: lexe_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 457.4 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.2.tar.gz
Algorithm Hash digest
SHA256 477f5150ee6183808a0875d5da7717debcbf79bb47f89454d5d1bdc4a64e65e1
MD5 69c1c6bb1c49263acf5232afb7deb340
BLAKE2b-256 de8efe90d343ae8b437bba33ad8c533b9be4846a22e7ad18953b6de96f97229f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.2-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.12

File hashes

Hashes for lexe_sdk-0.1.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7f3942479d8e7c8de4395fdc00eb91107ead18dcf98cf6be23d0da3d45c91e90
MD5 aff1708a71a1e85325b33ff9f236c6cc
BLAKE2b-256 4de8c0d290d3455fd2fc855c593a5d4bc77f774ae90a3a41891d2244384c7f52

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1b48ca84da20eed971d0a1e47009a4b1425d651943812f3c60a1766f88a8d8b8
MD5 414dd6e9f8395da9d033427e0a0266c0
BLAKE2b-256 91c17e1f7baea53567abfb201f146f13cf217bcfdd552b5fb8e0242f1050081a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9687e567d624782046a70acb2f75f6ea7b3afb4017c69405d31683bc2d4c0650
MD5 ea1b986283f77fc13162dbfc3b22c6c1
BLAKE2b-256 0760994d5600aef8b23b09e85f6fd8c2d07a8b4bc2313b1ffd24f4ce6ff895a0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 70decd87de9288a87115dd4ffd9508f3d79971cfcbf0e8df1f1dfd008ed9905e
MD5 21997f4646a7d79102e7daf9236d6868
BLAKE2b-256 3bb2a1064b628f755f7cfa1ceb1dbfe26467515f84b4022f21164059788555c6

See more details on using hashes here.

Provenance

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