Files
agents-marketplace/tests/fixtures/indexer-ui-side/sample-supplier-rows.ts
jelisaveta-talbot cbab81efbd M1-F: end-to-end LLM marketplace lifecycle on Vector testnet
Bonded-escrow marketplace for prompt → response between buyers and
local-LLM suppliers, settling on Vector (UTxO) via Aiken Plutus V3
validators. Lifecycle PostEscrow → Claim → Submit → Accept proven on
Vector testnet 2026-05-06; AcceptEscrow tx 125e3cfe…7dc100d distributes
payment + bonds per the validator's distribution rule.

Workspace layout (pnpm + TypeScript):
  contracts/marketplace/      Aiken validators (advert + escrow) + plutus.json
  packages/shared/            Tx-builders (lucid-evolution), CBOR codecs,
                              chain providers (mock / read-only / live Ogmios)
  supplier/                   OpenAI-compatible HTTP node (Ollama by default;
                              vLLM / llama.cpp / OpenRouter / OpenClaw all
                              swap-in via OLLAMA_URL); 202+poll chat handler
  buyer/                      Express + React SPA; server-side runs the full
                              chain lifecycle via /v1/submit-prompt and
                              /v1/accept; SPA never holds the buyer key
  indexer/                    Chain-follower (extends apex-dashboard pattern),
                              SSE event stream + REST queries
  indexer-ui/                 Operator dashboard (events + suppliers + escrow
                              lookup)
  tests/                      1098 vitest unit + integration tests (10 skipped
                              under M1-F-D-defer for UPLC test plumbing)
  deploy/testnet/             Per-service docker-compose for the Hetzner stack
  docs/EXECUTIVE_SUMMARY.*    Marp deck (PDF + PPTX) — 11 slides, mermaid
                              diagrams pre-rendered for portable export
  docs/CLOUDFLARE_WAF_BYPASS.md  CF Skip-rule runbook for /v1/* paths
  docs/ARCHITECTURE.md        canonical spec

Live demo (testnet, 2026-05-06):
  https://mp-buyers.vector.testnet.apexfusion.org      (buyer SPA)
  https://mp-suppliers.vector.testnet.apexfusion.org   (supplier API)
  https://mp-indexer.vector.testnet.apexfusion.org     (indexer + UI)
2026-05-06 13:27:48 +02:00

69 lines
2.2 KiB
TypeScript

/**
* tests/fixtures/indexer-ui-side/sample-supplier-rows.ts
*
* Independent test data for the indexer-ui suppliers table tests.
* NO sharing with buyer-side or indexer-side fixtures.
* Derived from the SupplierRow shape in indexer-ui/src/api/client.ts.
*
* INDEPENDENCE rule: use distinct PKH/endpoint values from all other fixture files.
*/
import type { SupplierRow } from "../../../indexer-ui/src/api/client.js";
// Distinct identities — not shared with indexer-side or buyer-side fixtures.
export const UI_SUPPLIER_PKH_A = "dddddddddddddddddddddddddddddddddddddddddddddddddddddddd";
export const UI_SUPPLIER_PKH_B = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
export function buildUiSupplierRow(overrides: Partial<SupplierRow> = {}): SupplierRow {
return {
utxo_ref: "f".repeat(64) + "#0",
supplier_pkh: UI_SUPPLIER_PKH_A,
capability_id: "llm.text.generate.v1",
model: "qwen2.5:0.5b",
max_output_tokens: 512,
max_processing_ms: 60_000,
price_lovelace: "2000000",
supplier_bond_lovelace: "1000000",
buyer_bond_lovelace: "1000000",
endpoint_url: "https://ui-test-supplier-a.example.com",
detail_uri: "ipfs://QmUI000",
detail_hash: "f".repeat(64),
advertised_at: 1_745_500_000_000,
status: "free",
advert_status: "Active",
current_escrow_ref: null,
last_seen_iso: "2026-04-24T12:00:00.000Z",
created_slot: 2000,
...overrides,
};
}
export const SAMPLE_FREE_SUPPLIER: SupplierRow = buildUiSupplierRow({
utxo_ref: "f".repeat(64) + "#0",
supplier_pkh: UI_SUPPLIER_PKH_A,
status: "free",
price_lovelace: "2000000",
});
export const SAMPLE_WORKING_SUPPLIER: SupplierRow = buildUiSupplierRow({
utxo_ref: "e".repeat(64) + "#1",
supplier_pkh: UI_SUPPLIER_PKH_B,
status: "working",
price_lovelace: "1000000",
model: "llama3.2:1b",
});
export const SAMPLE_OFFLINE_SUPPLIER: SupplierRow = buildUiSupplierRow({
utxo_ref: "d".repeat(64) + "#2",
supplier_pkh: "1111111111111111111111111111111111111111111111111111111111",
status: "offline",
price_lovelace: "3000000",
model: "mistral:7b",
});
export const ALL_SAMPLE_SUPPLIERS: SupplierRow[] = [
SAMPLE_FREE_SUPPLIER,
SAMPLE_WORKING_SUPPLIER,
SAMPLE_OFFLINE_SUPPLIER,
];