-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
Description
Description
Implement a billing service that: given user_id, amount_usdc, request_id, (optional) idempotency_key — checks vault balance (from vault repo or Soroban), calls Soroban vault contract deduct(amount), on success records usage_events row with stellar_tx_hash. Retry with backoff on transient Soroban errors; fail request if insufficient balance (do not deduct).
Requirements and context
- Must use Soroban RPC client (e.g. @stellar/stellar-sdk or Soroban client)
- Backend must be authorized deduct caller on contract
- Amount in contract units (e.g. 7 decimals for USDC)
Suggested execution
- Fork the repo and create a branch
git checkout -b feature/billing-service-soroban- Implement changes
- Add Soroban client config; implement deduct call (sign with backend key)
- Billing service: check balance, call deduct, persist usage event with tx hash
- Idempotency: if usage event already exists for request_id, skip
- Add tests (mock Soroban or testnet)
- Test and commit
- Run tests; document env (RPC URL, network, backend secret key)
- Example commit message:
feat: billing service deduct via Soroban
Guidelines
- Secure key handling (env, never log)
- Clear documentation
- Timeframe: 96 hours
- Project details: #
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program