← 返回
未分类

Warden Messari Agent

Communicate with the Messari Deep Research agent by Warden Protocol. Covers A2A protocol discovery, JSON-RPC 2.0 task messaging, x402 USDC micropayments on B...
通过 Warden Protocol 与 Messari 深度研究代理通信。包括 A2A 协议发现、JSON‑RPC 2.0 任务消息传递、B 上的 x402 USDC 微支付…
deiu
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 291
下载
💾 0
安装
1
版本
#latest

概述

Messari Agent Communication Guide

The Messari Agent by Warden is a crypto research agent that answers natural language queries about assets, protocols, and projects using Messari's quantitative and qualitative data. It speaks the A2A (Agent-to-Agent) protocol over JSON-RPC 2.0, with per-request x402 USDC micropayments.

Base URL: https://messari.agents.wardenprotocol.org

Quick Reference

ActionMethodEndpoint
--------------------------
Discover agent capabilitiesGET/.well-known/agent-card.json
Verify on-chain identityGET/.well-known/agent-registration.json
Send a query (A2A)POST (JSON-RPC)/
Send a streaming queryPOST (JSON-RPC, SSE)/

Agent Capabilities

  • Input: Text only (natural language questions about crypto)
  • Output: Text (markdown-formatted responses)
  • Streaming: Not supported in current version
  • Multi-turn: Not supported (each request is independent)
  • Payment: x402 USDC micropayments ($0.25 per request on Base mainnet)
  • Domains: Cryptocurrency, DeFi, finance, investment services, market research
  • Skills: Knowledge synthesis, question answering, fact extraction, search, document QA, inference and deduction

Step 1: Discover the Agent

Fetch the agent card to confirm capabilities and payment requirements before sending queries.

curl -s https://messari.agents.wardenprotocol.org/.well-known/agent-card.json | jq .

The response includes authentication.schemes: ["x402"] and an x402 block with the price, network, and currency. Parse these fields to determine whether payment is required and at what cost.

Key fields in the agent card:

FieldValuePurpose
-----------------------
urlhttps://messari.agents.wardenprotocol.orgBase URL for all requests
capabilities.streamingfalseStreaming not available
capabilities.multiTurnfalseNo conversation context
authentication.schemes["x402"]Payment method
x402.networkeip155:8453Base mainnet
x402.price"0.25"USDC per request

Step 2: Send a Query (A2A Protocol)

All queries use the A2A JSON-RPC 2.0 protocol on POST /. The method is message/send.

Request Format

{
  "jsonrpc": "2.0",
  "method": "message/send",
  "params": {
    "message": {
      "role": "user",
      "parts": [
        {
          "type": "text",
          "text": "What is the current market cap of Ethereum?"
        }
      ]
    }
  },
  "id": "req-001"
}

Minimal curl Example (Without Payment)

This will return a 402 if payments are enabled. Useful for testing connectivity.

curl -s -X POST https://messari.agents.wardenprotocol.org/ \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "message/send",
    "params": {
      "message": {
        "role": "user",
        "parts": [{"type": "text", "text": "What is Bitcoin's market cap?"}]
      }
    },
    "id": "req-001"
  }'

Success Response

{
  "jsonrpc": "2.0",
  "result": {
    "id": "task-1",
    "kind": "task",
    "status": {
      "state": "completed",
      "timestamp": "2026-02-18T10:30:45.123Z"
    },
    "history": [
      {
        "kind": "message",
        "role": "user",
        "parts": [{"kind": "text", "text": "What is Bitcoin's market cap?"}]
      },
      {
        "kind": "message",
        "role": "agent",
        "parts": [{"kind": "text", "text": "Bitcoin's current market capitalization is approximately..."}]
      }
    ]
  },
  "id": "req-001"
}

Error Response

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32603,
    "message": "Internal error"
  },
  "id": "req-001"
}

Task States

The status.state field in the response indicates task progress:

StateTerminalMeaning
--------------------------
submittedNoTask received, queued
workingNoAgent is processing
completedYesResponse ready in history
failedYesError occurred
cancelledYesTask was cancelled
rejectedYesTask was rejected

Since this agent does not support streaming or multi-turn, you will typically receive a single response with state: "completed" or state: "failed".

Message Parts

The parts array in messages uses a type discriminator (request) or kind discriminator (response):

TypeStructureUse
----------------------
text{"type": "text", "text": "..."}Natural language text
file{"type": "file", "file": {"url": "...", "mimeType": "..."}}File reference
data{"type": "data", "data": {...}}Structured JSON

This agent only accepts and returns text parts.

Step 3: Handle x402 Payments

When payments are enabled, POST / returns HTTP 402 unless a valid payment header is included.

Payment Flow

  1. Send a POST / request without payment headers
  2. Receive HTTP 402 with a PAYMENT-REQUIRED response header (base64-encoded JSON)
  3. Decode the header to get payment details (network, amount, recipient address)
  4. Create a signed EIP-3009 authorization (gasless; the facilitator submits the on-chain transfer)
  5. Retry the request with the signed payload in the X-PAYMENT header
  6. Receive HTTP 200 with the agent's response and a X-PAYMENT-RESPONSE header containing the settlement reference

402 Response Headers

HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: <base64-encoded JSON>
Access-Control-Expose-Headers: PAYMENT-REQUIRED, PAYMENT-RESPONSE, X-PAYMENT-RESPONSE

Decoded PAYMENT-REQUIRED payload:

{
  "x402Version": "2.0",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "maxAmountRequired": "0.25",
      "payTo": "0xRecipientWalletAddress",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "maxTimeoutSeconds": 3600
    }
  ]
}

Constructing the Payment Header

For EVM networks (Base), the payment uses EIP-3009 (transferWithAuthorization on the USDC contract):

  1. Parse the PAYMENT-REQUIRED header and select a payment option from accepts
  2. Build an EIP-712 typed data structure with from, to, value, validAfter, validBefore, and nonce
  3. Sign it with the client wallet's private key
  4. Base64-encode the signed payload
  5. Include it as X-PAYMENT:

The client does NOT submit a blockchain transaction. The authorization is gasless. The x402 facilitator submits the signed transfer on-chain on behalf of the client.

Client Libraries

Use the official x402 client libraries to handle payment construction automatically:

npm install @x402/client
import { paymentFetch } from "@x402/client";

const response = await paymentFetch(
  "https://messari.agents.wardenprotocol.org/",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      jsonrpc: "2.0",
      method: "message/send",
      params: {
        message: {
          role: "user",
          parts: [{ type: "text", text: "What is Ethereum's TVL?" }]
        }
      },
      id: "req-002"
    })
  },
  walletClient  // viem WalletClient with USDC approval
);

const result = await response.json();

Supported Payment Networks

NetworkChain IDUSDC ContractFacilitator
-----------------------------------------------
Base mainneteip155:84530x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913https://facilitator.payai.network
Base Sepolia (testnet)eip155:845320x036CbD53842c5426634e7929541eC2318f3dCF7ehttps://x402.org/facilitator
Solana mainnetsolana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vhttps://facilitator.payai.network
Solana devnetsolana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1(devnet USDC)https://x402.org/facilitator

The agent currently advertises Base mainnet (eip155:8453) at $0.25 USDC per request. Check the agent card for the latest pricing and supported networks.

CORS Headers

When calling from a browser, the agent returns these CORS headers:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, PAYMENT-SIGNATURE, X-PAYMENT
Access-Control-Expose-Headers: PAYMENT-REQUIRED, PAYMENT-RESPONSE, X-PAYMENT-RESPONSE

Step 4: Verify On-Chain Identity (ERC-8004)

The agent is registered on the ERC-8004 Identity Registry on multiple chains. Verify its identity by fetching the registration file and cross-referencing with on-chain data.

Fetch Registration

curl -s https://messari.agents.wardenprotocol.org/.well-known/agent-registration.json | jq .

Registration Fields

FieldValue
--------------
typehttps://eips.ethereum.org/EIPS/eip-8004#registration-v1
nameMessari Agent by Warden
activetrue
x402Supporttrue
supportedTrust["reputation"]

On-Chain Registrations

ChainAgent IDRegistry Contract
------------------------------------
Base Sepolia8530x8004A818BFB912233c491871b3d84c89A494BD9e
Base mainnet180960x8004A169FB4a3325136EB29fA0ceB6D2e539a432
Ethereum mainnet254900x8004A169FB4a3325136EB29fA0ceB6D2e539a432

Verify On-Chain (Using cast)

# Read the agent URI from the Base mainnet registry
cast call 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 \
  "agentURI(uint256)(string)" 18096 \
  --rpc-url https://mainnet.base.org

The returned URI should match https://messari.agents.wardenprotocol.org/agent-registration.json. If it does, the domain serving the agent card is the same domain registered on-chain, confirming authenticity.

JSON-RPC Error Codes

CodeMeaning
---------------
-32700Parse error (invalid JSON)
-32600Invalid request (malformed JSON-RPC)
-32601Method not found
-32602Invalid parameters
-32603Internal server error
-32001Task not found
-32002Task already cancelled

Example Queries

Good queries for this agent:

  • "What is the current market cap and 24h trading volume of Ethereum?"
  • "Summarize recent fundraising rounds in the DeFi sector"
  • "What are the upcoming token unlocks for Solana in the next 30 days?"
  • "Compare the TVL growth of Aave and Compound over the past year"
  • "What does Messari's latest research say about Layer 2 scaling?"

The agent returns responses in markdown format. Do NOT modify any links or URLs in the response.

Troubleshooting

HTTP 402 Payment Required

Payment is enabled. Include a valid X-PAYMENT header with a signed EIP-3009 authorization, or use the @x402/client library to handle this automatically.

Empty Response or "No message provided"

The parts array in your message is empty or missing text parts. Ensure at least one part has type: "text" with a non-empty text field.

Connection Refused

The agent runs behind a reverse proxy. Confirm the URL is https://messari.agents.wardenprotocol.org (HTTPS, not HTTP).

Task State "failed"

The Messari AI backend returned an error. Retry the request. If failures persist, check the agent's health endpoint (internal only, not publicly exposed).

Resources

  • A2A Protocol Specification: https://google.github.io/A2A (JSON-RPC messaging format for agent interoperability)
  • x402 Payment Protocol: https://x402.org (HTTP-native micropayment layer using stablecoin transfers)
  • ERC-8004 Identity Registry: https://eips.ethereum.org/EIPS/eip-8004 (on-chain agent identity and discovery)
  • Warden Protocol: https://wardenprotocol.org (agent infrastructure provider)
  • Messari: https://messari.io (crypto research and data platform)
  • x402 Client Library: https://www.npmjs.com/package/@x402/client (automatic payment handling for Node.js)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 05:49 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,350 📥 317,757
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,846
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,056 📥 796,469