Python SDK for the dPaPay API — register wallets, list services, create escrows, check XRP balances, and more.
Project description
dPaPay Python SDK
A lightweight Python client for the dPaPay API — register wallets, list & create services, manage XRP escrows, check fee schedules, and query XRP prices.
dPaPay is a no-account marketplace for buying and selling AI agents, code, data, and tools — with escrow-protected payments and instant settlement on the XRP Ledger.
Installation
pip install dpapay-sdk
Optional XRP Ledger library for advanced operations:
pip install dpapay-sdk[xrpl]
Quick Start
from dpapay import dPaPay
client = dPaPay()
Usage
1. Register a Wallet
result = client.register("My Trading Bot")
print(result["wallet"]["address"]) # r...
print(result["token"]) # API token (save this!)
2. List Services
result = client.services.list(limit=10, category="AI")
for svc in result["services"]:
print(f"{svc['name'][:40]:40s} {svc['price']:>8} XRP [{svc['category']}]")
print(f"Total: {result['total']}")
3. Create a Service Listing
svc = client.services.create(
name="AI Content Generator",
description="Generates high-quality blog posts using AI",
price=5.0,
category="AI",
agent_id="rXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
)
print(f"Created service {svc['id']}")
4. XRP Escrow Operations
# Network info
net = client.escrow.network()
print(f"Network: {net['network']}")
# Wallet info / balance
info = client.escrow.wallet("rXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
# Create escrow (seed-based)
escrow = client.escrow.create(
buyer_seed="sXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
seller_address="rXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
amount_xrp=10.0,
finish_after=80000000,
cancel_after=80001000,
)
# Create escrow (pre-signed transaction blob)
escrow = client.escrow.create_signed(
job_id="job-001",
signed_tx_blob="120000...",
buyer_address="rXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
seller_address="rXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
amount_xrp=10.0,
)
# Check status, finish or cancel
client.escrow.status("tx_hash")
client.escrow.finish("tx_hash")
client.escrow.cancel("tx_hash")
5. Get Fee Schedule
fees = client.fees.schedule(seller_id="rXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
print(f"Model: {fees['pricing_model']}")
for tier in fees['tiers']:
print(f" {tier['label']}: {tier['rate_pct']}%")
6. Get XRP Price
price = client.xrp.price()
print(f"XRP/USD: ${price['xrp_usd']}")
7. Submit Feedback
client.feedback.submit(name="Alice", message="Love the platform!")
API Reference
| SDK Method | HTTP | Endpoint |
|---|---|---|
client.register(label) |
POST | /api/auth/register |
client.services.list(limit, offset, category) |
GET | /api/services |
client.services.create(name, desc, price, category, agent_id) |
POST | /api/services |
client.escrow.create(buyer_seed, seller_address, amount_xrp, finish_after, cancel_after) |
POST | /api/escrow?action=create |
client.escrow.create_signed(job_id, signed_tx_blob, buyer_address, seller_address, amount_xrp) |
POST | /api/escrow?action=create |
client.escrow.finish(tx_hash) |
POST | /api/escrow?action=finish |
client.escrow.cancel(tx_hash) |
POST | /api/escrow?action=cancel |
client.escrow.status(tx_hash) |
POST | /api/escrow?action=status |
client.escrow.wallet(address) |
GET | /api/escrow?action=wallet |
client.escrow.network() |
GET | /api/escrow?action=network |
client.fees.schedule(seller_id) |
GET | /api/payments?action=myfee |
client.xrp.price() |
GET | /api/payments?action=prices |
client.feedback.submit(name, message) |
POST | /api/feedback |
Development
git clone https://github.com/dpapay/dpapay-sdk.git
cd dpapay-sdk
pip install -e .
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dpapay_sdk-0.1.1.tar.gz.
File metadata
- Download URL: dpapay_sdk-0.1.1.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc17ba1763a774daf57790f34ef1a63bf9c1e05ce5feb8e0e92c02ece26b06c7
|
|
| MD5 |
fff6002a09265401e06fbf8a5b190eda
|
|
| BLAKE2b-256 |
b2fb577ac26eb6bc891afca2127f8d110206d6e3694d2827c8d3cb9a820e1dfe
|
File details
Details for the file dpapay_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dpapay_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6055d5d71d527d36b3adb345f3b9dd78beb2f1ee323cd00d4d17e7d7637bd90f
|
|
| MD5 |
0cae01c7cc780375f6df696854caa4b3
|
|
| BLAKE2b-256 |
ee7bf87d473e5611080eaff51b73d4fcbaa6e753677c91a7d73a07df3ff3e101
|