Skip to content

feat: REST user vault balance #30 #105

Merged
greatest0fallt1me merged 15 commits intoCalloraOrg:mainfrom
Demilade01:feature/rest-vault-balance2
Feb 28, 2026
Merged

feat: REST user vault balance #30 #105
greatest0fallt1me merged 15 commits intoCalloraOrg:mainfrom
Demilade01:feature/rest-vault-balance2

Conversation

@Demilade01
Copy link
Contributor

feat: REST user vault balance #30

  • Implemented GET /api/vault/balance route
  • Created VaultController to fetch and format balance from stroops
  • Integrated requireAuth middleware for endpoint protection
  • Added unit tests for VaultController covering various test cases
    Closes Add REST Route: Get User Vault Balance #30

Demilade01 and others added 15 commits February 25, 2026 11:19
Implemented a batch payout service to aggregate developer revenue from API
usage and settle payments via Soroban.
Closes CalloraOrg#26
Add GET /api/developers/revenue (authenticated) returning total revenue,
pending settlement, and paginated list of settlements.

- Add requireAuth middleware with Bearer token validation
- Add Settlement, RevenueSummary, DeveloperRevenueResponse types
- Add in-memory mock data layer for settlements and usage
- Add developer routes module mounted at /api/developers
- Add 8 tests covering auth, response shape, values, and pagination

closes CalloraOrg#37
- Add /v1/call/:apiSlugOrId/* proxy route with full middleware pipeline
- Resolve APIs by slug or ID via ApiRegistry
- Auth (x-api-key), rate-limit (429), billing (402) checks
- Forward safe headers, strip internal ones (x-api-key, host, etc.)
- Inject X-Request-Id (UUID) on every request/response
- Configurable timeout (PROXY_TIMEOUT_MS env, default 30s) → 504
- Stream upstream response back to caller
- Record usage events for all proxied requests
- Integration tests covering all error paths and header behavior
This commit implements usage metering for proxied API calls. The billing
and recording logic has been moved to a non-blocking post-response flow
to avoid added latency, and is now based on individual endpoint pricing. Closes CalloraOrg#21
Implemented a batch payout service to aggregate developer revenue from API
usage and settle payments via Soroban.
Closes CalloraOrg#26
- Implemented GET /api/vault/balance route
- Created VaultController to fetch and format balance from stroops
- Integrated requireAuth middleware for endpoint protection
- Added unit tests for VaultController covering various test cases
Closes CalloraOrg#30
@greatest0fallt1me greatest0fallt1me merged commit e337e52 into CalloraOrg:main Feb 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add REST Route: Get User Vault Balance

2 participants