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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

File metadata

  • Download URL: lexe_sdk-0.1.7.tar.gz
  • Upload date:
  • Size: 481.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.7.tar.gz
Algorithm Hash digest
SHA256 9fe9569fa40368aeadda95a10254ea74285a8c3f276008db605e0fc5320c7b69
MD5 e43541971c56fc3262a4923ad2cee18d
BLAKE2b-256 984049e58ed7917b3d823aee74abe97e3026dfd59396e5a4196c092eb6c34557

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.7-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.7-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 71ce5dadad4f495483be841597611c72326bf3ff9b6e13c638847809bb0671f8
MD5 b9e5a5070b65bd1ec7041f74d4412786
BLAKE2b-256 c09d98c891e04678a4ce4cb11bbc1112f315ee05cdca7cae99f6851faa594df0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.7-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1269e8e0548d873a28425a575bd1876c1fa6888f3aabb5cab320a310be9de91b
MD5 22cf9034af2738ae3f0f1e39ad3362ba
BLAKE2b-256 e359ac40327857a0cfbd578085a836f0ca703e90710d0a380f8b6080112c1991

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7f93d9db4216f8c949eb16ede0f3bf3282dc13541725422dbf2e456745fcf578
MD5 5414a53caf4850dff1c77367beae9740
BLAKE2b-256 61c516249ea8b68961498ede5a039206062d69c71b865047940c02e30685285a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.7-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6ba0e1a1cfd12c8a6becaf68595c8a7fb2ec25666bac8e71974c40258651ad1c
MD5 04a30b66baaffa5db3b6f3d9beead434
BLAKE2b-256 f55b968b5325cd6679a58ef2349b00fc057579494958ca6d3c37e2bb3bb161da

See more details on using hashes here.

Provenance

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