From a76f24eaae78c689d9c1325bd6f67e325bb8a584 Mon Sep 17 00:00:00 2001 From: Edgadafi <203378643+Edgadafi@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:05:39 +0000 Subject: [PATCH 1/3] feat(examples): add OpenAI Agents SDK x402 tool example (#365) Co-authored-by: Edgadafi --- examples/openai-agents-x402/.env.example | 10 + examples/openai-agents-x402/.gitignore | 5 + examples/openai-agents-x402/README.md | 206 ++++++++++++++ examples/openai-agents-x402/agent.py | 112 ++++++++ examples/openai-agents-x402/nirium_tool.py | 136 ++++++++++ examples/openai-agents-x402/requirements.txt | 8 + .../openai-agents-x402/test_openai_tool.py | 253 ++++++++++++++++++ 7 files changed, 730 insertions(+) create mode 100644 examples/openai-agents-x402/.env.example create mode 100644 examples/openai-agents-x402/.gitignore create mode 100644 examples/openai-agents-x402/README.md create mode 100644 examples/openai-agents-x402/agent.py create mode 100644 examples/openai-agents-x402/nirium_tool.py create mode 100644 examples/openai-agents-x402/requirements.txt create mode 100644 examples/openai-agents-x402/test_openai_tool.py diff --git a/examples/openai-agents-x402/.env.example b/examples/openai-agents-x402/.env.example new file mode 100644 index 0000000..4d3633d --- /dev/null +++ b/examples/openai-agents-x402/.env.example @@ -0,0 +1,10 @@ +# Stellar testnet secret key (funded via Friendbot) +# Generate: https://laboratory.stellar.org/#account-creator?network=test +STELLAR_SECRET_KEY= + +# Optional: OpenAI API key for live agent runs +OPENAI_API_KEY= + +# x402 server settings (defaults work for local testing) +X402_SERVER_PORT=3402 +X402_PRICE=0.02 diff --git a/examples/openai-agents-x402/.gitignore b/examples/openai-agents-x402/.gitignore new file mode 100644 index 0000000..6e2c440 --- /dev/null +++ b/examples/openai-agents-x402/.gitignore @@ -0,0 +1,5 @@ +.env +__pycache__/ +*.pyc +.pytest_cache/ +*.log diff --git a/examples/openai-agents-x402/README.md b/examples/openai-agents-x402/README.md new file mode 100644 index 0000000..47def33 --- /dev/null +++ b/examples/openai-agents-x402/README.md @@ -0,0 +1,206 @@ +# OpenAI Agents SDK x402 Tool Example + +A `@function_tool` for the **OpenAI Agents SDK** (Python) that lets an agent pay x402 endpoints through the Nirium Python SDK with a per-payment spend cap. + +## Features + +- ✅ Uses OpenAI Agents SDK `@function_tool` decorator +- ✅ Wraps `Agent.x402_fetch()` with `max_amount_per_payment` cap +- ✅ Refuses payments above the cap **before signing** (raises `X402SpendCapError`) +- ✅ Returns clear error messages the agent can explain +- ✅ Includes transaction hashes in responses for audit trails +- ✅ Testnet only (no real funds) + +## Package Versions Tested + +``` +nirium==0.12.7 +openai-agents==0.25.0 +python-dotenv==1.0.0 +pytest==8.3.0 +pytest-asyncio==0.24.0 +``` + +## Files + +- **`nirium_tool.py`** — OpenAI Agents SDK `@function_tool` wrapper +- **`agent.py`** — Example agent that uses the tool +- **`test_openai_tool.py`** — 8 offline tests (no network) +- **`requirements.txt`** — Exact dependency versions +- **`.env.example`** — Environment template +- **`.gitignore`** — Prevents committing secrets + +## Setup + +### 1. Install Dependencies + +```bash +pip install -r requirements.txt +``` + +### 2. Configure Environment + +Copy `.env.example` to `.env` and add your Stellar testnet secret key: + +```bash +cp .env.example .env +``` + +Generate a testnet key at: https://laboratory.stellar.org/#account-creator?network=test + +Fund it using Friendbot (automatic in Stellar Laboratory). + +**⚠️ NEVER commit your `.env` file or share secret keys!** + +## Tests + +Run offline tests (no network, no real LLM calls): + +```bash +pytest test_openai_tool.py -v +``` + +All 8 tests pass: + +``` +test_openai_tool.py::test_initialize_sets_cap PASSED [ 12%] +test_openai_tool.py::test_successful_payment_below_cap PASSED [ 25%] +test_openai_tool.py::test_payment_above_cap_refused PASSED [ 37%] +test_openai_tool.py::test_network_mismatch_error PASSED [ 50%] +test_openai_tool.py::test_uninitialized_agent PASSED [ 62%] +test_openai_tool.py::test_extract_settlement_tx_from_various_formats PASSED [ 75%] +test_openai_tool.py::test_tool_returns_string_result PASSED [ 87%] +test_openai_tool.py::test_function_tool_decorator PASSED [100%] + +============================== 8 passed in 1.19s =============================== +``` + +## Test Coverage + +### ✅ Tested Offline (Mocked) + +1. **Initialization with spend cap** — Verifies the cap is set correctly +2. **Successful payment below cap** — Payment within cap succeeds +3. **Payment above cap refused** — **Key test:** Above-cap payment refused before signing, `X402SpendCapError` raised, nothing signed +4. **Network mismatch** — Wrong network is detected and refused +5. **Uninitialized agent** — Clear error when tool not initialized +6. **Transaction hash extraction** — Settlement data parsing works +7. **String result formatting** — Non-dict responses handled correctly +8. **@function_tool decorator** — Verifies FunctionTool wrapper is applied + +### Testnet Evidence + +**Test account:** [GCE3GDLLGGKOVDDAZ4OHD6JC5FCD6CZZCADC4CFKQ66NKCB5U6XFOI6Z](https://stellar.expert/explorer/testnet/account/GCE3GDLLGGKOVDDAZ4OHD6JC5FCD6CZZCADC4CFKQ66NKCB5U6XFOI6Z) + +**Transactions (all on Stellar testnet):** +1. **Funding TX:** [57071cb932fe8d6322907ed4a465bb831804d7fed0cbd1c4e8064e0a70c8e7aa](https://stellar.expert/explorer/testnet/tx/57071cb932fe8d6322907ed4a465bb831804d7fed0cbd1c4e8064e0a70c8e7aa) — 10,000 XLM from Friendbot +2. **USDC Trustline TX:** [6678d7f359a84285c87698ce0e11f5a35d36fdb2fd8591cedef8cd3a750fc0a2](https://stellar.expert/explorer/testnet/tx/6678d7f359a84285c87698ce0e11f5a35d36fdb2fd8591cedef8cd3a750fc0a2) — Trustline to testnet USDC (`GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5`) +3. **x402 Payment TX #1:** [144d209009cf6b2c0d940a3e99246c793936e37ebb7e267d4c3feafb8fb6cdec](https://stellar.expert/explorer/testnet/tx/144d209009cf6b2c0d940a3e99246c793936e37ebb7e267d4c3feafb8fb6cdec) — **Real paid x402 call** via `@function_tool` (0.02 USDC, below $1 cap) ✅ +4. **x402 Payment TX #2:** [1bed22cbdb1081c3f3295a6cd305322a349d57d1233f2c0aa795ef72d179401e](https://stellar.expert/explorer/testnet/tx/1bed22cbdb1081c3f3295a6cd305322a349d57d1233f2c0aa795ef72d179401e) — **Demo video payment** via `@function_tool` (0.02 USDC) ✅ + +Generated fresh keys using `stellar_sdk.Keypair.random()`. + +**Test Results:** +- ✅ **Payment below cap succeeded:** 0.02 USDC payment through the `@function_tool` to Nirium's testnet premium endpoint +- ✅ **Over-cap request refused:** Reinitializing with `max_amount_per_payment='$0.01'` and retrying correctly refused with `X402SpendCapError`, **no transaction signed** + +The critical functionality—**spend cap enforcement before signing**—is proven both in offline tests (`test_payment_above_cap_refused`) and in the real testnet run where the over-cap request was refused with no TX hash. + +## Architecture + +``` +┌─────────────────────────┐ +│ OpenAI Agents SDK Agent │ +│ (with @function_tool) │ +└────────┬────────────────┘ + │ + │ @function_tool + ↓ +┌─────────────────────────┐ +│ nirium_x402_fetch │ +│ (max_amount=$1) │ +└────────┬────────────────┘ + │ + │ Agent.x402_fetch() + ↓ +┌─────────────────────────┐ HTTP 402 +│ Nirium Python SDK │◄─────────────┐ +│ (X402SpendCapError) │ │ +└────────┬────────────────┘ │ + │ │ + │ Stellar payment │ + ↓ │ +┌─────────────────────────┐ ┌───────────────┐ +│ Stellar Testnet │ │ x402 Server │ +│ (USDC payment) │──────►│ (testnet) │ +└─────────────────────────┘ └───────────────┘ +``` + +## Usage Example + +```python +from agents import Agent as OpenAIAgent +from nirium_tool import initialize_nirium_x402, nirium_x402_fetch + +# Initialize with spend cap +initialize_nirium_x402( + secret_key="S...", # Your Stellar testnet secret + network="stellar:testnet", + max_amount_per_payment="$1", +) + +# Create agent with the tool +agent = OpenAIAgent( + name="Payment Agent", + instructions="You can make paid calls to x402 endpoints.", + tools=[nirium_x402_fetch], + model="gpt-4o-mini", +) + +# Agent can now call the tool +# Payments above $1 will be refused before signing +``` + +## How the Spend Cap Works + +1. **Before signing:** The SDK checks if the payment amount exceeds the cap +2. **If over cap:** Raises `X402SpendCapError` immediately +3. **Nothing signed:** No transaction is built or submitted +4. **Clear message:** The tool returns a JSON error the agent can explain: + +```json +{ + "error": "X402SpendCapError", + "message": "Payment refused: The requested payment exceeds the per-payment cap of $1. The server requested 15000000 stroops of CBIELTK6.... Nothing was signed or sent.", + "details": { + "url": "http://...", + "amount": "15000000", + "asset": "CBIELTK6...", + "cap": "$1" + } +} +``` + +## Security Checklist + +- ✅ Testnet only (no mainnet, no real funds) +- ✅ Secret keys never committed (`.env` in `.gitignore`) +- ✅ Keys never exposed to LLM (redacted from errors) +- ✅ Spend cap enforced BEFORE signing +- ✅ Own keys only (generated fresh, never use keys from others) +- ✅ No custody (keys stay with owner) + +## Pattern + +This example follows the same pattern as `langchain_tools.py`: +- Secret key used only in `init_x402()` +- Never stored in tool schema +- Never appears in LLM-visible errors +- Spend cap enforced by the SDK before signing +- Clear error messages returned as JSON + +The `@function_tool` decorator integrates seamlessly with the OpenAI Agents SDK `Agent` and `Runner`. + +## License + +Apache-2.0 (same as Nirium Protocol) diff --git a/examples/openai-agents-x402/agent.py b/examples/openai-agents-x402/agent.py new file mode 100644 index 0000000..1a102f9 --- /dev/null +++ b/examples/openai-agents-x402/agent.py @@ -0,0 +1,112 @@ +"""OpenAI Agents SDK agent that uses Nirium x402 payment tool. + +This script demonstrates: +1. A successful paid call (below the spend cap) +2. A refused call (above the spend cap) that returns a clear error + +The agent uses the OpenAI Agents SDK with the @function_tool decorator. +""" + +from __future__ import annotations + +import asyncio +import json +import os +import sys +from typing import Any + +from agents import Agent as OpenAIAgent +from dotenv import load_dotenv + +from nirium_tool import initialize_nirium_x402, nirium_x402_fetch + + +def _load_env() -> tuple[str, str]: + """Load environment variables and return (secret_key, server_url).""" + load_dotenv() + + secret_key = os.getenv("STELLAR_SECRET_KEY") + if not secret_key: + print("❌ Error: STELLAR_SECRET_KEY not set in .env") + print(" Generate a testnet key at: https://laboratory.stellar.org/#account-creator?network=test") + sys.exit(1) + + port = os.getenv("X402_SERVER_PORT", "3402") + server_url = f"http://localhost:{port}" + + return secret_key, server_url + + +async def test_agent(server_url: str) -> None: + """Run the agent with both test scenarios.""" + print("\n" + "="*60) + print("🤖 OpenAI Agents SDK Test") + print("="*60) + + # Create agent with the Nirium x402 tool + agent = OpenAIAgent( + name="Nirium x402 Payment Agent", + instructions=( + "You are a helpful agent that can make paid calls to x402-protected endpoints. " + "When asked to fetch data from a URL, use the nirium_x402_fetch tool. " + "If a payment is refused due to the spend cap, explain this clearly to the user." + ), + tools=[nirium_x402_fetch], + model="gpt-4o-mini", + ) + + # Test 1: Cheap endpoint (below cap) + print("\n📝 Test 1: Calling cheap endpoint (below $1 cap)") + print("-" * 60) + cheap_url = f"{server_url}/paid/market-summary" + + try: + result1 = await agent.run(f"Please fetch data from {cheap_url}") + print(f"✅ Agent response: {result1}") + except Exception as e: + print(f"Result: {e}") + + # Test 2: Expensive endpoint (above cap) - for this we'll create a modified URL + # Since the express server has only one endpoint, we'll test the cap by + # modifying our cap or testing the actual behavior + print("\n📝 Test 2: Testing spend cap enforcement") + print("-" * 60) + print("Note: The express-x402 server charges 0.02 USDC (below $1 cap).") + print("To test the cap, we'd need a server with a >$1 endpoint.") + print("The spend cap logic is tested in test_openai_tool.py offline tests.") + + print("\n" + "="*60) + print("✅ Agent tests complete!") + print("="*60) + + +async def main() -> int: + """Main entry point.""" + secret_key, server_url = _load_env() + + # Initialize Nirium x402 with $1 cap + print(f"🔧 Initializing Nirium x402 client (cap: $1, network: stellar:testnet)") + initialize_nirium_x402( + secret_key=secret_key, + network="stellar:testnet", + max_amount_per_payment="$1", + ) + + # Check if OpenAI API key is available + api_key = os.getenv("OPENAI_API_KEY") + if not api_key: + print("\n⚠️ OPENAI_API_KEY not set - cannot run live agent") + print(" Set OPENAI_API_KEY in .env to test with a real model") + print(" For now, run the offline tests: pytest test_openai_tool.py -v") + return 1 + + await test_agent(server_url) + return 0 + + +if __name__ == "__main__": + try: + sys.exit(asyncio.run(main())) + except KeyboardInterrupt: + print("\n\n👋 Interrupted by user") + sys.exit(1) diff --git a/examples/openai-agents-x402/nirium_tool.py b/examples/openai-agents-x402/nirium_tool.py new file mode 100644 index 0000000..ac32ffe --- /dev/null +++ b/examples/openai-agents-x402/nirium_tool.py @@ -0,0 +1,136 @@ +"""OpenAI Agents SDK @function_tool wrapper for Nirium x402 payments. + +Wraps the Nirium Python SDK's x402_fetch with a per-payment spend cap. +The Stellar secret is used only to initialize Agent.init_x402 and is never +stored in the tool schema or exposed to the LLM. + +Uses the OpenAI Agents SDK (@function_tool decorator) to integrate with +the Agents SDK Agent and Runner. +""" + +from __future__ import annotations + +import json +from typing import Any, Optional + +from agents import function_tool + +from nirium import Agent, X402SpendCapError, X402NetworkMismatchError + + +# Global agent instance for the tool +_nirium_agent: Optional[Agent] = None +_max_amount: str = "$1" + + +def initialize_nirium_x402( + secret_key: str, + network: str = "stellar:testnet", + max_amount_per_payment: str = "$1", + api_url: str = "https://nirium-agent.fly.dev", +) -> None: + """Initialize the Nirium x402 client with spending limits. + + Args: + secret_key: Stellar secret key (S...) for signing payments + network: Stellar network (testnet or pubnet) + max_amount_per_payment: Maximum USD amount per payment (e.g. "$1") + api_url: Nirium API URL + """ + global _nirium_agent, _max_amount + _nirium_agent = Agent(api_url=api_url) + _nirium_agent.init_x402( + secret_key, + network=network, + max_amount_per_payment=max_amount_per_payment, + ) + _max_amount = max_amount_per_payment + + +@function_tool +async def nirium_x402_fetch(url: str, method: str = "GET") -> str: + """Call an HTTP endpoint protected by Nirium x402 payment on Stellar testnet. + + This tool completes the HTTP 402 payment flow and returns the response body. + Payments above the configured cap are refused before signing. + + Args: + url: Absolute HTTP URL of the x402-protected resource + method: HTTP method (GET, POST, etc.) + + Returns: + The protected response body as a string + """ + if _nirium_agent is None: + return json.dumps({ + "error": "Nirium x402 client not initialized. Call initialize_nirium_x402 first." + }) + + try: + result = await _nirium_agent.x402_fetch(url, method=method) + + # Include settlement transaction hash in the result + settlement = getattr(_nirium_agent, "last_x402_settlement", None) + if settlement: + tx_hash = _extract_settlement_tx(settlement) + if tx_hash: + if isinstance(result, dict): + result["_x402_settlement_tx"] = tx_hash + return json.dumps(result, default=str) + else: + return f"{result}\n\nx402_settlement_tx: {tx_hash}" + + return json.dumps(result, default=str) if isinstance(result, dict) else str(result) + + except X402SpendCapError as e: + error_msg = ( + f"Payment refused: The requested payment exceeds the per-payment cap of {_max_amount}. " + f"The server requested {e.amount} stroops of {e.asset}. " + f"Nothing was signed or sent. To allow larger payments, raise the cap with " + f"initialize_nirium_x402(max_amount_per_payment='...')." + ) + return json.dumps({ + "error": "X402SpendCapError", + "message": error_msg, + "details": { + "url": e.url, + "amount": e.amount, + "asset": e.asset, + "network": e.network, + "cap": e.cap, + } + }) + + except X402NetworkMismatchError as e: + return json.dumps({ + "error": "X402NetworkMismatchError", + "message": f"Network mismatch: configured for {e.network} but server offered {', '.join(e.offered)}", + "url": e.url, + }) + + except Exception as e: + return json.dumps({ + "error": type(e).__name__, + "message": str(e), + }) + + +def _extract_settlement_tx(settlement: Optional[dict[str, Any]]) -> Optional[str]: + """Extract transaction hash from settlement payload.""" + if not settlement: + return None + for key in ("transaction", "txHash", "tx_hash", "hash", "transactionHash"): + value = settlement.get(key) + if isinstance(value, str) and value: + return value + if isinstance(value, dict): + nested = _extract_settlement_tx(value) + if nested: + return nested + for key in ("settleResponse", "settlement", "receipt", "payload"): + nested = settlement.get(key) + if isinstance(nested, dict): + found = _extract_settlement_tx(nested) + if found: + return found + return None diff --git a/examples/openai-agents-x402/requirements.txt b/examples/openai-agents-x402/requirements.txt new file mode 100644 index 0000000..7374fff --- /dev/null +++ b/examples/openai-agents-x402/requirements.txt @@ -0,0 +1,8 @@ +# Core dependencies (exact versions tested) +nirium==0.12.7 +openai-agents==0.25.0 +python-dotenv==1.0.0 + +# Testing +pytest==8.3.0 +pytest-asyncio==0.24.0 diff --git a/examples/openai-agents-x402/test_openai_tool.py b/examples/openai-agents-x402/test_openai_tool.py new file mode 100644 index 0000000..62a6040 --- /dev/null +++ b/examples/openai-agents-x402/test_openai_tool.py @@ -0,0 +1,253 @@ +"""Offline tests for the OpenAI Agents SDK x402 @function_tool. + +Tests run without network calls or real LLM invocations. +Tests exercise the actual @function_tool decorator from the Agents SDK. +""" + +from __future__ import annotations + +import asyncio +import base64 +import json +from typing import Any +from unittest.mock import AsyncMock, MagicMock, patch + +import pytest + +from nirium_tool import initialize_nirium_x402, _extract_settlement_tx + +# Import the actual function (not the wrapped version) for direct testing +import nirium_tool + + +# Test constants +TESTNET_USDC = "CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA" +TEST_URL = "https://test.example/paid" + +# Generate test secret at runtime (never funded, for testing only) +from stellar_sdk import Keypair +TEST_SECRET = Keypair.random().secret + + +class FakeResponse: + """Mock aiohttp response.""" + + def __init__(self, status: int, headers: dict[str, str], body: Any = None): + self.status = status + self.headers = headers + self._body = body or {} + + async def __aenter__(self): + return self + + async def __aexit__(self, *exc): + return False + + async def json(self): + return self._body + + async def text(self): + return json.dumps(self._body) + + +class FakeSession: + """Mock aiohttp ClientSession.""" + + def __init__(self, accepts: list[dict[str, Any]]): + challenge = base64.b64encode( + json.dumps({"x402Version": 2, "accepts": accepts}).encode() + ).decode() + self.responses = [ + FakeResponse(402, {"payment-required": challenge}), + FakeResponse(200, {"content-type": "application/json"}, {"ok": True, "paid": True}), + ] + self.requests = [] + + async def __aenter__(self): + return self + + async def __aexit__(self, *exc): + return False + + def request(self, method, url, **kwargs): + self.requests.append({"method": method, "url": url, **kwargs}) + return self.responses.pop(0) + + +def _make_option(amount: str, asset: str = TESTNET_USDC) -> dict[str, Any]: + """Create a payment option.""" + return { + "scheme": "exact", + "network": "stellar:testnet", + "asset": asset, + "payTo": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF", + "amount": amount, + "maxTimeoutSeconds": 60, + "extra": {"areFeesSponsored": True}, + } + + +@pytest.fixture +def mock_agent(): + """Set up mocked Nirium Agent for tests.""" + with patch("nirium_tool.Agent") as mock_agent_class: + mock_instance = MagicMock() + mock_instance.x402_fetch = AsyncMock() + mock_instance.last_x402_settlement = None + mock_agent_class.return_value = mock_instance + yield mock_instance + + +def test_initialize_sets_cap(): + """Test that initialize_nirium_x402 sets up the agent with the correct cap.""" + with patch("nirium_tool.Agent") as mock_agent_class: + mock_instance = MagicMock() + mock_agent_class.return_value = mock_instance + + initialize_nirium_x402( + secret_key=TEST_SECRET, + network="stellar:testnet", + max_amount_per_payment="$0.50", + ) + + mock_agent_class.assert_called_once() + mock_instance.init_x402.assert_called_once_with( + TEST_SECRET, + network="stellar:testnet", + max_amount_per_payment="$0.50", + ) + + +@pytest.mark.asyncio +async def test_successful_payment_below_cap(mock_agent): + """Test a successful payment below the spend cap.""" + mock_agent.x402_fetch.return_value = {"ok": True, "data": "success"} + mock_agent.last_x402_settlement = { + "transaction": "abc123", + "status": "settled", + } + + initialize_nirium_x402(TEST_SECRET, max_amount_per_payment="$1") + + # Call the underlying function directly (before decorator wrapping) + result = await nirium_tool.nirium_x402_fetch.__wrapped__(TEST_URL, "GET") + + parsed = json.loads(result) + assert parsed["ok"] is True + assert parsed["_x402_settlement_tx"] == "abc123" + mock_agent.x402_fetch.assert_called_once_with(TEST_URL, method="GET") + + +@pytest.mark.asyncio +async def test_payment_above_cap_refused(mock_agent): + """Test that a payment above the cap is refused with X402SpendCapError.""" + from nirium import X402SpendCapError + + error = X402SpendCapError( + url=TEST_URL, + requirement={ + "amount": "15000000", + "asset": TESTNET_USDC, + "network": "stellar:testnet", + "payTo": "GABC123", + }, + cap="$1", + reason="The requested payment of 1.5 USDC exceeds the cap of $1", + ) + mock_agent.x402_fetch.side_effect = error + + initialize_nirium_x402(TEST_SECRET, max_amount_per_payment="$1") + result = await nirium_tool.nirium_x402_fetch.__wrapped__(TEST_URL, "GET") + + parsed = json.loads(result) + assert parsed["error"] == "X402SpendCapError" + assert "exceeds the per-payment cap" in parsed["message"] + assert parsed["details"]["cap"] == "$1" + assert parsed["details"]["amount"] == "15000000" + + +@pytest.mark.asyncio +async def test_network_mismatch_error(mock_agent): + """Test network mismatch handling.""" + from nirium import X402NetworkMismatchError + + error = X402NetworkMismatchError( + url=TEST_URL, + network="stellar:testnet", + offered=["stellar:pubnet"], + ) + mock_agent.x402_fetch.side_effect = error + + initialize_nirium_x402(TEST_SECRET, network="stellar:testnet") + result = await nirium_tool.nirium_x402_fetch.__wrapped__(TEST_URL, "GET") + + parsed = json.loads(result) + assert parsed["error"] == "X402NetworkMismatchError" + assert "Network mismatch" in parsed["message"] + + +@pytest.mark.asyncio +async def test_uninitialized_agent(): + """Test that calling the tool without initialization returns an error.""" + original_agent = nirium_tool._nirium_agent + nirium_tool._nirium_agent = None + + try: + result = await nirium_tool.nirium_x402_fetch.__wrapped__(TEST_URL, "GET") + parsed = json.loads(result) + assert "error" in parsed + assert "not initialized" in parsed["error"] + finally: + nirium_tool._nirium_agent = original_agent + + +def test_extract_settlement_tx_from_various_formats(): + """Test transaction hash extraction from different settlement payloads.""" + + # Direct transaction field + assert _extract_settlement_tx({"transaction": "tx123"}) == "tx123" + + # txHash field + assert _extract_settlement_tx({"txHash": "tx456"}) == "tx456" + + # Nested in settlement + assert _extract_settlement_tx({ + "settlement": {"transaction": "tx789"} + }) == "tx789" + + # No transaction + assert _extract_settlement_tx({"status": "pending"}) is None + + # None input + assert _extract_settlement_tx(None) is None + + +@pytest.mark.asyncio +async def test_tool_returns_string_result(mock_agent): + """Test that non-dict results are stringified properly.""" + mock_agent.x402_fetch.return_value = "plain text response" + mock_agent.last_x402_settlement = {"transaction": "tx999"} + + initialize_nirium_x402(TEST_SECRET) + result = await nirium_tool.nirium_x402_fetch.__wrapped__(TEST_URL, "GET") + + assert "plain text response" in result + assert "x402_settlement_tx: tx999" in result + + +@pytest.mark.asyncio +async def test_function_tool_decorator(): + """Test that the @function_tool decorator is applied.""" + from agents.tool import FunctionTool + + # Verify the function has the decorator applied + assert hasattr(nirium_tool.nirium_x402_fetch, '__wrapped__') + # The decorated object should be a FunctionTool instance + assert isinstance(nirium_tool.nirium_x402_fetch, FunctionTool) + # Verify tool has expected properties + assert nirium_tool.nirium_x402_fetch.name == "nirium_x402_fetch" + assert "x402 payment" in nirium_tool.nirium_x402_fetch.description + + +if __name__ == "__main__": + pytest.main([__file__, "-v"]) From 2cacf100dfe85978eca81eb58a3ec6c5aeb889fb Mon Sep 17 00:00:00 2001 From: Giovanny Amador <219895655+Eras256@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:31:31 -0600 Subject: [PATCH 2/3] feat(examples): own x402Serve route for the OpenAI Agents example #365 asks the agent to pay a testnet x402Serve route you run. agent.py already expected a server on localhost:3402, but none was in the PR, so the earlier payments went to Nirium's testnet endpoint. server/ adds that route: /paid/market-summary at X402_PRICE (below the agent's $1 cap) and /paid/full-report at $2 (above it), paid to SELLER_PUBLIC_KEY. agent.py Test 2 now calls the $2 route and expects the refusal. README and .env.example explain the setup; the evidence table for a run against your own route is left PENDING for the author. Checked locally: both routes answer an x402 v2 402 on stellar:testnet (200000 and 20000000 units to payTo); nirium 0.12.7 with a $1 cap refuses /paid/full-report before signing; the 8 offline tests pass. Co-Authored-By: Claude Opus 5.5 --- examples/openai-agents-x402/.env.example | 6 +- examples/openai-agents-x402/.gitignore | 1 + examples/openai-agents-x402/README.md | 30 + examples/openai-agents-x402/agent.py | 17 +- .../server/package-lock.json | 2130 +++++++++++++++++ .../openai-agents-x402/server/package.json | 19 + examples/openai-agents-x402/server/server.mjs | 58 + 7 files changed, 2253 insertions(+), 8 deletions(-) create mode 100644 examples/openai-agents-x402/server/package-lock.json create mode 100644 examples/openai-agents-x402/server/package.json create mode 100644 examples/openai-agents-x402/server/server.mjs diff --git a/examples/openai-agents-x402/.env.example b/examples/openai-agents-x402/.env.example index 4d3633d..bf601b6 100644 --- a/examples/openai-agents-x402/.env.example +++ b/examples/openai-agents-x402/.env.example @@ -5,6 +5,10 @@ STELLAR_SECRET_KEY= # Optional: OpenAI API key for live agent runs OPENAI_API_KEY= -# x402 server settings (defaults work for local testing) +# x402 server settings (server/, your own x402Serve route) +# Testnet public key you own that RECEIVES the payments (not the payer's key) +SELLER_PUBLIC_KEY= +# Free testnet facilitator key: https://channels.openzeppelin.com/testnet/gen +FACILITATOR_API_KEY= X402_SERVER_PORT=3402 X402_PRICE=0.02 diff --git a/examples/openai-agents-x402/.gitignore b/examples/openai-agents-x402/.gitignore index 6e2c440..fb7bd40 100644 --- a/examples/openai-agents-x402/.gitignore +++ b/examples/openai-agents-x402/.gitignore @@ -2,4 +2,5 @@ __pycache__/ *.pyc .pytest_cache/ +node_modules/ *.log diff --git a/examples/openai-agents-x402/README.md b/examples/openai-agents-x402/README.md index 47def33..4455d2b 100644 --- a/examples/openai-agents-x402/README.md +++ b/examples/openai-agents-x402/README.md @@ -29,6 +29,7 @@ pytest-asyncio==0.24.0 - **`requirements.txt`** — Exact dependency versions - **`.env.example`** — Environment template - **`.gitignore`** — Prevents committing secrets +- **`server/`** — Your own `x402Serve` route on testnet (Node): `/paid/market-summary` at `X402_PRICE` (below the cap) and `/paid/full-report` at `$2` (above the cap) ## Setup @@ -52,6 +53,25 @@ Fund it using Friendbot (automatic in Stellar Laboratory). **⚠️ NEVER commit your `.env` file or share secret keys!** +### 3. Run your own x402Serve route + +The agent pays a route you run, with payments going to a testnet account you own. In `.env`, set: + +- `SELLER_PUBLIC_KEY`: a second testnet account you own (G...), not the payer. It receives the payments, so it needs a USDC trustline. +- `FACILITATOR_API_KEY`: a free testnet key from https://channels.openzeppelin.com/testnet/gen + +```bash +cd server +npm install +npm start # x402Serve on http://localhost:3402 (stellar:testnet) +``` + +Then, in another terminal, run the agent against it: + +```bash +python agent.py # Test 1 pays /paid/market-summary, Test 2 is refused on /paid/full-report ($2 > $1 cap) +``` + ## Tests Run offline tests (no network, no real LLM calls): @@ -90,6 +110,16 @@ test_openai_tool.py::test_function_tool_decorator PASSED [100%] ### Testnet Evidence +**Run against your own `x402Serve` route (`server/`):** PENDING. Fill in from a run with your own keys: + +| Step | Value | +|---|---| +| Seller account (`SELLER_PUBLIC_KEY`, receives the payment) | PENDING | +| Paid call `/paid/market-summary` through `@function_tool` | PENDING: tx hash on Stellar Expert (testnet) | +| Refused call `/paid/full-report` ($2 > $1 cap) | Refused before signing with `X402SpendCapError`, no transaction (paste the agent's message) | + +**Earlier run against Nirium's testnet endpoint** (before `server/` existed; the payee `GC4Q5TWW…` is Nirium's, not yours): + **Test account:** [GCE3GDLLGGKOVDDAZ4OHD6JC5FCD6CZZCADC4CFKQ66NKCB5U6XFOI6Z](https://stellar.expert/explorer/testnet/account/GCE3GDLLGGKOVDDAZ4OHD6JC5FCD6CZZCADC4CFKQ66NKCB5U6XFOI6Z) **Transactions (all on Stellar testnet):** diff --git a/examples/openai-agents-x402/agent.py b/examples/openai-agents-x402/agent.py index 1a102f9..809fb26 100644 --- a/examples/openai-agents-x402/agent.py +++ b/examples/openai-agents-x402/agent.py @@ -66,14 +66,17 @@ async def test_agent(server_url: str) -> None: except Exception as e: print(f"Result: {e}") - # Test 2: Expensive endpoint (above cap) - for this we'll create a modified URL - # Since the express server has only one endpoint, we'll test the cap by - # modifying our cap or testing the actual behavior - print("\n📝 Test 2: Testing spend cap enforcement") + # Test 2: Expensive endpoint (above cap). server/ charges $2 here, so the + # tool must refuse before signing and the agent explains why. + print("\n📝 Test 2: Calling expensive endpoint (above $1 cap, must be refused)") print("-" * 60) - print("Note: The express-x402 server charges 0.02 USDC (below $1 cap).") - print("To test the cap, we'd need a server with a >$1 endpoint.") - print("The spend cap logic is tested in test_openai_tool.py offline tests.") + expensive_url = f"{server_url}/paid/full-report" + + try: + result2 = await agent.run(f"Please fetch data from {expensive_url}") + print(f"✅ Agent response: {result2}") + except Exception as e: + print(f"Result: {e}") print("\n" + "="*60) print("✅ Agent tests complete!") diff --git a/examples/openai-agents-x402/server/package-lock.json b/examples/openai-agents-x402/server/package-lock.json new file mode 100644 index 0000000..6b77e1f --- /dev/null +++ b/examples/openai-agents-x402/server/package-lock.json @@ -0,0 +1,2130 @@ +{ + "name": "nirium-openai-agents-x402-server", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "nirium-openai-agents-x402-server", + "version": "0.1.0", + "dependencies": { + "@x402/core": "2.32.0", + "@x402/express": "2.32.0", + "@x402/extensions": "2.32.0", + "@x402/stellar": "2.32.0", + "dotenv": "^17.4.2", + "express": "5.3.0", + "nirium": "0.19.6" + } + }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz", + "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==", + "license": "MIT" + }, + "node_modules/@cfworker/json-schema": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@cfworker/json-schema/-/json-schema-4.1.6.tgz", + "integrity": "sha512-YzVGTHXf4bzlyAL5KAvHYCdNbbt6zM5cYkAgxqxQPDQM6aZ4ShIIN5yJ+6q7YeonnevxT8k/LmD2tJi/jOiKkg==", + "license": "MIT" + }, + "node_modules/@exodus/bytes": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@exodus/bytes/-/bytes-1.16.0.tgz", + "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==", + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@noble/hashes": "^1.8.0 || ^2.0.0" + }, + "peerDependenciesMeta": { + "@noble/hashes": { + "optional": true + } + } + }, + "node_modules/@modelcontextprotocol/server": { + "version": "2.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.0.0-alpha.4.tgz", + "integrity": "sha512-/KEo3ZJ50HlagHp0lz2vPgfBZFtXHu6zTBXT9XqPc+4O9i4+IbBVWKq/a9yAfv/ifp0u3+mRo8SUk5kMKzhN8A==", + "license": "MIT", + "dependencies": { + "zod": "^4.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@noble/ciphers": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", + "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves": { + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz", + "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/ed25519": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-3.2.0.tgz", + "integrity": "sha512-criDgRlnUA09hchYrTy/JUWPIEap5rZxQe6wDWzRx51oWWpDRcUpuNzlgPxDJaOK6AsW9c0wKcj3rKRv6t+bPQ==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scalar/openapi-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.8.0.tgz", + "integrity": "sha512-WmaxVSfvY5K/TwcG2B2TU1WOe1As1uc2s7myswtP6dBlcjU3hM08SApxv/jmyGaCE8t4gO5BBhmHY4pDUfmr2g==", + "license": "MIT", + "engines": { + "node": ">=22" + } + }, + "node_modules/@scure/base": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz", + "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz", + "integrity": "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==", + "license": "MIT", + "dependencies": { + "@noble/curves": "~1.9.0", + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz", + "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@signinwithethereum/siwe": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@signinwithethereum/siwe/-/siwe-4.2.1.tgz", + "integrity": "sha512-CQEQhCIgN9blil1YpaGR+wvGPdsBVK6zed5DBu03s1IdbSO3kA/n7Zp+SAkZGiHy3HY6OJm1Su0/Bd33vKK6nQ==", + "license": "Apache-2.0", + "dependencies": { + "@signinwithethereum/siwe-parser": "^4.2.1" + }, + "peerDependencies": { + "ethers": "^5.7.0 || ^6.13.0", + "viem": "^2.7.0" + }, + "peerDependenciesMeta": { + "ethers": { + "optional": true + }, + "viem": { + "optional": true + } + } + }, + "node_modules/@signinwithethereum/siwe-parser": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@signinwithethereum/siwe-parser/-/siwe-parser-4.2.1.tgz", + "integrity": "sha512-GAdwNiBaRpUMTiFfPrbQ3e/RBhPbEhRRN1sZmDMLgLEZuKqKwO7V0ksVzCerE9l8HFKTNw5R/q3kPDCWJRz4zA==", + "license": "Apache-2.0", + "dependencies": { + "@noble/hashes": "^1.7.0", + "apg-js": "^4.4.0" + } + }, + "node_modules/@stellar/js-xdr": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@stellar/js-xdr/-/js-xdr-5.0.0.tgz", + "integrity": "sha512-HBDNKnxr+ecdaEmbZ0mcKkirOF8tXXEbWSw34P3wT40Tn3g+u+cCH17xAWZymzscq8cojHB8340pR8QNVaD32w==", + "license": "Apache-2.0", + "engines": { + "node": ">=22.0.0", + "pnpm": ">=10.0.0" + } + }, + "node_modules/@stellar/stellar-sdk": { + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-17.4.0.tgz", + "integrity": "sha512-IX6gi62yWQ+6Oz56LsVEEeSViSOWJL3BkttftwVmVsu+62nLTWNVsCmTWEzwgNLT/q5HGP25OnlU+hhy2E4wwA==", + "license": "Apache-2.0", + "dependencies": { + "@exodus/bytes": "^1.15.1", + "@noble/ed25519": "^3.1.0", + "@noble/hashes": "^2.2.0", + "@stellar/js-xdr": "^5.0.0", + "@types/json-schema": "^7.0.15", + "axios": "1.20.0", + "bignumber.js": "^11.1.4", + "commander": "^14.0.3", + "eventsource": "^4.1.0", + "feaxios": "^0.0.23", + "smol-toml": "^1.6.1", + "uint8array-extras": "^1.5.0" + }, + "bin": { + "stellar-contract-bindings-typescript": "bin/stellar-contract-bindings-typescript", + "stellar-js": "bin/stellar-js", + "stellar-sdk": "bin/stellar-js" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@stellar/stellar-sdk/node_modules/@noble/hashes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.4.0.tgz", + "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@toon-format/toon": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@toon-format/toon/-/toon-2.3.1.tgz", + "integrity": "sha512-sWqEMeAJGMda9qRrfPKrX3C4c33CO9SJuvJzzrcBEn5sbDB+k6pSLkDsfN0rVnLQwR97MV3sDgVbcxQNsq8xVw==", + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "license": "MIT" + }, + "node_modules/@x402/core": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@x402/core/-/core-2.32.0.tgz", + "integrity": "sha512-HyS8vbaR3XP79EIATKGMt8eL0Ql46yrfVDrtv1Inmlx4qJl4NU61cJmTh/pSGOCJIeb7ETNhWR/GQ4XsWZcQIA==", + "license": "Apache-2.0", + "dependencies": { + "zod": "^4.6.6" + } + }, + "node_modules/@x402/express": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@x402/express/-/express-2.32.0.tgz", + "integrity": "sha512-aPZDcDsSIAy6dz5YmcuosoBRy4t2VUCwzeZG/S5bxE7xZfxouyRbm3M+mlUNHymAjy4Z/lNqK6jummRe770AGw==", + "license": "Apache-2.0", + "dependencies": { + "@x402/core": "~2.32.0", + "@x402/extensions": "~2.32.0" + }, + "peerDependencies": { + "@x402/paywall": "^2.32.0", + "express": "^4.22.3 || ^5.3.0" + }, + "peerDependenciesMeta": { + "@x402/paywall": { + "optional": true + } + } + }, + "node_modules/@x402/extensions": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@x402/extensions/-/extensions-2.32.0.tgz", + "integrity": "sha512-bvhqNqCjmULkjCpjM1fJvDfoL8tzp1IFcMTXN7QJTwqM22ucNe8B4UefKeQOCpjJ3tuIEbp8k9A0fR0CiYtjrQ==", + "license": "Apache-2.0", + "dependencies": { + "@noble/curves": "^1.9.0", + "@scure/base": "^1.2.6", + "@signinwithethereum/siwe": "^4.1.0", + "@x402/core": "~2.32.0", + "ajv": "^8.18.0", + "jose": "^5.9.6", + "tweetnacl": "^1.0.3", + "viem": "^2.48.11", + "zod": "^4.6.6" + } + }, + "node_modules/@x402/fetch": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@x402/fetch/-/fetch-2.32.0.tgz", + "integrity": "sha512-MxDqmBxQz6I5NWUVu90cQ1XRZayAi8oDpGllDwrwihxfAHloE7eqXkNuFC80IRE3BbMwj8h65aBEaOaiq3EBUQ==", + "license": "Apache-2.0", + "dependencies": { + "@x402/core": "~2.32.0" + } + }, + "node_modules/@x402/stellar": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@x402/stellar/-/stellar-2.32.0.tgz", + "integrity": "sha512-ArexKFv6/Os4toaFP4u5RMN+A6v3WtNjCG5/CenuDQRf8+0Ts99GcNz97lKUgo9CXzJfSqE/QhwUlaZ0oiZc7g==", + "license": "Apache-2.0", + "dependencies": { + "@stellar/stellar-sdk": "^17.4.0", + "@x402/core": "~2.32.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/abitype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.3.0.tgz", + "integrity": "sha512-fk6Te+bojIFrMvMZrnOO+SxCB+RUksTGOzq/60ZRvs1L+BVzvi2bqt9L3W/17ZLdZsyM1FuYf65P5nlmoiH1Bg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/wevm" + }, + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3.22.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/apg-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/apg-js/-/apg-js-4.4.0.tgz", + "integrity": "sha512-fefmXFknJmtgtNEXfPwZKYkMFX4Fyeyz+fNF6JWp87biGOPslJbCBVU158zvKRZfHBKnJDy8CMM40oLFGkXT8Q==", + "license": "BSD-2-Clause" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz", + "integrity": "sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.6", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/base32.js": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/base32.js/-/base32.js-0.1.0.tgz", + "integrity": "sha512-n3TkB02ixgBOhTvANakDb4xaMXnYUVkNoRFJjQflcqMQhyEKxEHdj3E6N8t8sUQ0mjH/3/JxzlXuz3ul/J90pQ==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bignumber.js": { + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-11.1.5.tgz", + "integrity": "sha512-6WmzCNtUnfKpbozq+hOgWaZMMzORmYBwF1xZScyoIX3QRYWeKTtxxwDOW5tIz7C9BdjkIYHGTcelCLkXg0mndw==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz", + "integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^2.1.0", + "debug": "^4.4.3", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.3", + "on-finished": "^2.4.1", + "qs": "^6.16.1", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/content-disposition": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-2.0.1.tgz", + "integrity": "sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dotenv": { + "version": "17.4.2", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz", + "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.3.tgz", + "integrity": "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/eventsource": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-4.1.1.tgz", + "integrity": "sha512-D6bTRWh6KahHTK/m4WnjPQyEinNPf9eFLEZSEoj7d6fTibspnAVYfzHvirL7u/aoX5d9YYfIkBVAhmigUELk9w==", + "license": "MIT", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.1.tgz", + "integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/express": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.3.0.tgz", + "integrity": "sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.3.0", + "content-disposition": "^2.0.1", + "content-type": "^2.0.0", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.8", + "qs": "^6.16.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.1.0", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/feaxios": { + "version": "0.0.23", + "resolved": "https://registry.npmjs.org/feaxios/-/feaxios-0.0.23.tgz", + "integrity": "sha512-eghR0A21fvbkcQBgZuMfQhrXxJzC0GNUGC9fXhBge33D+mFDTwl0aJ35zoQQn575BhyjQitRc5N4f+L4cP708g==", + "license": "MIT", + "dependencies": { + "is-retry-allowed": "^3.0.0" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/follow-redirects": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.3.tgz", + "integrity": "sha512-toOSoqN6d51Wjf1aOFJYcoVv1aND9rj/CwjLU0Vz40oDuSpWDayCeKe4JpL5NL0WdFvoOOCI3BRo69HahjbR1A==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/incur": { + "version": "0.4.26", + "resolved": "https://registry.npmjs.org/incur/-/incur-0.4.26.tgz", + "integrity": "sha512-63lwOc8+o1VeFkIW3sWWMrDSP5Dd1NsvucUWyxLUk+DoNRiNl7cj481nlLdlboXkq+tqYPBSlV/7XbylS2S4BA==", + "license": "MIT", + "dependencies": { + "@cfworker/json-schema": "^4.1.1", + "@modelcontextprotocol/server": "2.0.0-alpha.4", + "@scalar/openapi-types": "^0.8.0", + "@toon-format/toon": "^2.1.0", + "tokenx": "^1.3.0", + "yaml": "^2.8.2", + "zod": "^4.3.6" + }, + "bin": { + "incur": "dist/bin.js", + "incur.src": "src/bin.ts" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/is-retry-allowed": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-3.0.0.tgz", + "integrity": "sha512-9xH0xvoggby+u0uGF7cZXdrutWiBiaFG8ZT4YFPXL8NzkyAwX3AKGLeFQLvzDpM430+nDFBZ1LHkie/8ocL06A==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isows": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz", + "integrity": "sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/jose": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.10.0.tgz", + "integrity": "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz", + "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/mppx": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/mppx/-/mppx-0.21.1.tgz", + "integrity": "sha512-71+y/cOamBOH1+UehF9EgttkGkwCFmlbDGIs2fB/+0WvZqWCqw5zPqY0rKjxhru+jb1nZo9tK4/S3D1aSLCn7w==", + "extraneous": true, + "license": "MIT", + "dependencies": { + "ox": "0.14.65", + "structured-headers": "2.1.0", + "zod": "^4.6.7" + }, + "bin": { + "mppx": "dist/bin.js" + }, + "peerDependencies": { + "@modelcontextprotocol/sdk": ">=1.25.0", + "@stripe/agent-identity": ">=0.3.0", + "@x402/core": ">=2.22.0", + "@x402/evm": ">=2.22.0", + "@x402/express": ">=2.22.0", + "@x402/hono": ">=2.22.0", + "@x402/mcp": ">=2.22.0", + "@x402/next": ">=2.22.0", + "elysia": ">=1.2.0", + "express": ">=5", + "hono": ">=4.12.25", + "next": ">=16.2.6", + "viem": ">=2.57.19" + }, + "peerDependenciesMeta": { + "@modelcontextprotocol/sdk": { + "optional": true + }, + "@stripe/agent-identity": { + "optional": true + }, + "@x402/core": { + "optional": true + }, + "@x402/evm": { + "optional": true + }, + "@x402/express": { + "optional": true + }, + "@x402/hono": { + "optional": true + }, + "@x402/mcp": { + "optional": true + }, + "@x402/next": { + "optional": true + }, + "elysia": { + "optional": true + }, + "express": { + "optional": true + }, + "hono": { + "optional": true + }, + "next": { + "optional": true + } + } + }, + "node_modules/mppx/node_modules/@noble/curves": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz", + "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==", + "extraneous": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/mppx/node_modules/ox": { + "version": "0.14.65", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.14.65.tgz", + "integrity": "sha512-K7oj+jvEP4Gf78ZOYuWAWzKEX/g5z7p6ukj84gdbFnezmFSt6SpprEp9tH5tymXsywSqRdeqk+8JL4+9o0Schw==", + "extraneous": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "^1.11.0", + "@noble/ciphers": "^1.3.0", + "@noble/curves": "1.9.1", + "@noble/hashes": "^1.8.0", + "@scure/bip32": "^1.7.0", + "@scure/bip39": "^1.6.0", + "abitype": "^1.2.3", + "eventemitter3": "5.0.1" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", + "license": "MIT", + "dependencies": { + "content-type": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/nirium": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/nirium/-/nirium-0.19.6.tgz", + "integrity": "sha512-W2kdqCLNWxfiMQKUC2pPrONFh1y0BMGU1XcGLjgpGFzaZbnITfwwIP5/UzpnFLRrCKbkKs26uXMRPxCR/ghMBQ==", + "license": "Apache-2.0", + "dependencies": { + "@stellar/mpp": "^0.7.1", + "@stellar/stellar-sdk": "^16.3.0", + "@x402/fetch": "^2.28.0", + "@x402/stellar": "^2.28.0", + "mppx": "^0.6.31", + "viem": "^2.55.19", + "ws": "^8.21.3" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/nirium/node_modules/@noble/curves": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz", + "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nirium/node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nirium/node_modules/@noble/hashes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.4.0.tgz", + "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nirium/node_modules/@stellar/js-xdr": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@stellar/js-xdr/-/js-xdr-4.0.0.tgz", + "integrity": "sha512-+NmNa7Tk5BI5XFdy/6xGTqAN4J9a9KgCrCGhj2uEUTCBhLkch0M+QbKzNH8zEnejWe0p8w+0q5hUVX6L3OzoVA==", + "license": "Apache-2.0", + "engines": { + "node": ">=20.0.0", + "pnpm": ">=9.0.0" + } + }, + "node_modules/nirium/node_modules/@stellar/mpp": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@stellar/mpp/-/mpp-0.7.1.tgz", + "integrity": "sha512-L0bwohQU4jKgm3yBFxvrhcYuroRITnUMGmr4N+aJY6q2GYY1bnhenFeTU5Bi0sxXP/5PIRA4ulRHPtqeZ8oTpA==", + "license": "MIT", + "dependencies": { + "zod": "^4.4.3" + }, + "engines": { + "node": ">=22" + }, + "peerDependencies": { + "@stellar/stellar-sdk": "^15.1.0", + "mppx": "^0.6.29" + } + }, + "node_modules/nirium/node_modules/@stellar/stellar-sdk": { + "version": "16.4.1", + "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-16.4.1.tgz", + "integrity": "sha512-0kT+ShOUE6dc0smLEsajuizss1hvlGDsCooM88FqgxNOCKpY8IuQPzCs75RNKMSMITz+dX7KZ5qGhQ2EWGMTTg==", + "license": "Apache-2.0", + "dependencies": { + "@noble/ed25519": "^3.1.0", + "@noble/hashes": "^2.2.0", + "@stellar/js-xdr": "4.0.0", + "axios": "1.20.0", + "base32.js": "^0.1.0", + "bignumber.js": "^11.1.4", + "buffer": "^6.0.3", + "commander": "^14.0.3", + "eventsource": "^4.1.0", + "feaxios": "^0.0.23", + "smol-toml": "^1.6.1", + "uint8array-extras": "^1.5.0" + }, + "bin": { + "stellar-js": "bin/stellar-js" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/nirium/node_modules/mppx": { + "version": "0.6.31", + "resolved": "https://registry.npmjs.org/mppx/-/mppx-0.6.31.tgz", + "integrity": "sha512-euHHDLjNa9DQdPSzpayRBhUb3YVGSNZhVAzoOPmjzqxcEb77ry59uaeSBsWr3IjSxqmpR45cB6aR0uiNSgO6kA==", + "license": "MIT", + "dependencies": { + "incur": "^0.4.8", + "ox": "0.14.27", + "zod": "^4.4.3" + }, + "bin": { + "mppx": "dist/bin.js", + "mppx.src": "src/bin.ts" + }, + "peerDependencies": { + "@modelcontextprotocol/sdk": ">=1.25.0", + "elysia": ">=1", + "express": ">=5", + "hono": ">=4.12.18", + "viem": ">=2.51.0" + }, + "peerDependenciesMeta": { + "@modelcontextprotocol/sdk": { + "optional": true + }, + "elysia": { + "optional": true + }, + "express": { + "optional": true + }, + "hono": { + "optional": true + } + } + }, + "node_modules/nirium/node_modules/ox": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.14.27.tgz", + "integrity": "sha512-+xhLHo/f+f4BH121/1Pomm/1vgBBda1wYiFpTvjSo8o5OcEj76Pf1hGPJiepoYMTQoTm2SKdSBvWkFWk5l07PA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "^1.11.0", + "@noble/ciphers": "^1.3.0", + "@noble/curves": "1.9.1", + "@noble/hashes": "^1.8.0", + "@scure/bip32": "^1.7.0", + "@scure/bip39": "^1.6.0", + "abitype": "^1.2.3", + "eventemitter3": "5.0.1" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/nirium/node_modules/ox/node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/object-inspect": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.14.0.tgz", + "integrity": "sha512-IVgHNlp/jwQX271+Xzoq9LZNTWXxZK+cEOrGBOBxXNbn7fapnZ+Ts6TVMgNOuAezwG2wdtnMX97tTPK6VEnuOQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.2.tgz", + "integrity": "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/ox": { + "version": "0.14.67", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.14.67.tgz", + "integrity": "sha512-6v6UlwgsmiyTujZp0aVDuN8uIBAtl/QZadBADFRZ2zp1+CM9TqDzd+rPKJ5PYvWPlCvz8JvoO9dTr42+1PhBhA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "^1.11.0", + "@noble/ciphers": "^1.3.0", + "@noble/curves": "1.9.1", + "@noble/hashes": "^1.8.0", + "@scure/bip32": "^1.7.0", + "@scure/bip39": "^1.6.0", + "abitype": "^1.2.3", + "eventemitter3": "5.0.1" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/ox/node_modules/@noble/curves": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz", + "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/qs": { + "version": "6.17.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.17.1.tgz", + "integrity": "sha512-jd3COkaKVgGUW+ZHyEHCG9bH7RoaaiWuMgzsIBjUMVjLAaWGWpoUAVwljVvBHxRu/2qEHnadLGZrkutYUBPQJA==", + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/router": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.3.0.tgz", + "integrity": "sha512-bpowRfGjEPe8t9R6fJIzhwmyCGAXwKvxBUsgJm+bJukwdcWmUXbMo7p22w7aYmQBPQTUMNqMV39YX0kMou3z8w==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/smol-toml": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.1.tgz", + "integrity": "sha512-j7WyPdf0CJoutMzMoPLF/bVXHtKZIT9Rb4eGeEbWw8X2t5oirjPgpL+OpaENZrILYaXqYwnVH+qgUwVbl+pUJQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/structured-headers": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/structured-headers/-/structured-headers-2.1.0.tgz", + "integrity": "sha512-ClzykN+XQVaSW5UfpOdEWfDplZ1Th7mISdaFvaC2+GjLTeBhGMJw83D/Rw9jPkHOml4oYd3EXaZhbz3gnE5nBQ==", + "extraneous": true, + "license": "MIT", + "engines": { + "node": ">=18", + "npm": ">=6" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tokenx": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tokenx/-/tokenx-1.6.0.tgz", + "integrity": "sha512-CKTjk345ajvBAUp5xUI9a5KKN0zU0lBueVHQbCskH1Hp6WkUKsPW2qGCYNs0pxNyfzxfo+IIjdt2W4sMbw/qBw==", + "license": "MIT" + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "license": "Unlicense" + }, + "node_modules/type-is": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", + "license": "MIT", + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/uint8array-extras": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.6.0.tgz", + "integrity": "sha512-8iAasVS4wUx0gPLjH8Xtz2PeDzTSiy8QiLGu2DT3X5GU+egFEQhpnbtkehbAwjvDcxIERmCYcysiODFmE3Ud0Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/viem": { + "version": "2.58.2", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.58.2.tgz", + "integrity": "sha512-tOdKI6+6oQWbb0NirduHfILojP9uY8YamtYIwallzObzMhhSCxWb2zOVw7SwrkYWTt7JmB1/Of4L3hTokp9GJA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@noble/curves": "1.9.1", + "@noble/hashes": "1.8.0", + "@scure/bip32": "1.7.0", + "@scure/bip39": "1.6.0", + "abitype": "1.2.3", + "isows": "1.0.7", + "ox": "0.14.67", + "ws": "8.21.0" + }, + "peerDependencies": { + "mppx": ">=0.17.0", + "typescript": ">=5.0.4" + }, + "peerDependenciesMeta": { + "mppx": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/viem/node_modules/@noble/curves": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz", + "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/viem/node_modules/abitype": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.2.3.tgz", + "integrity": "sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/wevm" + }, + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3.22.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "node_modules/viem/node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.23.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.23.0.tgz", + "integrity": "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/examples/openai-agents-x402/server/package.json b/examples/openai-agents-x402/server/package.json new file mode 100644 index 0000000..ffa9ab0 --- /dev/null +++ b/examples/openai-agents-x402/server/package.json @@ -0,0 +1,19 @@ +{ + "name": "nirium-openai-agents-x402-server", + "version": "0.1.0", + "private": true, + "type": "module", + "description": "Testnet x402Serve route for the OpenAI Agents SDK example: one route below the agent's cap, one above.", + "scripts": { + "start": "node server.mjs" + }, + "dependencies": { + "@x402/core": "2.32.0", + "@x402/express": "2.32.0", + "@x402/extensions": "2.32.0", + "@x402/stellar": "2.32.0", + "dotenv": "^17.4.2", + "express": "5.3.0", + "nirium": "0.19.6" + } +} diff --git a/examples/openai-agents-x402/server/server.mjs b/examples/openai-agents-x402/server/server.mjs new file mode 100644 index 0000000..4a91d20 --- /dev/null +++ b/examples/openai-agents-x402/server/server.mjs @@ -0,0 +1,58 @@ +// A small x402Serve route on stellar:testnet for the OpenAI Agents example. +// +// Two paid routes, so the agent can show both outcomes against a seller you run: +// GET /paid/market-summary costs X402_PRICE (default $0.02), below the agent's $1 cap: paid +// GET /paid/full-report costs $2, above the cap: refused by the agent before signing +// +// Payments go to SELLER_PUBLIC_KEY, a testnet account you own (not the payer's key). +import dotenv from "dotenv"; +import express from "express"; +import { x402Serve } from "nirium"; + +// Same .env as the Python agent, one folder up. +dotenv.config({ path: new URL("../.env", import.meta.url), quiet: true }); + +const payTo = process.env.SELLER_PUBLIC_KEY ?? ""; +const facilitatorApiKey = process.env.FACILITATOR_API_KEY ?? ""; +const port = Number(process.env.X402_SERVER_PORT ?? 3402); +const rawPrice = process.env.X402_PRICE ?? "0.02"; +const cheapPrice = rawPrice.startsWith("$") ? rawPrice : `$${rawPrice}`; + +if (!/^G[A-Z2-7]{55}$/.test(payTo)) { + console.error("SELLER_PUBLIC_KEY must be a testnet public key (G...) that you own. It receives the payments."); + process.exit(1); +} +if (!facilitatorApiKey) { + console.error("FACILITATOR_API_KEY is missing. A free testnet key: https://channels.openzeppelin.com/testnet/gen"); + process.exit(1); +} + +const app = express(); + +app.use( + x402Serve({ + payTo, + network: "stellar:testnet", + facilitatorApiKey, + appName: "Nirium OpenAI Agents x402 example", + routes: { + "GET /paid/market-summary": { price: cheapPrice, description: "Market summary (below the agent's $1 cap)" }, + "GET /paid/full-report": { price: "$2", description: "Full report (above the agent's $1 cap)" }, + }, + }), +); + +// Reached only after x402Serve verified and settled the payment. +app.get("/paid/market-summary", (_req, res) => { + res.json({ ok: true, route: "market-summary", price: cheapPrice, note: "Demo data from your own x402Serve route." }); +}); + +app.get("/paid/full-report", (_req, res) => { + res.json({ ok: true, route: "full-report", price: "$2" }); +}); + +app.listen(port, () => { + console.log(`x402Serve on http://localhost:${port} (stellar:testnet), payTo ${payTo}`); + console.log(` GET /paid/market-summary ${cheapPrice}`); + console.log(" GET /paid/full-report $2"); +}); From ae185cf3c9346b2e67049b3dfef05940c58abd78 Mon Sep 17 00:00:00 2001 From: Edgadafi <203378643+Edgadafi@users.noreply.github.com> Date: Sat, 21 Nov 2026 07:22:44 -0600 Subject: [PATCH 3/3] examples(openai-agents-x402): fill own-route testnet evidence, use Runner.run --- examples/openai-agents-x402/README.md | 8 ++++---- examples/openai-agents-x402/agent.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/openai-agents-x402/README.md b/examples/openai-agents-x402/README.md index 4455d2b..231ca18 100644 --- a/examples/openai-agents-x402/README.md +++ b/examples/openai-agents-x402/README.md @@ -110,13 +110,13 @@ test_openai_tool.py::test_function_tool_decorator PASSED [100%] ### Testnet Evidence -**Run against your own `x402Serve` route (`server/`):** PENDING. Fill in from a run with your own keys: +**Run against my own `x402Serve` route (`server/`, stellar:testnet, Nov 21 2026):** | Step | Value | |---|---| -| Seller account (`SELLER_PUBLIC_KEY`, receives the payment) | PENDING | -| Paid call `/paid/market-summary` through `@function_tool` | PENDING: tx hash on Stellar Expert (testnet) | -| Refused call `/paid/full-report` ($2 > $1 cap) | Refused before signing with `X402SpendCapError`, no transaction (paste the agent's message) | +| Seller account (`SELLER_PUBLIC_KEY`, receives the payment) | [GDYJA25NGJWWMGTAC73LG4J2X6FCVSTC7CTVJZKT3EZSBUYM5WOKIV5Z](https://stellar.expert/explorer/testnet/account/GDYJA25NGJWWMGTAC73LG4J2X6FCVSTC7CTVJZKT3EZSBUYM5WOKIV5Z) | +| Paid call `/paid/market-summary` through `@function_tool` | [2d9235ab60a8908735cdc9cb4ab49f82dc48a9ae2b59c245cf94ffcafec9b0a6](https://stellar.expert/explorer/testnet/tx/2d9235ab60a8908735cdc9cb4ab49f82dc48a9ae2b59c245cf94ffcafec9b0a6): 0.02 USDC from payer GBTBTAO3…RIY5 to the seller above | +| Refused call `/paid/full-report` ($2 > $1 cap) | Refused before signing with `X402SpendCapError`, no transaction. Agent: "The payment request for the data from the URL exceeded the per-payment cap of \$1. The server requested a payment of 20,000,000 stroops (approximately \$2). As a result, the payment was refused." | **Earlier run against Nirium's testnet endpoint** (before `server/` existed; the payee `GC4Q5TWW…` is Nirium's, not yours): diff --git a/examples/openai-agents-x402/agent.py b/examples/openai-agents-x402/agent.py index 809fb26..7d34ef6 100644 --- a/examples/openai-agents-x402/agent.py +++ b/examples/openai-agents-x402/agent.py @@ -15,7 +15,7 @@ import sys from typing import Any -from agents import Agent as OpenAIAgent +from agents import Agent as OpenAIAgent, Runner from dotenv import load_dotenv from nirium_tool import initialize_nirium_x402, nirium_x402_fetch @@ -61,8 +61,8 @@ async def test_agent(server_url: str) -> None: cheap_url = f"{server_url}/paid/market-summary" try: - result1 = await agent.run(f"Please fetch data from {cheap_url}") - print(f"✅ Agent response: {result1}") + result1 = await Runner.run(agent, f"Please fetch data from {cheap_url}") + print(f"✅ Agent response: {result1.final_output}") except Exception as e: print(f"Result: {e}") @@ -73,8 +73,8 @@ async def test_agent(server_url: str) -> None: expensive_url = f"{server_url}/paid/full-report" try: - result2 = await agent.run(f"Please fetch data from {expensive_url}") - print(f"✅ Agent response: {result2}") + result2 = await Runner.run(agent, f"Please fetch data from {expensive_url}") + print(f"✅ Agent response: {result2.final_output}") except Exception as e: print(f"Result: {e}")