|
8 | 8 |
|
9 | 9 | import { Router, Request, Response } from "express"; |
10 | 10 | import { getDb } from "./db.js"; |
| 11 | +import { PROJECTS } from "./project-metadata.js"; |
11 | 12 |
|
12 | 13 | export function createAgentViewRoutes(baseUrl: string): Router { |
13 | 14 | const router = Router(); |
@@ -165,15 +166,37 @@ export function createAgentViewRoutes(baseUrl: string): Router { |
165 | 166 | </div> |
166 | 167 |
|
167 | 168 | <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> |
177 | 200 | </div> |
178 | 201 |
|
179 | 202 | <div class="section"> |
|
0 commit comments