Summary
Clients (mobile apps, dashboards) currently have no server-push mechanism for transaction events. A webhook system would let integrators subscribe to events like transaction.confirmed, agent.rebalanced, deposit.received.
Proposed Solution
- Add
WebhookSubscription Prisma model: url, events (array), secret (for HMAC-SHA256 signature), userId
- Add CRUD endpoints under
/api/webhooks
- Dispatch webhooks from event listener and agent loop post-action
- Sign payload with
X-Neurowealth-Signature header
- Retry failed deliveries up to 3 times with exponential backoff (leverage existing
fetchWithRetry)
Acceptance Criteria
Summary
Clients (mobile apps, dashboards) currently have no server-push mechanism for transaction events. A webhook system would let integrators subscribe to events like
transaction.confirmed,agent.rebalanced,deposit.received.Proposed Solution
WebhookSubscriptionPrisma model:url,events(array),secret(for HMAC-SHA256 signature),userId/api/webhooksX-Neurowealth-SignatureheaderfetchWithRetry)Acceptance Criteria
POST /api/webhookscreates subscription, returns signing secret onceWebhookDeliverytable