Metadata-Version: 2.4
Name: walley-sdk
Version: 0.4.0
Summary: Official Python SDK for the Walley wallet API on Canton Network
Project-URL: Homepage, https://walley.cc
Project-URL: Documentation, https://docs.walley.cc
Project-URL: Source, https://github.com/k2flabs/walley
Author: Walley
License-Expression: MIT
Keywords: canton,cip-56,sdk,wallet,walley
Requires-Python: >=3.10
Requires-Dist: cryptography>=42
Requires-Dist: httpx>=0.27
Requires-Dist: mnemonic>=0.20
Requires-Dist: pydantic>=2.7
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Description-Content-Type: text/markdown

# walley-sdk

Official Python SDK for [Walley](https://walley.cc) — programmatic
self-custody of CIP-56 tokens on Canton Network. Your process holds the
wallet's key, signs locally, and submits transactions; the API only ever
sees public keys and signatures.

```bash
pip install walley-sdk
```

```python
from walley import Walley

w = Walley(
    key_file="~/.config/walley/alice.key",   # PEM or 24-word mnemonic file
    party_hint="walley-alice",
)

for balance in w.balances:
    print(balance.instrument_id, balance.total_balance)

result = w.transactions.execute(commands)   # your dapp's own ledger commands
result = w.transfers.send(receiver="walley-bob::1220...", amount="5")
print(result.update_id, result.fee)
```

Transaction fees are drawn from a **prepaid traffic balance**. Pre-buy
traffic, then send freely; each fee is reserved from the balance and settled
from the completion — no per-transaction payment step:

```python
w.traffic.purchase("10")               # buy 10 CC of traffic
print(w.traffic.balance().available)   # spendable balance (may go negative once)
```

If the balance goes negative the next send raises `InsufficientTrafficError` —
call `w.traffic.purchase(amount)` to continue.

**Full documentation: [docs.walley.cc/python-sdk](https://docs.walley.cc/python-sdk/overview)** —
quickstart, keys & authentication, transactions & the prepaid traffic model,
wallet operations, and ledger reads.

## Development

```bash
cd walley-sdk
pip install -e '.[dev]'
pytest
```
