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.10.tar.gz (494.8 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.10-py3-none-win_amd64.whl (5.2 MB view details)

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.10-py3-none-manylinux_2_28_aarch64.whl (6.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.10-py3-none-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: lexe_sdk-0.1.10.tar.gz
  • Upload date:
  • Size: 494.8 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.10.tar.gz
Algorithm Hash digest
SHA256 0602c7f98677ce8cb33a451aae49dbfd64cccd9af20493911e6549d3bcf7f304
MD5 72ae6226843ad7daf876e8a28fcaf307
BLAKE2b-256 a1e64477eaf45738ff668cf33ffc143320965cfaed22b4ca14d359b730f65908

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.10-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.2 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.10-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1918cdf6bd2a94bba305d490b321e45b8baf3bfb20ec81787d5293b0dbe33f2c
MD5 b68ec2a69b1ddba5639dfb237a37a4c2
BLAKE2b-256 493522f2b423a3346e538c6c05c90b671a319affdc590f6d306e2d3634186ecb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.10-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3e5de75d227436fdc8ce1020df5661ba2990dd1f8bacbe5f54bd09a1ba2753f3
MD5 74a8875ebe1921fd63f66f8c15811413
BLAKE2b-256 a85b90133c297f12a78d5fb5ad02ed7161a900397b6a6fbc795381f2f37924f4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8418f85d9d01b6143bd36a4a9cb7839ae307bf9444d285df7028c30b6b17c1a4
MD5 8e1faffa683da527a7bbb88640c52590
BLAKE2b-256 c6fe72d8b67dfdf24e8a4178c74a7f602cd609f1dd79dde7755692cb973aa911

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.10-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 268cb39a8b941917d0a489bd1459fe59f846005cb5f1b67d5a0bf34dc59629c5
MD5 956754b6c762c301cc00bed37f7bfaae
BLAKE2b-256 f7beda3606b764b9fa617b1fc66b064c754fef2df203dbe07e4156b863a8c48b

See more details on using hashes here.

Provenance

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