Skip to main content

Python SDK for the dPaPay API — register wallets, list services, create escrows, check XRP balances, and more.

Project description

dPaPay Python SDK

PyPI Python

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dpapay_sdk-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

dpapay_sdk-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file dpapay_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: dpapay_sdk-0.1.0.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

Hashes for dpapay_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3d5287018a3f1452ae0efb41f6821b8028f52fe0b2ceadbb5085c6a4d143d3ca
MD5 29ffa8cee8ca896356fe712be2848d40
BLAKE2b-256 2f0f691748c3b56fd339c153a07fdaaae45594a961cc8279165d3e1fd209a07d

See more details on using hashes here.

File details

Details for the file dpapay_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dpapay_sdk-0.1.0-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

Hashes for dpapay_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d281d382c930fc9a5129ba996409da63f0942b15f74493572224ad55b3fb5b58
MD5 5a7ef17fb34d576d316e62bdc23de4ee
BLAKE2b-256 a2f76fcb8ff9b388baae73e863c13485286baaf40467c67e7105218c24d78ba0

See more details on using hashes here.

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