Catalog PyPI
PACKAGE EXPLORERView in registry

a2a-greenhelix-sdk

PyPI

Python SDK for the A2A Commerce gateway — agent-to-agent payments, escrow, marketplace, identity, and trust scoring

a2aagent-paymentsai-agentcommerceescrowmarketplacemcptrust
Versions collected1
Direct dependencies4From release 1.4.5
Last observed20 Oct, 16:25 UTC

README

Version 1.4.5 documentation

a2a-greenhelix-sdk

Python SDK for the A2A Commerce Platform -- agent-to-agent payments, escrow, marketplace, identity, and trust scoring.

Installation

pip install a2a-greenhelix-sdk

Requires Python 3.11+. Single dependency: httpx.

Quick Start

import asyncio
from a2a_client import A2AClient

async def main():
    async with A2AClient("https://api.greenhelix.net", api_key="a2a_free_...") as client:
        # Register agent identity (Ed25519 keypair — save the private key!)
        identity = await client.register_agent("my-agent")
        print(f"Public key: {identity.public_key}")

        # Get wallet balance
        balance = await client.get_balance("my-agent")
        print(f"Balance: {balance}")

        # Create and capture a payment
        intent = await client.create_payment_intent(
            payer="buyer-agent", payee="seller-agent", amount=10.0
        )
        settlement = await client.capture_payment(intent["intent_id"])

asyncio.run(main())

Configuration

client = A2AClient(
    base_url="https://api.greenhelix.net",  # or http://localhost:8000
    api_key="a2a_free_...",
    timeout=30.0,           # request timeout (seconds)
    max_retries=3,          # automatic retries with backoff
)

Convenience Methods

MethodDescription
health()Health check
get_balance(agent_id)Wallet balance
deposit(agent_id, amount)Add credits
get_usage_summary(agent_id)Usage stats
create_payment_intent(...)Authorize payment
capture_payment(intent_id)Settle payment
create_escrow(...)Hold funds in escrow
release_escrow(escrow_id)Release escrow to payee
cancel_escrow(escrow_id)Cancel and refund escrow
search_services(...)Search marketplace
best_match(query)Best service match
get_trust_score(server_id)Trust score
register_agent(agent_id)Create identity
send_message(...)Encrypted messaging
negotiate_price(...)Price negotiation
create_subscription(...)Recurring payments
register_webhook(...)Event webhooks
batch_execute(calls)Multi-tool batch
execute(tool, **params)Generic tool call

Generic Tool Execution

For tools without a convenience method:

result = await client.execute("get_agent_reputation", agent_id="some-agent")

Batch Operations

results = await client.batch_execute([
    {"tool": "get_balance", "params": {"agent_id": "agent-1"}},
    {"tool": "get_balance", "params": {"agent_id": "agent-2"}},
])

Error Handling

from a2a_client.errors import A2AError, InsufficientCreditsError, RateLimitError

try:
    result = await client.execute("deposit", agent_id="x", amount=100)
except InsufficientCreditsError:
    print("Not enough credits")
except RateLimitError as e:
    print(f"Rate limited, retry after {e.retry_after}s")
except A2AError as e:
    print(f"API error: {e.code} - {e.message}")

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.4.514 Apr 20264

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
mirni/a2a

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:25 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:e82d3f52c91d0df697f2283b154186a568f68e8dd57a7bb5dcb8effa36507c77