Metadata-Version: 2.4
Name: lends-sdk
Version: 0.1.0
Summary: Non-custodial Python SDK for LENDS lending, leUSD, and sleUSD.
Project-URL: Homepage, https://github.com/lendsprotocol/lends-sdk-python
Project-URL: Repository, https://github.com/lendsprotocol/lends-sdk-python
Project-URL: Issues, https://github.com/lendsprotocol/lends-sdk-python/issues
Author: LENDS Protocol
License: MIT License
        
        Copyright (c) 2026 LENDS Protocol
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: defi,ethereum,lending,lends,leusd,sleusd
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: web3<8,>=7.14
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.15; extra == 'dev'
Requires-Dist: ruff>=0.11; extra == 'dev'
Requires-Dist: twine>=6.1; extra == 'dev'
Description-Content-Type: text/markdown

# LENDS Python SDK

Typed, non-custodial access to LENDS lending/borrowing, the leUSD PSM, and sleUSD staking.

## Install

```bash
python -m pip install lends-sdk
```

## Usage

```python
import os
from lends_sdk import LendsClient

lends = LendsClient(os.environ["RPC_URL"])
lends.assert_chain()

protocol = lends.get_protocol_state()
markets = lends.get_markets()
position = lends.get_position(
    "0x1111111111111111111111111111111111111111",
    markets[0].address,
)

amount = 10 ** markets[0].collateral_decimals
approval = lends.transactions.approve_collateral(markets[0].address, amount)
deposit = lends.transactions.deposit(markets[0].address, amount)
```

`PreparedTransaction.as_dict()` returns `to`, `data`, `value`, and `chainId` for a wallet or signing system. The SDK does not accept private keys, sign, or broadcast.

All amounts are raw integer token units. leUSD and sleUSD use 6 decimals; collateral and USDG decimals are read on-chain; oracle prices are normalized to 8 decimals. Quotes and projected position values are point-in-time previews. Contract execution is authoritative.

## Scope

Included: approvals, collateral deposit/withdrawal, borrow/repay, fee accrual, PSM conversion, sleUSD stake/unstake lifecycle, and relevant state/statistics.

Excluded: every privileged write, liquidation execution, reserves, harvests, losses, minters, risk settings, pauses, ownership, upgrades, LENDS purchases, locks, liquidity, and vesting.

## Development

```bash
python -m pip install -e ".[dev]"
python -m unittest discover -s tests
ruff check .
mypy
python -m build
twine check dist/*
```

