⚪Executor API
The OpenAgents AI API provides comprehensive endpoints to manage blockchain transactions, user feedback, and analytics. It is built on Flask and Flask-SocketIO frameworks for real-time communication and supports Cross-Origin Resource Sharing (CORS) for enhanced accessibility across applications.
API Endpoints
WebSocket Events
connect
Description: Triggered when a client establishes a connection with the server.
Response: Logs the session ID and a successful connection message.
data
Description: Processes incoming client messages.
Parameters:
message
(str): The client’s message.walletAddress
(str): The user's wallet address.balances
(dict): Current balances of the user.
Response: Initiates or continues a chat session, pushing messages to the corresponding chat.
disconnect
Description: Triggered when a client disconnects from the server.
Response: Logs a disconnection message.
submit
Description: Processes client-submitted transactions.
Parameters:
signature
(str): Transaction signature.walletAddress
(str): User's wallet address.transaction
(dict): Transaction details.
Response: Verifies the signature and updates analytics.
HTTP Endpoints
POST /<chat_id>/submit
Description: Submits a transaction tied to a specific chat session.
Parameters:
signature
(str): Transaction signature.wallet_address
(str): User’s wallet address.
Response: Updates the transaction status and flags the chat as submitted.
POST /feedback
Description: Allows users to submit feedback.
Parameters:
message
(str): Feedback content.
Response: Stores the feedback in the database.
GET /status
Description: Checks the service's operational status.
Response: Returns the current status of the API.
GET /health
Description: Verifies the system’s health.
Response: Returns "OK" to indicate operational health.
GET /balance
Description: Retrieves the user's wallet balance.
Parameters:
wallet_address
(str): The user’s wallet address.
Response: Returns detailed wallet balances.
GET /leaderboard
Description: Fetches leaderboard data for platform activity.
Parameters:
release
(str, optional): Specifies the release type, defaulting to "global."
Response: Returns leaderboard rankings and metrics.
GET /quote
Description: Provides transaction quotes based on specified parameters.
Parameters:
wallet_address
(str): User’s wallet address.transaction_type
(str): Type of transaction (swap
orbridge
).amount_in
(str, optional): Input token amount (mutually exclusive withamount_out
).amount_out
(str, optional): Expected output token amount.token_in
(str): Input token identifier.token_out
(str): Output token identifier.from_chain
(str): Source blockchain.to_chain
(str, optional): Destination blockchain for bridges.
Response: Returns a quote, status messages, and error details if any.
Agents and Chains
GET /agents
Description: Lists all available AI agents.
Response: Returns agent names and descriptions.
GET /chains
Description: Lists all supported blockchain networks.
Response: Provides the names of supported chains.
GET /tokens
Description: Lists all available tokens across supported blockchains.
Response: Returns details of tokens categorized by blockchain.
Advanced Features
Knowledge Graphs for Transactions
The API employs a knowledge graph to map blockchain data, enhancing transaction routing by:
Efficiently identifying optimal paths.
Automating multi-chain operations.
Translating complex transaction steps into actionable queries.
Last updated