diff --git a/apps/web/app/audit/offer/[id]/page.tsx b/apps/web/app/audit/offer/[id]/page.tsx index 9a2de1b..756e492 100644 --- a/apps/web/app/audit/offer/[id]/page.tsx +++ b/apps/web/app/audit/offer/[id]/page.tsx @@ -5,7 +5,16 @@ import { accessKeyCount, verifyCommitment, viewAccount } from "@runway/sdk"; import { useParams } from "next/navigation"; import { useState } from "react"; -import { Badge, Button, Card, ErrorText, Stat } from "../../../../components/ui"; +import { + Badge, + Button, + Callout, + Card, + Container, + ErrorText, + PageHeader, + Stat, +} from "../../../../components/ui"; import { verified, verifiedView } from "../../../../lib/chain"; import { DEPLOYMENT, RPCS } from "../../../../lib/env"; import { bps, fmtUsdc } from "../../../../lib/format"; @@ -24,10 +33,18 @@ interface Policy { } const Check = ({ ok, label, detail }: { ok: boolean; label: string; detail: string }) => ( -
  • - {ok ? "✔" : "✖"} - {label} - {detail} +
  • + + {ok ? "✔" : "✖"} + + + {label} + {detail} +
  • ); @@ -55,8 +72,20 @@ export default function OfferAudit() { return { offer, policy, approved, agent, merchant, factoryHash, acct, keys }; }, [id]); - if (d.error) return ; - if (!d.data) return

    {d.loading ? "Loading…" : `No offer #${id}.`}

    ; + if (d.error) + return ( + + + + ); + if (!d.data) + return ( + +

    + {d.loading ? "Reading the offer from two RPCs…" : `No offer #${id}.`} +

    +
    + ); const { offer, policy, approved, agent, merchant, factoryHash, acct, keys } = d.data; const repaid = Math.min(merchant?.record.loans_repaid ?? 0, 3); const caps = offer.anchor_hash ? policy.anchored_caps : policy.unanchored_caps; @@ -66,142 +95,172 @@ export default function OfferAudit() { approved.measurements.find((m) => m.measurements_hash === offer.measurements_hash)?.role ?? null; return ( -
    -

    - Offer #{offer.id} for {offer.handle} {offer.status} -

    - -
    - - - - -
    -
    - -
      - = BigInt(policy.min_loan)} - label="Limit ≥ minimum loan" - detail={fmtUsdc(policy.min_loan)} - /> - - - = policy.fee_bps_min && offer.fee_bps <= policy.fee_bps_max} - label="Fee within policy" - detail={`${bps(policy.fee_bps_min)}–${bps(policy.fee_bps_max)}`} - /> - = policy.repay_bps_min && offer.repay_bps <= policy.repay_bps_max} - label="Repay share within policy" - detail={`${bps(policy.repay_bps_min)}–${bps(policy.repay_bps_max)}`} - /> - -
    -
    - -
      - - - -
    -
    - -
      -
    • - Identity anchor:{" "} - {offer.anchor_hash ? ( - {offer.anchor_hash} - ) : ( - "none (unanchored caps apply)" - )} -
    • -
    • - Inputs commitment: {offer.inputs_commitment} -
    • -
    • - LLM receipt hash:{" "} - {offer.llm_receipt_hash ? ( - {offer.llm_receipt_hash} - ) : ( - "none (no statements)" - )} -
    • -
    -
    -