Skip to content

feat: Trust Ledger, MCP Server, x402 Payments UI, and CI Fixes - #2

Merged
devJaja merged 1 commit into
fix/onchain-sync-and-cleanupfrom
feat/trust-ledger-mcp-x402-ui
Jul 26, 2026
Merged

feat: Trust Ledger, MCP Server, x402 Payments UI, and CI Fixes#2
devJaja merged 1 commit into
fix/onchain-sync-and-cleanupfrom
feat/trust-ledger-mcp-x402-ui

Conversation

@devJaja

@devJaja devJaja commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements three major features and fixes all pre-existing CI/lint errors for the Casper Agentic Buildathon.

Backend

  • Trust Ledger (reputation.ts): getReputation() + getReputationEvents() with two-tier RPC fallback (Casper RPC → CSPR.cloud) for on-chain reputation reads
  • Settlements (settlements.ts): persist x402 settlements to data/settlements.json
  • MCP Server (src/mcp/server.ts): 5 tools via stdio transport — list_agents, suggest_agents, dispatch_task, get_task_status, read_payment_history
  • Fix /agents/:hash/reputation route to return { reputation, events } (was returning flat object, frontend expected nested)
  • Enrich /agents with tasksFailed/lastUpdated from chain
  • Add GET /x402/history route for settlement records
  • Replace require() with lazy import() in casperHandler.ts

Frontend

  • Agent Trust Page (agents/[hash]/page.tsx): score bar (0–10000), completion/failure counts, explorer-linked reputation events table
  • use-agent-reputation hook: fetches from GET /agents/:hash/reputation
  • pay-agent.tsx: x402 signTypedData payment flow (prepare → sign via CSPR.click → submit)
  • Payments page: fetches real settlement data from GET /x402/history (no hardcoded data)
  • Fix rating derivation: reputationScore / 2000 (was 3.5 + (score/10000)*1.5)
  • Add demo badge (FlaskConical icon) to AgentCard for seeded coordinator agents
  • Link agent names to trust pages
  • Fix React hooks: eliminate synchronous setState in effects

CI / Lint

  • Create eslint.config.mjs for frontend (next lint was removed in Next.js 16)
  • Fix backend lint: 0 errors (was 2 require()-import errors)
  • Fix frontend lint: 0 errors, 0 warnings
  • All checks green: backend 8/8 tests, frontend 6/6 tests, contracts 29/29 tests, tsc clean, next build clean

Verification

Check Result
Backend lint 0 errors, 23 warnings
Backend tests 8/8 pass
Backend tsc Clean
Frontend lint 0 errors, 0 warnings
Frontend tests 6/6 pass
Frontend tsc Clean
Frontend build 11/11 pages
Smart contracts 29/29 pass

Backend:
- Add Trust Ledger (reputation.ts): getReputation() + getReputationEvents()
  with two-tier RPC fallback for on-chain reputation reads
- Add settlements.ts: persist x402 settlements to data/settlements.json
- Add MCP Server (src/mcp/server.ts): 5 tools (list_agents, suggest_agents,
  dispatch_task, get_task_status, read_payment_history) via stdio transport
- Fix /agents/:hash/reputation route to return { reputation, events }
- Enrich /agents with tasksFailed/lastUpdated from chain
- Add GET /x402/history route for settlement records
- Replace require() with lazy import() in casperHandler.ts

Frontend:
- Add agent trust page (agents/[hash]/page.tsx): score bar, completion/failure
  counts, explorer-linked reputation events table
- Add use-agent-reputation hook
- Add pay-agent.tsx component: x402 signTypedData payment flow
- Update payments page to fetch real settlement data from /x402/history
- Fix rating derivation: reputationScore / 2000 (not old formula)
- Add demo badge to AgentCard with FlaskConical icon
- Link agent names to trust pages
- Fix React hooks: eliminate synchronous setState in effects

CI/Lint:
- Create eslint.config.mjs for frontend (next lint removed in Next.js 16)
- Fix backend lint: 0 errors (was 2 require()-import errors)
- Fix frontend lint: 0 errors, 0 warnings
- All checks green: backend 8/8 tests, frontend 6/6 tests,
  contracts 29/29 tests, tsc clean, next build clean
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
guild_net Ready Ready Preview, Comment Jul 26, 2026 7:08pm

@devJaja
devJaja merged commit a017bf6 into fix/onchain-sync-and-cleanup Jul 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant