Skip to main content

paysponge

Python SDK for Sponge.

The paysponge package gives Python apps access to Sponge agent wallets, platform provisioning, transfers, balances, cards, and paid request workflows.

Concepts

Sponge has two client types:

  • SpongeWallet is the runtime client for one agent. Use it with an agent API key when that agent needs to inspect balances, get wallet addresses, transfer funds, create cards, or make paid requests.
  • SpongePlatform is the control-plane client for your backend. Use it with a master/platform API key when you need to create agents or manage many agents for your product.

An agent is the Sponge identity that owns wallets and permissions. In a multi-user app, you typically create one Sponge agent per user, bot, workflow, or worker. Each agent gets its own agent API key. Your backend can use SpongePlatform to provision those agents, then store the returned agent key with your own user or worker record. At runtime, use SpongeWallet with that agent key so actions are scoped to the correct agent.

Install

pip install paysponge

Quick Start

Use an agent API key with SpongeWallet. The wallet client acts on behalf of one Sponge agent.

from paysponge import SpongeWallet

wallet = SpongeWallet.connect(api_key="sponge_test_xxx")

agent = wallet.get_agent()
addresses = wallet.get_addresses()
balances = wallet.get_balances()

print(agent.id)
print(addresses)
print(balances)

An agent is the Sponge identity that owns the wallets and permissions used by the SDK. wallet.get_agent() fetches the current agent for the API key and stores its agent.id on the client, so later calls can use that agent by default.

You can also read the API key from the environment:

export SPONGE_API_KEY=sponge_test_xxx
from paysponge import SpongeWallet

wallet = SpongeWallet.connect()
print(wallet.get_addresses())

Platform Usage

Use a master/platform API key with SpongePlatform when your backend needs to create or manage agents. Platform keys are higher-trust credentials and should stay on your server. They are for provisioning and administration, not for day-to-day agent actions.

from paysponge import SpongePlatform

platform = SpongePlatform.connect(api_key="sponge_master_xxx")
agent = platform.create_agent(name="Hackathon Agent")

print(agent.id)

Typical platform flow:

  1. Your backend authenticates with SpongePlatform using a master key.
  2. It creates a Sponge agent for a user, bot, or worker.
  3. It stores the returned agent API key with your own application record.
  4. Runtime code uses SpongeWallet with that agent API key.

Examples

Source examples are available in the repository:

  • mobwallet/python/paysponge/examples/basic.py
  • mobwallet/python/paysponge/examples/transfer.py
  • mobwallet/python/paysponge/examples/basic_sdk.py

From a clone of the repository:

cd mobwallet/python/paysponge
SPONGE_API_KEY=sponge_test_xxx uv run python examples/basic.py
SPONGE_API_KEY=sponge_test_xxx RECIPIENT_ADDRESS=0x... uv run python examples/transfer.py

Common Methods

wallet.get_agent()
wallet.get_addresses()
wallet.get_balances()
wallet.get_wallets()
wallet.transfer(chain="base", to="0x...", amount="1.00", currency="USDC")
wallet.issue_virtual_card(
    amount="25.00",
    merchant_name="Example Store",
    merchant_url="https://example.com",
)
wallet.get_sponge_card_status()
wallet.paid_fetch(url="https://example.com")

Cards

Card methods live on SpongeWallet, because cards are issued or managed for a specific Sponge agent:

card = wallet.issue_virtual_card(
    amount="25.00",
    currency="USD",
    merchant_name="Example Store",
    merchant_url="https://example.com",
)

status = wallet.get_sponge_card_status(refresh=True)

Available card helpers include:

  • wallet.store_credit_card(...)
  • wallet.get_stored_credit_card()
  • wallet.get_card(...)
  • wallet.issue_virtual_card(...)
  • wallet.report_card_usage(...)
  • wallet.get_sponge_card_status(...)
  • wallet.onboard_sponge_card(...)
  • wallet.accept_sponge_card_terms(...)
  • wallet.create_sponge_card(...)
  • wallet.get_sponge_card_details()
  • wallet.fund_sponge_card(...)
  • wallet.withdraw_sponge_card(...)
  • wallet.add_link_payment_method(...)
  • wallet.create_link_payment_credential(...)

Tests

From a clone of the repository:

cd mobwallet/python/paysponge
uv run python -m unittest discover -s tests

Metadata

Release files for paysponge 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paysponge 0.1.5
File Size Uploaded Provenance Actions
paysponge-0.1.5.tar.gz 114.7 kB With provenance Details for paysponge-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for paysponge 0.1.5
File Interpreter ABI Platform Actions
paysponge-0.1.5-py3-none-any.whl Python 3 none any Details for paysponge-0.1.5-py3-none-any.whl

Total release size: 401.1 kB

Release files / paysponge-0.1.5.tar.gz

Download URL paysponge-0.1.5.tar.gz
Size 114.7 kB
Tags Source
SHA-256 checksum
How to use checksums
df371308f026895d7398cae452177655f182915aefa1a74c845536d61e04d5f3
BLAKE2b-256 checksum
How to use checksums
44c2fc40aff547eba1d8187d5bb0eefba61453d19d3d955ac834d98927351bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Release files / paysponge-0.1.5-py3-none-any.whl

Download URL paysponge-0.1.5-py3-none-any.whl
Size 286.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
931b85ebc1d08f66393342c7a233bb15a0bcc4977ed2feaf63bd77f65a815902
BLAKE2b-256 checksum
How to use checksums
5af83349dc9324cdca7bce462d71a92aeaa41c758be29fa491e7af4f3164d1ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Security for paysponge 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for paysponge-0.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page