Skip to content

Latest commit

 

History

History
78 lines (63 loc) · 4.01 KB

File metadata and controls

78 lines (63 loc) · 4.01 KB

StakeNet REST API Documentation

All endpoints return a unified structure conforming to IApiResponse from @stakenet/shared.

Base Response Structure

{
  "success": true,
  "data": { ... },
  "error": null,
  "metadata": null
}

Available Endpoints

1. Agents Registry

  • GET /agents - List all registered agents.
  • GET /agents/{address} - Retrieve registry details for a single agent.
  • POST /agents - Register a new agent (validates locked stake on-chain).

2. Job Contracts

  • POST /jobs - Setup a job escrow and deploy a contract lock.
  • GET /jobs/{job_id} - Retrieve job status and details.
  • POST /jobs/{job_id}/verify - Trigger verification run to release escrow or slash.

3. Capability Registry & Listings

  • GET /registry/listings/search - Queries, filters, and sorts published marketplace listings.
  • POST /registry/listings - Freezes a capability claim snapshot and publishes a listing.
  • GET /registry/categories - Returns list of active categories.
  • GET /registry/providers/{address} - Retrieves provider profile details.
  • POST /registry/providers - Registers a provider profile.

4. Staking Engine

  • POST /staking/accounts - Initializes a staking account for a provider.
  • POST /staking/accounts/{address}/deposit - Deposits backing collateral stake.
  • POST /staking/accounts/{address}/withdraw - Withdraws unallocated collateral stake.
  • POST /staking/accounts/{address}/reserve - Reserve stake for active jobs.
  • POST /staking/accounts/{address}/release - Release collateral reservations.
  • GET /staking/accounts/{address} - Views collateral balance and locks.
  • GET /staking/accounts/{address}/history - Audits collateral transaction trail.

5. Verification Engine

  • POST /verifications - Triggers end-to-end verification pipeline check.
  • GET /verifications - Lists all processed verification reports.
  • GET /verifications/profiles - Lists all active capability verification profiles.
  • GET /verifications/{report_id} - Retrieves a specific verification report.

6. Trust Enforcement & Resolution Engine

  • POST /trust/decide - Manually launches the trust lifecycle run for a job.
  • GET /trust/workflow - Lists active and past workflow runs.
  • GET /trust/workflow/{run_id} - Gets history trace of a workflow run.
  • POST /trust/workflow/{run_id}/recover - Resumes a failed run from its checkpoint.
  • GET /trust/job/{job_id} - Lists all decision reports issued for a job.
  • GET /trust/audit - Retrieves the immutable decision audit ledger.
  • GET /trust/policies - Returns the active decision thresholds.

7. Reputation Engine

  • GET /reputation/provider/{id} - Returns current dynamic provider scores.
  • GET /reputation/history/{id} - Returns chronological reputation snapshot entries.

8. Ranking & Recommendations

  • GET /ranking/search - Searches listings, ranks them dynamically, and returns explainable drivers.
  • GET /ranking/explain/{provider_id} - Returns rank drivers for a provider.
  • GET /ranking/profiles - Lists weights used by the engine.
  • GET /recommendation/{category} - Surfaces active listings sorted by Category (Trending, High Trust, Best Value, Fastest, Recently Improved, New Providers, Editor's Picks).

9. Marketplace Analytics

  • GET /analytics/summary - Exposes average reputation, average stake, average latency, popularity distribution, released volume, and success/refund/slash rates.

10. Blockchain Infrastructure Diagnostics

  • GET /blockchain/health - Performs connection ping tests on Algod, Indexer, and active app IDs.
  • GET /blockchain/status - Exposes configuration values, network tags, and active contract application indices.

11. One-Click Demo Engine

  • POST /demo/reset - Wipes all database cache entries and re-seeds 8 providers, 25 historical completed jobs, 10 active jobs, 3 disputed, and 2 refunded.
  • POST /demo/scenarios/{scenario_name} - Triggers a step-by-step mock execution run of a scenario (scenario_1, scenario_2, scenario_3, scenario_4, scenario_5) and anchors audit proofs on-chain.