Node.js service that wraps the PAJ Ramp SDK for use with the Rust backend.
- Install dependencies:
npm install- Configure environment:
cp .env.example .env
# Edit .env with your PAJ API key- Start the service:
npm startFor development with auto-reload:
npm run devGET /health- Service health status
GET /rates- Get all exchange ratesPOST /rates/calculate- Calculate rate for specific amount
POST /session/initiate- Send OTP to customerPOST /session/verify- Verify OTP and create session
GET /banks- List supported banks (requires session token)POST /banks/resolve- Verify bank account details
POST /orders/onramp- Create onramp order (fiat → crypto)POST /orders/offramp- Create offramp order (crypto → fiat)
GET /transactions/:orderId- Get order status
| Variable | Description | Default |
|---|---|---|
PAJ_SERVICE_PORT |
Service port | 3001 |
PAJ_BUSINESS_API_KEY |
PAJ Ramp business API key | - |
PAJ_ENVIRONMENT |
Environment (production/staging) | production |
USDC_MINT |
USDC token mint address | EPjF... |
docker build -t paj-ramp-service .
docker run -p 3001:3001 --env-file .env paj-ramp-serviceThe Rust backend communicates with this service via HTTP:
┌─────────────┐ HTTP ┌──────────────────┐ SDK ┌─────────────┐
│ Rust Backend│ ────────────> │ PAJ Ramp Service │ ──────────> │ PAJ Ramp API│
└─────────────┘ └──────────────────┘ └─────────────┘
This approach allows us to use the JavaScript SDK without mixing Node.js into the Rust codebase.