Lux Docs

Python SDK

Python client library for Lux Network

The Python SDK (luxfi-sdk) provides a high-level interface for interacting with Lux Network from Python applications. It supports C-Chain and Subnet EVM chains via Web3.py, with convenience wrappers for common operations.

Installation

pip install luxfi-sdk

Or with uv:

uv pip install luxfi-sdk

Quick Start

from luxfi_sdk import LuxClient

client = LuxClient("https://api.lux.network/mainnet")

# Get C-Chain block number
block = client.c_chain.block_number()
print(f"Latest block: {block}")

# Get balance
balance = client.c_chain.get_balance(
    "0x9011E888251AB053B7bD1cdB598Db4f9DEd94714"
)
print(f"Balance: {balance} wei")

Core Modules

ModulePurpose
luxfi_sdk.clientTop-level client for all chain operations
luxfi_sdk.walletKey management and transaction signing
luxfi_sdk.rpcRaw JSON-RPC calls to any chain endpoint
luxfi_sdk.contractsSmart contract interaction helpers
luxfi_sdk.typesTyped request/response models

Chain Support

ChainRPCTransactionsContracts
C-ChainYesYesYes
Subnet EVM (Zoo, Hanzo, SPC, Pars)YesYesYes
P-ChainRead-onlyNoN/A
X-ChainRead-onlyNoN/A

Network Endpoints

# Mainnet
client = LuxClient("https://api.lux.network/mainnet")

# Testnet
client = LuxClient("https://api.lux.network/testnet")

# Local development
client = LuxClient("http://127.0.0.1:9630")

On this page