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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lexe_sdk-0.1.6.tar.gz.
File metadata
- Download URL: lexe_sdk-0.1.6.tar.gz
- Upload date:
- Size: 471.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
507f423c4cd62cd2ada7436c725589ddc43cf7cc2acc3baa884ca9d365568704
|
|
| MD5 |
4b0a49cf98b41232db8e19b99c8bdb00
|
|
| BLAKE2b-256 |
544987669c1c710f6e83d36ff7e5d337bde35485e1669d3fac40792ddf6f8455
|
Provenance
The following attestation bundles were made for lexe_sdk-0.1.6.tar.gz:
Publisher:
release-sdk-python.yml on lexe-app/lexe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexe_sdk-0.1.6.tar.gz -
Subject digest:
507f423c4cd62cd2ada7436c725589ddc43cf7cc2acc3baa884ca9d365568704 - Sigstore transparency entry: 1438921904
- Sigstore integration time:
-
Permalink:
lexe-app/lexe@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Branch / Tag:
refs/heads/master - Owner: https://github.com/lexe-app
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-python.yml@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file lexe_sdk-0.1.6-py3-none-win_amd64.whl.
File metadata
- Download URL: lexe_sdk-0.1.6-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1c0983814127d8f757d20549ecbce03c3a9e58ac52306f0e7ef14af02cbccb3
|
|
| MD5 |
1bacf72632497f3760c8f7518d478b26
|
|
| BLAKE2b-256 |
1071e858155a00aa7d276d6d9c3c834fddfc0da7880b61104083875314eb0b7e
|
Provenance
The following attestation bundles were made for lexe_sdk-0.1.6-py3-none-win_amd64.whl:
Publisher:
release-sdk-python.yml on lexe-app/lexe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexe_sdk-0.1.6-py3-none-win_amd64.whl -
Subject digest:
f1c0983814127d8f757d20549ecbce03c3a9e58ac52306f0e7ef14af02cbccb3 - Sigstore transparency entry: 1438921915
- Sigstore integration time:
-
Permalink:
lexe-app/lexe@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Branch / Tag:
refs/heads/master - Owner: https://github.com/lexe-app
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-python.yml@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file lexe_sdk-0.1.6-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: lexe_sdk-0.1.6-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 5.8 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f717426cf26f0b5514696c6b445234a689ff933ffb5452c8e962d833cb272607
|
|
| MD5 |
61cc572bcb701042c0d6880a071c366c
|
|
| BLAKE2b-256 |
38cf54800470431b876fa491bef008e6b32af3dbd359e33315e3d99cfafe9a23
|
Provenance
The following attestation bundles were made for lexe_sdk-0.1.6-py3-none-manylinux_2_28_aarch64.whl:
Publisher:
release-sdk-python.yml on lexe-app/lexe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexe_sdk-0.1.6-py3-none-manylinux_2_28_aarch64.whl -
Subject digest:
f717426cf26f0b5514696c6b445234a689ff933ffb5452c8e962d833cb272607 - Sigstore transparency entry: 1438921927
- Sigstore integration time:
-
Permalink:
lexe-app/lexe@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Branch / Tag:
refs/heads/master - Owner: https://github.com/lexe-app
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-python.yml@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file lexe_sdk-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: lexe_sdk-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.6 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10d2dc8962831af8262d2d8f3fc4b03ef2fa6d7e1afe4d441b40d63c1c8a7d20
|
|
| MD5 |
e15ba7b3d603af684c8cfda3f4cd17d7
|
|
| BLAKE2b-256 |
d059df80b410944ff08baf87343d9cfdc1020eccd1e7160017fd9ee8f441da9c
|
Provenance
The following attestation bundles were made for lexe_sdk-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release-sdk-python.yml on lexe-app/lexe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexe_sdk-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
10d2dc8962831af8262d2d8f3fc4b03ef2fa6d7e1afe4d441b40d63c1c8a7d20 - Sigstore transparency entry: 1438921943
- Sigstore integration time:
-
Permalink:
lexe-app/lexe@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Branch / Tag:
refs/heads/master - Owner: https://github.com/lexe-app
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-python.yml@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file lexe_sdk-0.1.6-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: lexe_sdk-0.1.6-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.3 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
991a552f117fdef0b30e78d407113d629ef3e08be7eb62a258c16f03851591ab
|
|
| MD5 |
9d2038220e54cdb77f2726e17779980d
|
|
| BLAKE2b-256 |
c67e8dd098025973e31e41dc5097b13a97ebedb7a0e6c28a9451bdc9fd6256f0
|
Provenance
The following attestation bundles were made for lexe_sdk-0.1.6-py3-none-macosx_11_0_arm64.whl:
Publisher:
release-sdk-python.yml on lexe-app/lexe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexe_sdk-0.1.6-py3-none-macosx_11_0_arm64.whl -
Subject digest:
991a552f117fdef0b30e78d407113d629ef3e08be7eb62a258c16f03851591ab - Sigstore transparency entry: 1438921933
- Sigstore integration time:
-
Permalink:
lexe-app/lexe@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Branch / Tag:
refs/heads/master - Owner: https://github.com/lexe-app
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk-python.yml@5ae3787af6d796bd192affdae0af0e1c95d175ac -
Trigger Event:
workflow_dispatch
-
Statement type: