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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.8-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.8-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.8.tar.gz.

File metadata

  • Download URL: lexe_sdk-0.1.8.tar.gz
  • Upload date:
  • Size: 485.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.8.tar.gz
Algorithm Hash digest
SHA256 292374b0927e05fdf3c571a64cd3e617bea02d7c934f7241bf1100136229b971
MD5 fcd5f5231971183618644e3e9c6a5d2f
BLAKE2b-256 c9b5d7a932327f019ddc4eec7c0c7dc6682964bc6e34cbde5a4f1d838a72ed36

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.8-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.8-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1aad649a2a298ffcab8f093859e32be0b75e3a6ab4a5c539bcc175fdab3a2e83
MD5 aeb8629ab167885d608570351fa389ec
BLAKE2b-256 a16f726fa72ac4d55c649db936c3227248526c5a00e25770811b18167b73b14d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.8-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5202c70ec796d4c7b38219b3c23d5e1dc85be31574f7daabd199bc245a6769cb
MD5 9be16bab064cf23828f61911057166fb
BLAKE2b-256 183bb4c0e69fd73642a03ab534d6e714fb161cd1a5640fb8923f50c21cdf1748

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.8-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8dcd82695928a89ddccf9e5c8c39af8b5b689cae4d77a41cd35f74b8fdfe15e3
MD5 d342d816d2957f6c0807a23b64cbcbb2
BLAKE2b-256 9bfcbbc33942fb13caafbea9f89713ec009d4f2100d3aa5dc09d1a911b57b58a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.8-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8050b8fe1a327560a15b672ccdbbee53a19f5f8d836e33bf94a46eb1aaf1db43
MD5 f9331195d71a339b55cfe4373762bfaf
BLAKE2b-256 c6bedc7dac0c03d65774c9fd381ba7d736a82b63e50afab4fdcff2b309c33846

See more details on using hashes here.

Provenance

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