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.5.tar.gz (471.3 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.5-py3-none-win_amd64.whl (5.0 MB view details)

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.5-py3-none-manylinux_2_28_aarch64.whl (5.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.5-py3-none-macosx_11_0_arm64.whl (5.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: lexe_sdk-0.1.5.tar.gz
  • Upload date:
  • Size: 471.3 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.5.tar.gz
Algorithm Hash digest
SHA256 72bfe19f2b8a06c06b8926cda5f52f7f0ac3f09e347b4277909ac5df01aa5bb1
MD5 83e71bb72818a01976c22aad9c56a16a
BLAKE2b-256 db454cdc81fcad11c08ab9540444a8d42a2975621d7329e9322bfc70b360856f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.0 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.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cbf9d22f130f8ba55abd45ccce7f04c90769825f87b9c78c958e221282ace68b
MD5 7bd1e65fec713e503dfacbf6a0511e78
BLAKE2b-256 2fa055a3192d87755ca01101115a09d299928b9a04f0fff4aa6430409d3c30f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.5-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 472ab9dd8c595b910074ad7c1e6a1d95f34cc6e2385511623e6f711bac7467ed
MD5 32d7d837ee4f13352e62900304fe58c2
BLAKE2b-256 ee8446ffb7f05826aec94c3bdbedf1609af7565d5ebefce1d25bacfabe071c36

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd00a3b812bac3adae2ab08559c1f34072539fd00d069c48ddfea6eff7f01114
MD5 8adaea1bef773ac25a131d90ca4ab1fe
BLAKE2b-256 2b9aa7e1267ac2c91c4ce7a17acf680e9beb805eecf9276f9e1fb5a349221d56

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2587f23a1ab12d75e7f27ca04e6c8481579b420317bceeb3b00646b81b63b20a
MD5 a558463715a3b21d0872b90bd81313f0
BLAKE2b-256 be2ea45450ed576d9fd4299675e76e11935d391561b05227195663815a747c1e

See more details on using hashes here.

Provenance

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