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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: lexe_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 479.7 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.1.tar.gz
Algorithm Hash digest
SHA256 99959e3350d30a675b2fd6f394349c024f0869ecf7a0c7df878ec28b02aa4c58
MD5 9a93b4915c10b3391ded7c23995c3946
BLAKE2b-256 768dc5ce0a4b857d22cd718e60591b19099494695b5005b8fee20f5318a7db50

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for lexe_sdk-0.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 52684109554a308bb336bf0a4904ba7d78119092d97cb767c8b5dadccaf57fdb
MD5 d51c3128ca6cd4ba7a5676520e7c0271
BLAKE2b-256 eb6f95862e67975cb967501057250b2b84ae43ec69db70018c07d17fc4db65f7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.1-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8b69e2e8a6e2f1062752345f152a5d5cfcef0ed20e6b1d992a23b0ac809c00c8
MD5 dc7b1960206373ce92ca5d19e9f63418
BLAKE2b-256 64420c7b501d9c965281aff56c1aa4c263727067f0f32301ef671b8f601987df

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c5260384e32f14a9d8ac5a33a8ffa47d75920e5eaef762f2b70a4825bffc43e
MD5 a3acb80c027f43ae2ecc91c965f3ecd1
BLAKE2b-256 c3d14c45cb707f932d58f3acb8c7971cd4c3b6b3f87c86d213d5501fa5179591

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58549ce4769306bfca7ae32d46d298fae4a637935a5c0643a8fc0ca603c0ff70
MD5 4e1e92ec229b54aaf6db35146a129a61
BLAKE2b-256 08242be47a68784c31536cd8a1ffeb51a10c8bbf95b99254b26818d1f911c9ab

See more details on using hashes here.

Provenance

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