Metadata-Version: 2.4
Name: playmos
Version: 0.1.0a1
Summary: Playmos SDK for Python — REST client for Base Sepolia sandbox (IAP verify/pay, agents, transfers). Server-side secrets only. No web3 signing.
Project-URL: Homepage, https://playmos.io
Project-URL: Documentation, https://playmos.io/docs
Project-URL: Repository, https://github.com/playmos-labs/playmos-sdk
Project-URL: Issues, https://github.com/playmos-labs/playmos-sdk/issues
Author: Playmos Labs
License: Proprietary
License-File: LICENSE.txt
Keywords: base,games,payments,playmos,sepolia,usdc
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary 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: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# playmos (Python) — 0.1.0a1

Thin **REST** client for the [Playmos](https://playmos.io) sandbox API on **Base Sepolia**.  
Mirrors **Playmos.Sdk** (C#) / server half of the SDK. **No web3 signing. No crypto UX.**

> Testnet only. Mainnet is not available yet.  
> **Never put `sk_test_` in a game client or browser.** Use this package on your **game server**.

## Install

```bash
pip install playmos==0.1.0a1
# after PyPI publish (tag py-v0.1.0a1)
```

Dev from monorepo:

```bash
cd python
pip install -e ".[dev]"
pytest
```

## Quickstart — verify then grant

```python
import os
from playmos import PlaymosClient

# SERVER only — secret key
client = PlaymosClient(os.environ["PLAYMOS_SECRET"])  # sk_test_…

p = client.verify(payment_id)
if p.is_confirmed:
    grant_item(p.player_id, p.sku)
```

## Sandbox server-settle pay (pk_test_ only)

```python
from playmos import PlaymosClient

client = PlaymosClient.for_sandbox_public_key()
payment = client.pay("0.99", "gems_500", "player_abc")
# payment.status == "confirmed"; open payment.tx_hash on sepolia.basescan.org
```

## Agents + transfer (sk_test_)

```python
from playmos import PlaymosClient

client = PlaymosClient.for_agent_sandbox_key()  # testnet only, still server-side
a = client.create_wallet("npc_miner")
client.fund(a.agent_id, "0.50")
client.transfer(to="npc_shop", amount="0.10", from_=a.agent_id, fee_bps=0)
```

## Surfaces

| Method | Key | Purpose |
|---|---|---|
| `verify` | pk or sk | Verify before grant |
| `pay` | **pk_test_ only** | Server-settle IAP |
| `create_wallet` / `fund` | **sk_test_** | NPC wallets + faucet |
| `transfer` / `get_transfer` | **sk_test_** for NPC from | USDC transfer |
| `get_prize` | studio key | Claimable read (withdraw = player-signed JS) |

## 429 retry

Default ON (`max_retries=2`). Opt out: `RetryOptions.disabled()`.

## Security

| Key | Where |
|---|---|
| `pk_test_playmos_sandbox` | Sandbox pay demos |
| `sk_test_…` | **Server only** |
| Game client | **No secrets** |

## Issues

Parent [#76](https://github.com/playmos-labs/playmos-sdk/issues/76) · this phase [#81](https://github.com/playmos-labs/playmos-sdk/issues/81)
