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

Uploaded Python 3Windows x86-64

lexe_sdk-0.1.4-py3-none-manylinux_2_28_aarch64.whl (5.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

lexe_sdk-0.1.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

lexe_sdk-0.1.4-py3-none-macosx_11_0_arm64.whl (5.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: lexe_sdk-0.1.4.tar.gz
  • Upload date:
  • Size: 472.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.4.tar.gz
Algorithm Hash digest
SHA256 01b13f4c1be6222302d54b0cd7548725da6d15a1fdec52d1d4f3efe09c067bab
MD5 e3c845bb73f5fcf53ba560bc0830d836
BLAKE2b-256 aad731764025d190d92b7370fde3f2cb4b223ef77730936841138a481b08a213

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lexe_sdk-0.1.4-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.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ef3275db2f470928a338811e62965b318d5bb22211c88565146913c0f3ebea2b
MD5 518a5ba9f55d59a21ba5cd7325b68e78
BLAKE2b-256 1c0918871e2c1394dcf57a41a1f54950234e0d3c6f7f5d5654ddd378a1d1f99f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.4-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5f0f969258c8cf6a4aeaeaabc062528a7fe2000500da002f184039240f1ab114
MD5 a1af9e455e025e984cd164d9e1bce419
BLAKE2b-256 d2fe2e4d71bf3eb0f050944fe1a95b97a76a0c5767ea9b44c2198cecf104cfe3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe87c63845c6e2395717038de017e69dfccd2d3bcbde525631ae3fea479e300c
MD5 9328ef8e5724af00c99249d62f442367
BLAKE2b-256 13159d692d27767e6ff2d21e83ca018454dd39f0ed0401a7e47bcd2101f4307f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for lexe_sdk-0.1.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bcf540dac91b24fd7c6b3da0f766438c0eac0071405b33783a1fee8ee61ae6ec
MD5 1efe0b7e55b147044512c2b79a95cfe8
BLAKE2b-256 dff86ab323d5f2fd492a733accc27adb21310961359b2b91357c40c27ff06ee6

See more details on using hashes here.

Provenance

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