traia-iatp 0.1.43__tar.gz → 0.1.44__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. traia_iatp-0.1.44/MANIFEST.in +34 -0
  2. traia_iatp-0.1.44/PKG-INFO +318 -0
  3. traia_iatp-0.1.44/README.md +269 -0
  4. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/pyproject.toml +3 -2
  5. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/cli/main.py +84 -0
  6. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/client/crewai_a2a_tools.py +7 -7
  7. traia_iatp-0.1.44/src/traia_iatp/contracts/wallet_creator.py +369 -0
  8. traia_iatp-0.1.44/src/traia_iatp/d402/MIDDLEWARE_ARCHITECTURE.md +205 -0
  9. traia_iatp-0.1.44/src/traia_iatp/d402/PRICE_BUILDER_USAGE.md +249 -0
  10. traia_iatp-0.1.44/src/traia_iatp/d402/README.md +489 -0
  11. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/clients/httpx.py +1 -1
  12. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/servers/starlette.py +120 -120
  13. traia_iatp-0.1.44/src/traia_iatp/mcp/D402_MCP_ADAPTER_FLOW.md +357 -0
  14. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/__main__.py.j2 +1 -1
  15. traia_iatp-0.1.44/src/traia_iatp.egg-info/PKG-INFO +318 -0
  16. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp.egg-info/SOURCES.txt +6 -2
  17. traia_iatp-0.1.43/PKG-INFO +0 -423
  18. traia_iatp-0.1.43/README.md +0 -374
  19. traia_iatp-0.1.43/src/traia_iatp/contracts/wallet_creator.py +0 -255
  20. traia_iatp-0.1.43/src/traia_iatp.egg-info/PKG-INFO +0 -423
  21. traia_iatp-0.1.43/tests/test_configuration.py +0 -129
  22. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/LICENSE +0 -0
  23. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/setup.cfg +0 -0
  24. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/README.md +0 -0
  25. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/__init__.py +0 -0
  26. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/cli/__init__.py +0 -0
  27. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/client/__init__.py +0 -0
  28. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/client/a2a_client.py +0 -0
  29. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/client/d402_a2a_client.py +0 -0
  30. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/client/grpc_a2a_tools.py +0 -0
  31. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/client/root_path_a2a_client.py +0 -0
  32. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/contracts/__init__.py +0 -0
  33. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/contracts/data/abis/contract-abis-localhost.json +0 -0
  34. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/contracts/data/abis/contract-abis-sepolia.json +0 -0
  35. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/contracts/data/addresses/contract-addresses.json +0 -0
  36. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/contracts/data/addresses/contract-proxies.json +0 -0
  37. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/contracts/iatp_contracts_config.py +0 -0
  38. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/core/__init__.py +0 -0
  39. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/core/models.py +0 -0
  40. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/__init__.py +0 -0
  41. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/asgi_wrapper.py +0 -0
  42. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/chains.py +0 -0
  43. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/client.py +0 -0
  44. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/clients/__init__.py +0 -0
  45. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/clients/base.py +0 -0
  46. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/common.py +0 -0
  47. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/encoding.py +0 -0
  48. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/examples/client_example.py +0 -0
  49. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/examples/server_example.py +0 -0
  50. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/facilitator.py +0 -0
  51. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/mcp_middleware.py +0 -0
  52. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/models.py +0 -0
  53. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/networks.py +0 -0
  54. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/path.py +0 -0
  55. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/payment_introspection.py +0 -0
  56. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/payment_signing.py +0 -0
  57. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/price_builder.py +0 -0
  58. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/servers/__init__.py +0 -0
  59. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/servers/base.py +0 -0
  60. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/servers/example_general_server.py +0 -0
  61. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/servers/fastapi.py +0 -0
  62. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/servers/mcp.py +0 -0
  63. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/starlette_middleware.py +0 -0
  64. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/d402/types.py +0 -0
  65. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/__init__.py +0 -0
  66. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/client.py +0 -0
  67. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/d402_mcp_tool_adapter.py +0 -0
  68. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/mcp_agent_template.py +0 -0
  69. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/Dockerfile.j2 +0 -0
  70. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/README.md.j2 +0 -0
  71. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/cursor-rules.md.j2 +0 -0
  72. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/deployment_params.json.j2 +0 -0
  73. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/docker-compose.yml.j2 +0 -0
  74. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/dockerignore.j2 +0 -0
  75. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/env.example.j2 +0 -0
  76. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/gitignore.j2 +0 -0
  77. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/mcp_health_check.py.j2 +0 -0
  78. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/pyproject.toml.j2 +0 -0
  79. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/pyrightconfig.json.j2 +0 -0
  80. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/run_local_docker.sh.j2 +0 -0
  81. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/templates/server.py.j2 +0 -0
  82. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/mcp/traia_mcp_adapter.py +0 -0
  83. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/preview_diagrams.html +0 -0
  84. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/__init__.py +0 -0
  85. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/atlas_search_indexes.json +0 -0
  86. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/embeddings.py +0 -0
  87. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/iatp_search_api.py +0 -0
  88. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/mongodb_registry.py +0 -0
  89. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/readmes/ATLAS_SEARCH_INDEXES.md +0 -0
  90. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/readmes/ATLAS_SEARCH_SETUP.md +0 -0
  91. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/readmes/AUTHENTICATION_UPDATE.md +0 -0
  92. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/readmes/EMBEDDINGS_SETUP.md +0 -0
  93. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/readmes/IATP_SEARCH_API_GUIDE.md +0 -0
  94. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/readmes/MONGODB_X509_AUTH.md +0 -0
  95. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/readmes/README.md +0 -0
  96. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/registry/readmes/REFACTORING_SUMMARY.md +0 -0
  97. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/scripts/__init__.py +0 -0
  98. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/scripts/create_wallet.py +0 -0
  99. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/__init__.py +0 -0
  100. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/a2a_server.py +0 -0
  101. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/example_template_usage.py +0 -0
  102. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/iatp_server_agent_generator.py +0 -0
  103. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/iatp_server_template_generator.py +0 -0
  104. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/.dockerignore.j2 +0 -0
  105. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/Dockerfile.j2 +0 -0
  106. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/README.md +0 -0
  107. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/README.md.j2 +0 -0
  108. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/__init__.py +0 -0
  109. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/agent.py.j2 +0 -0
  110. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/agent_config.json.j2 +0 -0
  111. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/agent_executor.py.j2 +0 -0
  112. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/docker-compose.yml.j2 +0 -0
  113. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/env.example.j2 +0 -0
  114. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/gitignore.j2 +0 -0
  115. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/grpc_server.py.j2 +0 -0
  116. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/pyproject.toml.j2 +0 -0
  117. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/run_local_docker.sh.j2 +0 -0
  118. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/server/templates/server.py.j2 +0 -0
  119. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/special_agencies/__init__.py +0 -0
  120. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/special_agencies/registry_search_agency.py +0 -0
  121. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/utils/__init__.py +0 -0
  122. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/utils/docker_utils.py +0 -0
  123. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/utils/general.py +0 -0
  124. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp/utils/iatp_utils.py +0 -0
  125. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp.egg-info/dependency_links.txt +0 -0
  126. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp.egg-info/entry_points.txt +0 -0
  127. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp.egg-info/requires.txt +0 -0
  128. {traia_iatp-0.1.43 → traia_iatp-0.1.44}/src/traia_iatp.egg-info/top_level.txt +0 -0
@@ -0,0 +1,34 @@
1
+ # Include package data
2
+ include README.md
3
+ include LICENSE
4
+
5
+ # Include template files
6
+ recursive-include src/traia_iatp/mcp/templates *.j2
7
+ recursive-include src/traia_iatp/server/templates *.j2 *.md *.py
8
+
9
+ # Include contract data
10
+ recursive-include src/traia_iatp/contracts/data *.json
11
+
12
+ # Include registry data
13
+ recursive-include src/traia_iatp/registry/readmes *.md
14
+ include src/traia_iatp/registry/*.json
15
+
16
+ # Include documentation
17
+ recursive-include src/traia_iatp *.md *.html
18
+
19
+ # Exclude examples (not part of the package)
20
+ prune examples
21
+ recursive-exclude examples *
22
+
23
+ # Exclude documentation (not part of the package)
24
+ prune docs
25
+ recursive-exclude docs *
26
+
27
+ # Exclude tests
28
+ prune tests
29
+ recursive-exclude tests *
30
+
31
+ # Exclude build artifacts
32
+ global-exclude __pycache__
33
+ global-exclude *.py[co]
34
+ global-exclude .DS_Store
@@ -0,0 +1,318 @@
1
+ Metadata-Version: 2.4
2
+ Name: traia-iatp
3
+ Version: 0.1.44
4
+ Summary: Inter-Agent Transfer Protocol (IATP) - Enable AI Agents to utilize other AI Agents as tools
5
+ Project-URL: Documentation, https://docs.d402.net
6
+ Project-URL: Source, https://github.com/Traia-IO/IATP
7
+ Keywords: crewai,iatp,agent-to-agent,a2a,mcp,web3,cryptocurrency,tools
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.12
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: a2a-sdk>=0.3.19
14
+ Requires-Dist: aiohttp>=3.12.13
15
+ Requires-Dist: anyio>=4.0.0
16
+ Requires-Dist: crewai>=0.203.1
17
+ Requires-Dist: crewai-tools[mcp]>=0.76.0
18
+ Requires-Dist: docker>=7.1.0
19
+ Requires-Dist: fastapi>=0.119.0
20
+ Requires-Dist: httpx[http2]>=0.28.1
21
+ Requires-Dist: jinja2>=3.1.6
22
+ Requires-Dist: mcp>=1.1.2
23
+ Requires-Dist: openai>=1.109.1
24
+ Requires-Dist: pydantic>=2.12.2
25
+ Requires-Dist: pymongo[aws]>=4.13.0
26
+ Requires-Dist: python-dotenv>=1.1.1
27
+ Requires-Dist: pytz>=2025.2
28
+ Requires-Dist: requests>=2.32.5
29
+ Requires-Dist: rich>=14.2.0
30
+ Requires-Dist: starlette>=0.45.0
31
+ Requires-Dist: typer>=0.19.2
32
+ Requires-Dist: uvicorn>=0.37.0
33
+ Requires-Dist: agentops>=0.4.21
34
+ Requires-Dist: dnspython==2.6.1
35
+ Requires-Dist: eth-account>=0.11.0
36
+ Requires-Dist: web3>=6.15.0
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest>=8.4.2; extra == "dev"
39
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
40
+ Requires-Dist: black>=23.0.0; extra == "dev"
41
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
42
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
43
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
44
+ Provides-Extra: publish
45
+ Requires-Dist: wheel; extra == "publish"
46
+ Requires-Dist: twine; extra == "publish"
47
+ Requires-Dist: build; extra == "publish"
48
+ Dynamic: license-file
49
+
50
+ # IATP-D402: Inter-Agent Transfer Protocol with Payment Support
51
+
52
+ [![PyPI version](https://badge.fury.io/py/traia-iatp.svg)](https://badge.fury.io/py/traia-iatp)
53
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
54
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55
+ [![Documentation](https://img.shields.io/badge/docs-docs.d402.net-blue)](https://docs.d402.net)
56
+
57
+ **IATP-D402** enables AI agents and APIs to charge for their services using the D402 payment protocol (HTTP 402 Payment Required). Build payment-enabled:
58
+ - 🌐 APIs and web servers
59
+ - 🔧 MCP (Model Context Protocol) servers
60
+ - 🤖 A2A utility agents
61
+ - 🤝 CrewAI tools and agents
62
+
63
+ ## 🚀 Quick Start
64
+
65
+ ### Installation
66
+
67
+ ```bash
68
+ pip install traia-iatp
69
+ ```
70
+
71
+ ### Add D402 to Your FastAPI Server (5 lines)
72
+
73
+ ```python
74
+ from fastapi import FastAPI
75
+ from traia_iatp.d402.servers.fastapi import D402FastAPIMiddleware
76
+ from traia_iatp.d402.price_builder import D402PriceBuilder
77
+
78
+ app = FastAPI()
79
+
80
+ # Add D402 (5 lines)
81
+ price_builder = D402PriceBuilder(network="sepolia")
82
+ d402 = D402FastAPIMiddleware(server_address="0x...", facilitator_url="https://test-facilitator.d402.net")
83
+ price = price_builder.create_price(0.01) # $0.01 USD
84
+ d402.register_endpoint("/api/analyze", price_wei=price.amount, token_address=price.asset.address, network="sepolia", description="Analysis")
85
+ d402.add_to_app(app)
86
+
87
+ # Your endpoint (unchanged!)
88
+ @app.post("/api/analyze")
89
+ async def analyze(request: Request):
90
+ return {"result": "done"}
91
+ ```
92
+
93
+ ### Call D402-Protected Servers (2 lines)
94
+
95
+ ```python
96
+ from traia_iatp.d402.clients.httpx import d402HttpxClient
97
+ from eth_account import Account
98
+
99
+ async with d402HttpxClient(
100
+ operator_account=Account.from_key("0x..."),
101
+ wallet_address="0x...",
102
+ max_value=100000,
103
+ base_url="http://localhost:8000"
104
+ ) as client:
105
+ # Payment automatic!
106
+ response = await client.post("/api/analyze", json={"text": "test"})
107
+ ```
108
+
109
+ ## 📚 Documentation
110
+
111
+ **Full documentation**: [docs.d402.net](https://docs.d402.net)
112
+
113
+ ### Quick Links
114
+
115
+ - **[Complete Examples](docs/examples/overview.md)** - Step-by-step integration examples (0-6)
116
+ - **[Server Integration](docs/d402-servers/overview.md)** - Add D402 to existing servers
117
+ - **[Client Integration](docs/d402-clients/overview.md)** - Call D402-protected APIs
118
+ - **[MCP Servers](docs/mcp-servers/overview.md)** - Build payment-enabled MCP servers
119
+ - **[Utility Agents](docs/utility-agents/overview.md)** - Build A2A utility agents
120
+ - **[CrewAI Integration](docs/crewai-integration/overview.md)** - Use D402 tools in CrewAI
121
+
122
+ ### Complete Integration Examples
123
+
124
+ The [examples section](docs/examples/overview.md) provides complete, working code for:
125
+
126
+ 0. **[Wallet Creation & Funding](docs/examples/0-wallet-creation-funding.md)** - Setup wallets, get testnet USDC
127
+ 1. **[Existing Server → D402](docs/examples/1-server-to-d402.md)** - Add payments to your API (before/after)
128
+ 2. **[Calling D402 Servers](docs/examples/2-calling-d402-servers.md)** - Build payment-enabled client
129
+ 3. **[API → MCP Server](docs/examples/3-api-to-mcp-server.md)** - Convert REST to MCP tools
130
+ 4. **[CrewAI + MCP](docs/examples/4-crewai-using-mcp.md)** - Use MCP server in crews
131
+ 5. **[MCP → Utility Agent](docs/examples/5-mcp-to-utility-agent.md)** - Wrap MCP as A2A agent
132
+ 6. **[CrewAI + Utility Agent](docs/examples/6-crewai-using-utility-agent.md)** - Use agents in crews
133
+
134
+ ## 🌟 Key Features
135
+
136
+ ### D402 Payment Protocol
137
+ - ✅ **HTTP 402 Payment Required** - Standard payment protocol
138
+ - ✅ **EIP-712 Signatures** - Secure payment authorization
139
+ - ✅ **On-Chain Settlement** - Smart contract-based settlements
140
+ - ✅ **Hosted Facilitators** - No infrastructure setup required
141
+
142
+ ### Server Integration
143
+ - ✅ **FastAPI** - `D402FastAPIMiddleware`
144
+ - ✅ **Starlette** - `D402PaymentMiddleware`
145
+ - ✅ **Any ASGI Framework** - `D402ASGIWrapper` (Flask, Django, Quart, etc.)
146
+ - ✅ **5-line integration** - Minimal code changes
147
+
148
+ ### Client Integration
149
+ - ✅ **HTTPX (Async)** - `d402HttpxClient` with automatic payment
150
+ - ✅ **Requests (Sync)** - Wrapper for synchronous apps
151
+ - ✅ **2-line integration** - Just make requests normally
152
+
153
+ ### MCP & A2A
154
+ - ✅ **MCP Servers** - Payment-enabled tool servers
155
+ - ✅ **Utility Agents** - A2A protocol with D402
156
+ - ✅ **CrewAI Integration** - A2AToolkit for paid tools
157
+ - ✅ **Template Generation** - Auto-generate server code
158
+
159
+ ## 🔧 What's in the Package
160
+
161
+ ### Core Components (IN pip package)
162
+
163
+ ```
164
+ src/traia_iatp/
165
+ ├── d402/ # D402 payment protocol
166
+ │ ├── servers/ # Server middleware (FastAPI, Starlette, MCP)
167
+ │ ├── clients/ # Client libraries (HTTPX, base client)
168
+ │ ├── asgi_wrapper.py # Universal ASGI wrapper
169
+ │ ├── price_builder.py # USD-based pricing
170
+ │ └── facilitator.py # Facilitator client
171
+
172
+ ├── mcp/ # MCP server templates & tools
173
+ ├── server/ # Utility agent templates
174
+ ├── client/ # A2A client & CrewAI tools
175
+ ├── contracts/ # Smart contract integration
176
+ └── registry/ # Agent discovery & search
177
+ ```
178
+
179
+ ### Examples (NOT in pip package)
180
+
181
+ ```
182
+ examples/ # Integration examples
183
+ ├── servers/ # FastAPI, Starlette, ASGI examples
184
+ └── clients/ # HTTPX, Requests examples
185
+ ```
186
+
187
+ ### Documentation (NOT in pip package)
188
+
189
+ ```
190
+ docs/ # GitBook documentation
191
+ ├── getting-started/ # Installation, quick start
192
+ ├── examples/ # Complete integration examples (0-6)
193
+ ├── wallet-setup/ # Wallet creation & CLI
194
+ ├── d402-servers/ # Server integration guides
195
+ ├── d402-clients/ # Client integration guides
196
+ ├── mcp-servers/ # MCP server guides
197
+ ├── utility-agents/ # Utility agent guides
198
+ └── crewai-integration/ # CrewAI guides
199
+ ```
200
+
201
+ ## 🏗 Architecture
202
+
203
+ ```
204
+ ┌────────────────────────────────────────────────────────────┐
205
+ │ Your Application │
206
+ │ (API / MCP Server / Utility Agent / CrewAI Crew) │
207
+ └────────────────────────────────────────────────────────────┘
208
+
209
+
210
+ ┌────────────────────────────────────────────────────────────┐
211
+ │ IATP-D402 Framework │
212
+ │ • Server Middleware • Client Libraries • Templates │
213
+ └────────────────────────────────────────────────────────────┘
214
+
215
+
216
+ ┌────────────────────────────────────────────────────────────┐
217
+ │ D402 Payment Protocol │
218
+ │ • HTTP 402 • EIP-712 Signing • Facilitator Service │
219
+ └────────────────────────────────────────────────────────────┘
220
+
221
+
222
+ ┌────────────────────────────────────────────────────────────┐
223
+ │ Smart Contracts (On-Chain) │
224
+ │ • IATPWallet • Settlement • Tokens │
225
+ └────────────────────────────────────────────────────────────┘
226
+ ```
227
+
228
+ ## 🌐 Facilitators (No Setup Required)
229
+
230
+ **You don't need to run your own facilitator!**
231
+
232
+ - **All Testnets**: `https://test-facilitator.d402.net` (currently: Sepolia)
233
+ - **All Mainnets**: `https://facilitator.d402.net` (currently: Arbitrum)
234
+
235
+ See [Facilitator URLs](docs/getting-started/facilitators.md) for details.
236
+
237
+ ## 🔐 Wallet Creation
238
+
239
+ ```bash
240
+ # Create IATP wallet (owner creates their own wallet)
241
+ traia-iatp create-iatp-wallet \
242
+ --owner-key 0x... \
243
+ --create-operator \
244
+ --wallet-name "My Server" \
245
+ --wallet-type MCP_SERVER \
246
+ --network sepolia
247
+ ```
248
+
249
+ See [Creating Wallets](docs/wallet-setup/creating-wallets.md) for complete guide.
250
+
251
+ ## 📦 Use Cases
252
+
253
+ ### 1. Monetize Your API
254
+
255
+ ```python
256
+ # Add payment to any endpoint
257
+ d402.register_endpoint("/api/analyze", price_usd=0.01)
258
+ ```
259
+
260
+ ### 2. Build Payment-Enabled MCP Servers
261
+
262
+ ```python
263
+ @mcp.tool()
264
+ @require_payment_for_tool(price=price_builder.create_price(0.01))
265
+ def analyze(text: str) -> dict:
266
+ return analyze_sentiment(text)
267
+ ```
268
+
269
+ ### 3. Use Paid Tools in CrewAI
270
+
271
+ ```python
272
+ toolkit = A2AToolkit.create_from_endpoint(
273
+ endpoint="http://localhost:9001",
274
+ payment_private_key="0x...",
275
+ wallet_address="0x...",
276
+ max_payment_usd=1.0
277
+ )
278
+
279
+ agent = Agent(role="Analyst", tools=toolkit.tools)
280
+ ```
281
+
282
+ ## 🛠 CLI Commands
283
+
284
+ ```bash
285
+ # Create IATP wallet
286
+ traia-iatp create-iatp-wallet --owner-key 0x... --create-operator
287
+
288
+ # Create utility agency from MCP server
289
+ traia-iatp create-agency --name "My Agent" --mcp-name "Trading MCP"
290
+
291
+ # List available agencies
292
+ traia-iatp list-agencies
293
+
294
+ # Search for tools
295
+ traia-iatp find-tools --query "sentiment analysis"
296
+ ```
297
+
298
+ ## 🔗 Links
299
+
300
+ - **Documentation**: [docs.d402.net](https://docs.d402.net)
301
+ - **PyPI**: [pypi.org/project/traia-iatp](https://pypi.org/project/traia-iatp)
302
+ - **GitHub**: [github.com/Traia-IO/IATP](https://github.com/Traia-IO/IATP)
303
+ - **Examples**: [docs/examples/](docs/examples/overview.md)
304
+
305
+ ## 📄 License
306
+
307
+ MIT License - see [LICENSE](LICENSE) file for details.
308
+
309
+ ## 🤝 Support
310
+
311
+ - 📖 **Documentation**: [docs.d402.net](https://docs.d402.net)
312
+ - 🐛 **Issues**: [GitHub Issues](https://github.com/Traia-IO/IATP/issues)
313
+ - 💬 **Website**: [traia.io](https://traia.io)
314
+ - 📧 **Email**: support@traia.io
315
+
316
+ ---
317
+
318
+ **Made with ❤️ by the Traia Team**
@@ -0,0 +1,269 @@
1
+ # IATP-D402: Inter-Agent Transfer Protocol with Payment Support
2
+
3
+ [![PyPI version](https://badge.fury.io/py/traia-iatp.svg)](https://badge.fury.io/py/traia-iatp)
4
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Documentation](https://img.shields.io/badge/docs-docs.d402.net-blue)](https://docs.d402.net)
7
+
8
+ **IATP-D402** enables AI agents and APIs to charge for their services using the D402 payment protocol (HTTP 402 Payment Required). Build payment-enabled:
9
+ - 🌐 APIs and web servers
10
+ - 🔧 MCP (Model Context Protocol) servers
11
+ - 🤖 A2A utility agents
12
+ - 🤝 CrewAI tools and agents
13
+
14
+ ## 🚀 Quick Start
15
+
16
+ ### Installation
17
+
18
+ ```bash
19
+ pip install traia-iatp
20
+ ```
21
+
22
+ ### Add D402 to Your FastAPI Server (5 lines)
23
+
24
+ ```python
25
+ from fastapi import FastAPI
26
+ from traia_iatp.d402.servers.fastapi import D402FastAPIMiddleware
27
+ from traia_iatp.d402.price_builder import D402PriceBuilder
28
+
29
+ app = FastAPI()
30
+
31
+ # Add D402 (5 lines)
32
+ price_builder = D402PriceBuilder(network="sepolia")
33
+ d402 = D402FastAPIMiddleware(server_address="0x...", facilitator_url="https://test-facilitator.d402.net")
34
+ price = price_builder.create_price(0.01) # $0.01 USD
35
+ d402.register_endpoint("/api/analyze", price_wei=price.amount, token_address=price.asset.address, network="sepolia", description="Analysis")
36
+ d402.add_to_app(app)
37
+
38
+ # Your endpoint (unchanged!)
39
+ @app.post("/api/analyze")
40
+ async def analyze(request: Request):
41
+ return {"result": "done"}
42
+ ```
43
+
44
+ ### Call D402-Protected Servers (2 lines)
45
+
46
+ ```python
47
+ from traia_iatp.d402.clients.httpx import d402HttpxClient
48
+ from eth_account import Account
49
+
50
+ async with d402HttpxClient(
51
+ operator_account=Account.from_key("0x..."),
52
+ wallet_address="0x...",
53
+ max_value=100000,
54
+ base_url="http://localhost:8000"
55
+ ) as client:
56
+ # Payment automatic!
57
+ response = await client.post("/api/analyze", json={"text": "test"})
58
+ ```
59
+
60
+ ## 📚 Documentation
61
+
62
+ **Full documentation**: [docs.d402.net](https://docs.d402.net)
63
+
64
+ ### Quick Links
65
+
66
+ - **[Complete Examples](docs/examples/overview.md)** - Step-by-step integration examples (0-6)
67
+ - **[Server Integration](docs/d402-servers/overview.md)** - Add D402 to existing servers
68
+ - **[Client Integration](docs/d402-clients/overview.md)** - Call D402-protected APIs
69
+ - **[MCP Servers](docs/mcp-servers/overview.md)** - Build payment-enabled MCP servers
70
+ - **[Utility Agents](docs/utility-agents/overview.md)** - Build A2A utility agents
71
+ - **[CrewAI Integration](docs/crewai-integration/overview.md)** - Use D402 tools in CrewAI
72
+
73
+ ### Complete Integration Examples
74
+
75
+ The [examples section](docs/examples/overview.md) provides complete, working code for:
76
+
77
+ 0. **[Wallet Creation & Funding](docs/examples/0-wallet-creation-funding.md)** - Setup wallets, get testnet USDC
78
+ 1. **[Existing Server → D402](docs/examples/1-server-to-d402.md)** - Add payments to your API (before/after)
79
+ 2. **[Calling D402 Servers](docs/examples/2-calling-d402-servers.md)** - Build payment-enabled client
80
+ 3. **[API → MCP Server](docs/examples/3-api-to-mcp-server.md)** - Convert REST to MCP tools
81
+ 4. **[CrewAI + MCP](docs/examples/4-crewai-using-mcp.md)** - Use MCP server in crews
82
+ 5. **[MCP → Utility Agent](docs/examples/5-mcp-to-utility-agent.md)** - Wrap MCP as A2A agent
83
+ 6. **[CrewAI + Utility Agent](docs/examples/6-crewai-using-utility-agent.md)** - Use agents in crews
84
+
85
+ ## 🌟 Key Features
86
+
87
+ ### D402 Payment Protocol
88
+ - ✅ **HTTP 402 Payment Required** - Standard payment protocol
89
+ - ✅ **EIP-712 Signatures** - Secure payment authorization
90
+ - ✅ **On-Chain Settlement** - Smart contract-based settlements
91
+ - ✅ **Hosted Facilitators** - No infrastructure setup required
92
+
93
+ ### Server Integration
94
+ - ✅ **FastAPI** - `D402FastAPIMiddleware`
95
+ - ✅ **Starlette** - `D402PaymentMiddleware`
96
+ - ✅ **Any ASGI Framework** - `D402ASGIWrapper` (Flask, Django, Quart, etc.)
97
+ - ✅ **5-line integration** - Minimal code changes
98
+
99
+ ### Client Integration
100
+ - ✅ **HTTPX (Async)** - `d402HttpxClient` with automatic payment
101
+ - ✅ **Requests (Sync)** - Wrapper for synchronous apps
102
+ - ✅ **2-line integration** - Just make requests normally
103
+
104
+ ### MCP & A2A
105
+ - ✅ **MCP Servers** - Payment-enabled tool servers
106
+ - ✅ **Utility Agents** - A2A protocol with D402
107
+ - ✅ **CrewAI Integration** - A2AToolkit for paid tools
108
+ - ✅ **Template Generation** - Auto-generate server code
109
+
110
+ ## 🔧 What's in the Package
111
+
112
+ ### Core Components (IN pip package)
113
+
114
+ ```
115
+ src/traia_iatp/
116
+ ├── d402/ # D402 payment protocol
117
+ │ ├── servers/ # Server middleware (FastAPI, Starlette, MCP)
118
+ │ ├── clients/ # Client libraries (HTTPX, base client)
119
+ │ ├── asgi_wrapper.py # Universal ASGI wrapper
120
+ │ ├── price_builder.py # USD-based pricing
121
+ │ └── facilitator.py # Facilitator client
122
+
123
+ ├── mcp/ # MCP server templates & tools
124
+ ├── server/ # Utility agent templates
125
+ ├── client/ # A2A client & CrewAI tools
126
+ ├── contracts/ # Smart contract integration
127
+ └── registry/ # Agent discovery & search
128
+ ```
129
+
130
+ ### Examples (NOT in pip package)
131
+
132
+ ```
133
+ examples/ # Integration examples
134
+ ├── servers/ # FastAPI, Starlette, ASGI examples
135
+ └── clients/ # HTTPX, Requests examples
136
+ ```
137
+
138
+ ### Documentation (NOT in pip package)
139
+
140
+ ```
141
+ docs/ # GitBook documentation
142
+ ├── getting-started/ # Installation, quick start
143
+ ├── examples/ # Complete integration examples (0-6)
144
+ ├── wallet-setup/ # Wallet creation & CLI
145
+ ├── d402-servers/ # Server integration guides
146
+ ├── d402-clients/ # Client integration guides
147
+ ├── mcp-servers/ # MCP server guides
148
+ ├── utility-agents/ # Utility agent guides
149
+ └── crewai-integration/ # CrewAI guides
150
+ ```
151
+
152
+ ## 🏗 Architecture
153
+
154
+ ```
155
+ ┌────────────────────────────────────────────────────────────┐
156
+ │ Your Application │
157
+ │ (API / MCP Server / Utility Agent / CrewAI Crew) │
158
+ └────────────────────────────────────────────────────────────┘
159
+
160
+
161
+ ┌────────────────────────────────────────────────────────────┐
162
+ │ IATP-D402 Framework │
163
+ │ • Server Middleware • Client Libraries • Templates │
164
+ └────────────────────────────────────────────────────────────┘
165
+
166
+
167
+ ┌────────────────────────────────────────────────────────────┐
168
+ │ D402 Payment Protocol │
169
+ │ • HTTP 402 • EIP-712 Signing • Facilitator Service │
170
+ └────────────────────────────────────────────────────────────┘
171
+
172
+
173
+ ┌────────────────────────────────────────────────────────────┐
174
+ │ Smart Contracts (On-Chain) │
175
+ │ • IATPWallet • Settlement • Tokens │
176
+ └────────────────────────────────────────────────────────────┘
177
+ ```
178
+
179
+ ## 🌐 Facilitators (No Setup Required)
180
+
181
+ **You don't need to run your own facilitator!**
182
+
183
+ - **All Testnets**: `https://test-facilitator.d402.net` (currently: Sepolia)
184
+ - **All Mainnets**: `https://facilitator.d402.net` (currently: Arbitrum)
185
+
186
+ See [Facilitator URLs](docs/getting-started/facilitators.md) for details.
187
+
188
+ ## 🔐 Wallet Creation
189
+
190
+ ```bash
191
+ # Create IATP wallet (owner creates their own wallet)
192
+ traia-iatp create-iatp-wallet \
193
+ --owner-key 0x... \
194
+ --create-operator \
195
+ --wallet-name "My Server" \
196
+ --wallet-type MCP_SERVER \
197
+ --network sepolia
198
+ ```
199
+
200
+ See [Creating Wallets](docs/wallet-setup/creating-wallets.md) for complete guide.
201
+
202
+ ## 📦 Use Cases
203
+
204
+ ### 1. Monetize Your API
205
+
206
+ ```python
207
+ # Add payment to any endpoint
208
+ d402.register_endpoint("/api/analyze", price_usd=0.01)
209
+ ```
210
+
211
+ ### 2. Build Payment-Enabled MCP Servers
212
+
213
+ ```python
214
+ @mcp.tool()
215
+ @require_payment_for_tool(price=price_builder.create_price(0.01))
216
+ def analyze(text: str) -> dict:
217
+ return analyze_sentiment(text)
218
+ ```
219
+
220
+ ### 3. Use Paid Tools in CrewAI
221
+
222
+ ```python
223
+ toolkit = A2AToolkit.create_from_endpoint(
224
+ endpoint="http://localhost:9001",
225
+ payment_private_key="0x...",
226
+ wallet_address="0x...",
227
+ max_payment_usd=1.0
228
+ )
229
+
230
+ agent = Agent(role="Analyst", tools=toolkit.tools)
231
+ ```
232
+
233
+ ## 🛠 CLI Commands
234
+
235
+ ```bash
236
+ # Create IATP wallet
237
+ traia-iatp create-iatp-wallet --owner-key 0x... --create-operator
238
+
239
+ # Create utility agency from MCP server
240
+ traia-iatp create-agency --name "My Agent" --mcp-name "Trading MCP"
241
+
242
+ # List available agencies
243
+ traia-iatp list-agencies
244
+
245
+ # Search for tools
246
+ traia-iatp find-tools --query "sentiment analysis"
247
+ ```
248
+
249
+ ## 🔗 Links
250
+
251
+ - **Documentation**: [docs.d402.net](https://docs.d402.net)
252
+ - **PyPI**: [pypi.org/project/traia-iatp](https://pypi.org/project/traia-iatp)
253
+ - **GitHub**: [github.com/Traia-IO/IATP](https://github.com/Traia-IO/IATP)
254
+ - **Examples**: [docs/examples/](docs/examples/overview.md)
255
+
256
+ ## 📄 License
257
+
258
+ MIT License - see [LICENSE](LICENSE) file for details.
259
+
260
+ ## 🤝 Support
261
+
262
+ - 📖 **Documentation**: [docs.d402.net](https://docs.d402.net)
263
+ - 🐛 **Issues**: [GitHub Issues](https://github.com/Traia-IO/IATP/issues)
264
+ - 💬 **Website**: [traia.io](https://traia.io)
265
+ - 📧 **Email**: support@traia.io
266
+
267
+ ---
268
+
269
+ **Made with ❤️ by the Traia Team**
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "traia-iatp"
7
- version = "0.1.43"
7
+ version = "0.1.44"
8
8
  description = "Inter-Agent Transfer Protocol (IATP) - Enable AI Agents to utilize other AI Agents as tools"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -58,7 +58,7 @@ publish = [
58
58
  ]
59
59
 
60
60
  [project.urls]
61
- "Documentation" = "https://pypi.org/project/traia-iatp"
61
+ "Documentation" = "https://docs.d402.net"
62
62
  "Source" = "https://github.com/Traia-IO/IATP"
63
63
 
64
64
  [project.scripts]
@@ -67,6 +67,7 @@ traia-iatp = "traia_iatp.cli.main:app"
67
67
  [tool.setuptools.packages.find]
68
68
  where = ["src"]
69
69
  include = ["traia_iatp*"]
70
+ exclude = ["examples*", "tests*", "docs*"]
70
71
  namespaces = true
71
72
 
72
73
  [tool.setuptools.package-data]