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.3.tar.gz (459.7 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.3-py3-none-win_amd64.whl (4.6 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.3-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.3-py3-none-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: lexe_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 459.7 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.3.tar.gz
Algorithm Hash digest
SHA256 1d99eda050a288700c8b4e99af9dd948ec12fe3ffe93e67d0196731729660c91
MD5 27b10d542a87d053bd19e27e6121670a
BLAKE2b-256 6a87efd72e98d65f0fc8add35d46033659ddbcac5648f1cfab3c835479a6b13b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.6 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.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 da976fe11293982812cf75e2a14d181c9706cbd781c4895aab7ad1fdef731150
MD5 ac21194edfc26e6ee575c6531d1129ac
BLAKE2b-256 35ab1b454febccce3d5745ad412af60e92e9daaeb1855a3c34191034a863a2ea

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 eace7edcab8cc3e05db202b037b4cf020d5d462090d636ca3fe87d499230fd57
MD5 d83052a197c00efb7dd716f1d39dac57
BLAKE2b-256 19e799e4cc91f66b23e10201ea87d2bc6bfed0bdba8883c2479017271deb6af2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 88f6447ad6ea842e46ca2a6c1243f42b6aa3bdc8208fb2e346b8bda57e3cd114
MD5 961ddab8e7bfb50ef8c759af0b3620e7
BLAKE2b-256 57d97b509a78ded237968aa1df0db7e98a64b96c8e20b8c7a096231bb44bb144

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d0e1e2ee15ef4e37e25c225f2ca32af71ddd0b32bd2d712f9f407bd1539bf8c
MD5 618671149588ec9b4ea583283af6ef5a
BLAKE2b-256 978b5aef118e4d59079f986f6ff25d601167a833d2a9b9d447604f40b56ef57c

See more details on using hashes here.

Provenance

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