Skip to main content
Back to docs

API routes

TL;DR

  • App API routes live under /api.
  • They provide RPC proxying, indexed data reads, and indexing operations.
  • UI features call these routes directly with same-origin fetches.

Routes in active use

RouteMethodPurpose
/api/get_user_vaultsGETRead vault IDs owned by account
/api/view_pending_liquidity_requestsGETRead pending requests for Discover
/api/view_lender_positionsGETRead lender positions by account
/api/index_vaultPOSTRe-index a vault document from on-chain state
/api/indexing/enqueuePOSTQueue indexing job for worker-based recovery
/api/indexing/workerGET, POSTProcess queued indexing jobs
/api/validatorsGETRead validator list by network

Common parameters

  • factory_id: identifies the vault collection / factory contract context.
  • lender_id or owner: account filters for list endpoints.
  • network: testnet or mainnet for RPC/validator calls.

Notes

  • Factory-scoped routes validate factory_id against an allowlist.
  • Frontend hooks wrap these endpoints, so prefer using hooks in UI code.
  • useIndexVault calls /api/index_vault directly and also attempts /api/indexing/enqueue.
  • Pending and lender list hooks can switch to API polling with env flags.
SudoStake | Stake-Backed Liquidity