Skip to content

Commit 8cec8eb

Browse files
Christian Shearerclaude
andcommitted
Expand agent view credit section with per-project details and audit links
Shows all 6 projects with project ID, credit class, description, and links to project page, credit class page, sell orders (LCD), and GraphQL indexer. Adds audit section with links to all on-chain queryable endpoints for credit classes, projects, batches, and orders. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 833a23f commit 8cec8eb

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

src/server/agent-view.ts

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import { Router, Request, Response } from "express";
1010
import { getDb } from "./db.js";
11+
import { PROJECTS } from "./project-metadata.js";
1112

1213
export function createAgentViewRoutes(baseUrl: string): Router {
1314
const router = Router();
@@ -165,15 +166,37 @@ export function createAgentViewRoutes(baseUrl: string): Router {
165166
</div>
166167
167168
<div class="section">
168-
<div class="section-header">Credit Types</div>
169-
<table>
170-
<tr><th>Code</th><th>Type</th><th>Example Project</th></tr>
171-
<tr><td class="bright">C</td><td>Carbon</td><td>Harvey Manning Park Expansion (Washington, USA)</td></tr>
172-
<tr><td class="bright">BT</td><td>Biodiversity</td><td>El Globo Habitat Bank (Santander, Colombia)</td></tr>
173-
<tr><td class="bright">USS</td><td>Umbrella Species</td><td>Biocultural Jaguar Credits (Pastaza, Ecuador)</td></tr>
174-
<tr><td class="bright">KSH</td><td>Regenerative Grazing</td><td>Grgich Hills Estate (Napa Valley, USA)</td></tr>
175-
<tr><td class="bright">MBS</td><td>Marine Biodiversity</td><td>(Coming soon)</td></tr>
176-
</table>
169+
<div class="section-header">Available Ecological Credits (${PROJECTS.length} projects)</div>
170+
${PROJECTS.map(p => `
171+
<div style="margin: 16px 0; padding: 16px; background: #0d1117; border: 1px solid #1e3a2a; border-radius: 6px;">
172+
<div style="margin-bottom: 8px;">
173+
<span class="bright" style="font-size: 15px; font-weight: 700;">${p.name}</span>
174+
<span class="dim" style="margin-left: 8px;">${p.location}</span>
175+
</div>
176+
<div class="kv"><span class="key" style="min-width: 180px;">project_id</span><span class="val">${p.projectId}</span></div>
177+
<div class="kv"><span class="key" style="min-width: 180px;">credit_class</span><span class="val">${p.creditClassId}${p.creditTypeLabel} (${p.creditType})</span></div>
178+
<div class="kv"><span class="key" style="min-width: 180px;">description</span><span class="val" style="max-width: 600px;">${p.description.length > 160 ? p.description.slice(0, 160) + '...' : p.description}</span></div>
179+
<div style="margin-top: 8px;">
180+
<span class="dim">links:</span>
181+
<a href="${p.projectPageUrl}" style="margin-left: 8px;">project page</a>
182+
<span class="dim"> | </span>
183+
<a href="https://app.regen.network/credit-classes/${p.creditClassId}">credit class</a>
184+
<span class="dim"> | </span>
185+
<a href="https://lcd-regen.keplr.app/regen/ecocredit/marketplace/v1/sell-orders-by-batch/${p.projectId}">sell orders (LCD)</a>
186+
<span class="dim"> | </span>
187+
<a href="https://api.regen.network/indexer/v1/graphql">query indexer</a>
188+
</div>
189+
</div>`).join('')}
190+
191+
<div style="margin-top: 16px;">
192+
<div class="section-header" style="font-size: 11px;">Audit & Verification</div>
193+
<div class="kv"><span class="key" style="min-width: 180px;">all_credit_classes</span><span class="val"><a href="https://lcd-regen.keplr.app/regen/ecocredit/v1/classes">lcd-regen.keplr.app/regen/ecocredit/v1/classes</a></span></div>
194+
<div class="kv"><span class="key" style="min-width: 180px;">all_projects</span><span class="val"><a href="https://lcd-regen.keplr.app/regen/ecocredit/v1/projects">lcd-regen.keplr.app/regen/ecocredit/v1/projects</a></span></div>
195+
<div class="kv"><span class="key" style="min-width: 180px;">all_batches</span><span class="val"><a href="https://lcd-regen.keplr.app/regen/ecocredit/v1/batches">lcd-regen.keplr.app/regen/ecocredit/v1/batches</a></span></div>
196+
<div class="kv"><span class="key" style="min-width: 180px;">all_sell_orders</span><span class="val"><a href="https://lcd-regen.keplr.app/regen/ecocredit/marketplace/v1/sell-orders">lcd-regen.keplr.app/.../sell-orders</a></span></div>
197+
<div class="kv"><span class="key" style="min-width: 180px;">marketplace</span><span class="val"><a href="https://app.regen.network">app.regen.network</a> (browse all projects)</span></div>
198+
<div class="kv"><span class="key" style="min-width: 180px;">registry</span><span class="val"><a href="https://registry.regen.network">registry.regen.network</a> (methodology docs)</span></div>
199+
</div>
177200
</div>
178201
179202
<div class="section">

0 commit comments

Comments
 (0)