Skip to main content

Playmos SDK for Python — REST client for Base Sepolia sandbox (IAP verify/pay, agents, transfers). Server-side secrets only. No web3 signing.

Project description

playmos (Python) — 0.1.0a1

Thin REST client for the Playmos 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

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

Dev from monorepo:

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

Quickstart — verify then grant

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)

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_)

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 · this phase #81

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

playmos-0.1.0a1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

playmos-0.1.0a1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file playmos-0.1.0a1.tar.gz.

File metadata

  • Download URL: playmos-0.1.0a1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for playmos-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 329c2a58e8eb42b6f3fa45a2e51ea9f7483834f238e0f2161a402fbb8016f39a
MD5 43f234d4e56e61abc13fc837268c34fc
BLAKE2b-256 e43b05752326804f7da83c498b4504b576bf1faf26379a302d16a1c270809e0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for playmos-0.1.0a1.tar.gz:

Publisher: publish-pypi.yml on playmos-labs/playmos-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file playmos-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: playmos-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for playmos-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 22735a61d7ffc29cf5086cf8392f70b638f3f97f5825ee4d5164b7ba936a56f4
MD5 b3bc5396123cd6d28ecff4f4aa7984b8
BLAKE2b-256 95930b0c8c125742e62a9cb14a0f502f3b853aa579c7828c5fe309469c1a5807

See more details on using hashes here.

Provenance

The following attestation bundles were made for playmos-0.1.0a1-py3-none-any.whl:

Publisher: publish-pypi.yml on playmos-labs/playmos-sdk

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