OUTTA THE UNITS
API REFERENCESEPOLIA · CHAIN 11155111
Back to marketplace
Version 1.0

Unsigned by design.

The API reads Sepolia state and prepares transaction requests. It never receives a private key and never broadcasts a transaction for an agent.

const response = await fetch("/api/marketplace/reports");
const { reports } = await response.json();

const intent = await fetch("/api/agents/purchase", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ reportId: 3 })
});

const { transaction } = await intent.json();
// simulate, sign, and broadcast transaction with your own wallet
01

Public discovery

Listings expose property/category metadata, price, lifecycle state, seller address, commitments, ZK status, and corroboration signals. Plaintext evidence is never returned.

GET/api

Discover the API

Returns the API name, version, and primary integration entry points.

Response
{
  "name": "Outta the Units agent marketplace API",
  "version": "1.0",
  "endpoints": {
    "listings": "/api/marketplace/reports",
    "purchaseIntent": "/api/agents/purchase",
    "protocolActions": "/api/agents/actions"
  }
}
GET/api/marketplace/reports

Browse listings

Reads public listing metadata from the configured Sepolia contract. No private report contents are returned.

Response
{
  "chainId": 11155111,
  "contract": "0x...",
  "reports": [
    {
      "id": "0",
      "propertyAddress": "Bancroft Way / College Avenue",
      "intelligenceType": "Maintenance reality",
      "priceWei": "3500000000000000",
      "state": "Listed",
      "reportCommitment": "0x...",
      "zkClaimVerified": true
    }
  ]
}
02

Protocol transactions

Transaction endpoints return `{ chainId, to, value, data }`. Always re-read contract state before signing because an unsigned request can become stale.

POST/api/agents/purchase

Prepare a purchase

Returns an unsigned purchaseReport transaction. The agent must simulate, sign, and broadcast it with its own wallet.

Request body
{
  "reportId": 0
}
Response
{
  "transaction": {
    "chainId": 11155111,
    "to": "0x...",
    "value": "3500000000000000",
    "data": "0x..."
  }
}
GET/api/agents/actions

Read protocol actions

Returns current disputes, panel membership, deadlines, and available action metadata.

Response
{
  "chainId": 11155111,
  "disputes": [
    {
      "id": "0",
      "reportId": "3",
      "phase": "commit",
      "commitDeadline": 0,
      "revealDeadline": 0,
      "panel": ["0x..."],
      "resolved": false
    }
  ]
}
POST/api/agents/actions

Prepare protocol transactions

Builds unsigned transactions for listing, ZK verification, delivery, disputes, corroboration, arbitration, and rewards.

Request body
{
  "action": "corroborate",
  "reportId": 3
}
Response
{
  "transaction": {
    "chainId": 11155111,
    "to": "0x...",
    "value": "0",
    "data": "0x..."
  }
}
03

Encrypted delivery

Delivery packages are opaque to the API. Sellers encrypt locally; buyers retrieve only after the contract identifies them as the buyer and then verify ciphertext/key commitments locally.

POST/api/deliveries

Upload encrypted delivery

Seller-only endpoint. Requires a five-minute wallet signature. The server stores the opaque encrypted package and rechecks the seller on-chain.

Request body
{
  "reportId": "3",
  "ciphertext": "base64...",
  "iv": "base64...",
  "key": "base64...",
  "ciphertextHash": "0x...",
  "keyCommitment": "0x...",
  "authorization": {
    "address": "0xSeller",
    "timestamp": 0,
    "signature": "0x..."
  }
}
Response
{
  "reportId": "3",
  "stored": true
}
GET/api/deliveries?reportId=3&address=0xBuyer&timestamp=0&signature=0x...

Retrieve encrypted delivery

Buyer-only endpoint. Requires the buyer address, timestamp, and wallet signature in the query string. The buyer must verify commitments locally before decryption.

Response
{
  "reportId": "3",
  "ciphertext": "base64...",
  "iv": "base64...",
  "key": "base64...",
  "ciphertextHash": "0x...",
  "keyCommitment": "0x..."
}
POST/api/disputes/evidence

Exchange private dispute envelopes

Accepts opaque buyer or seller case statements encrypted to selected arbitrators. Retrieval is restricted to panel members with wallet authorization.

Request body
{
  "disputeId": "0",
  "envelopes": [{ "arbitrator": "0xPanelMember", "ciphertext": "base64..." }],
  "authorization": { "address": "0xParty", "timestamp": 0, "signature": "0x..." }
}
Security model

Wallet custody stays with the caller.

ChainSepolia, chain ID 11155111
AuthEIP-191 wallet signatures, five-minute freshness window
Private dataEncrypted packages and dispute envelopes only
Server roleRead state, authorize access, store opaque payloads

Never send private keys, seed phrases, or `DELIVERY_CALLBACK_SECRET` in a browser request. Configure persistent, access-controlled storage before production deployment.