The Rampart is a TypeScript library - it has no built-in HTTP server. The patterns on these pages show how to wrap SDK functions in Next.js API routes or Express endpoints to expose them over HTTP for frontends, bots, or external services.
Base URL
All examples in this section assume your deployment is at:http://localhost:3000/api for local development.
Authentication
For production deployments, protect your endpoints with a Bearer token:Response Format
All endpoints return a consistent envelope:error string and return a 4xx or 5xx HTTP status code.
Quick Start: Next.js
Install the SDK:Quick Start: Express
Rate Limiting
The Monad public RPC (https://rpc.monad.xyz) imposes rate limits. To avoid 429 errors in production:
- Cache responses in Redis or a KV store (prices for 10-30 s, TVL for 60 s)
- Use a dedicated RPC endpoint from a node provider
- Run multiple Vitest tests with
singleForkto avoid parallel RPC saturation