API Reference
Shield Yield Vaults provides a RESTful API for managing vaults, positions, and transactions.
Base URL
Section titled “Base URL”Development: http://localhost:5000/apiProduction: https://shyield.finance/apiAuthentication
Section titled “Authentication”The API uses session-based authentication with wallet addresses. No API keys required for public endpoints.
Wallet-Scoped Access: All transaction endpoints require a walletAddress parameter. This ensures users can only access their own transaction data, providing privacy and security.
Endpoints Overview
Section titled “Endpoints Overview”Vaults
Section titled “Vaults”GET /api/vaults- List all vaultsGET /api/vaults/:id- Get vault detailsGET /api/vaults/:id/metrics- Get vault metrics
Positions
Section titled “Positions”GET /api/positions- List user positionsPOST /api/positions/deposit- Create depositPOST /api/positions/withdraw- Create withdrawalPOST /api/positions/:id/claim- Claim rewards
Transactions
Section titled “Transactions”GET /api/transactions?walletAddress=<address>- List wallet-scoped transactions (REQUIRED parameter)GET /api/transactions/summary?walletAddress=<address>- Get transaction summary (REQUIRED parameter)
Wallet
Section titled “Wallet”POST /api/wallet/xaman/payload- Create Xaman sign-in payloadPOST /api/wallet/xaman/deposit- Create deposit payloadPOST /api/wallet/xaman/withdraw- Create withdrawal payloadPOST /api/wallet/xaman/claim- Create claim payloadGET /api/wallet/xaman/status/:uuid- Check payload statusPOST /api/wallet/balances- Get XRPL balances
Detailed Documentation
Section titled “Detailed Documentation”Per-endpoint reference pages (Vaults, Positions, Transactions, Wallet) are not yet written; the route implementations in server/routes.ts are the source of truth in the meantime.
Error Responses
Section titled “Error Responses”All endpoints return standard error responses:
{ "error": "Error message describing what went wrong"}Common HTTP status codes:
200- Success400- Bad Request (invalid parameters)404- Not Found500- Internal Server Error
Wallet-Scoped Security Errors
Section titled “Wallet-Scoped Security Errors”Transaction endpoints require the walletAddress parameter. Missing this parameter returns a 400 error:
Request:
GET /api/transactionsResponse (400):
{ "error": "walletAddress parameter is required"}Correct Request:
GET /api/transactions?walletAddress=rN7n7otQDd6FczFgLdlqtyMVUE1FiFzN9KRate Limiting
Section titled “Rate Limiting”Currently no rate limiting in development. Production deployment includes:
- 100 requests per minute per IP
- 1000 requests per hour per IP
Network Support
Section titled “Network Support”All endpoints support network parameter:
mainnet- Production XRPL mainnettestnet- XRPL testnet for development
Pass as query parameter: ?network=testnet
