Summary
The webhook delivery layer needs to serialize an indexed trade event into the correct POST payload shape. This serialization should live in a shared helper so it can be tested independently and reused for both buy and sell event types.
Scope
- Add a
buildWebhookPayload(event: TradeEvent): WebhookPayload helper
- Output shape:
{ event_type, creator_id, actor_address, amount, price, fee_paid, timestamp }
- Add unit tests for a buy event and a sell event confirming all fields are mapped correctly
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
The webhook delivery layer needs to serialize an indexed trade event into the correct POST payload shape. This serialization should live in a shared helper so it can be tested independently and reused for both buy and sell event types.
Scope
buildWebhookPayload(event: TradeEvent): WebhookPayloadhelper{ event_type, creator_id, actor_address, amount, price, fee_paid, timestamp }Acceptance Criteria
event_type: 'buy'payloadevent_type: 'sell'payloadETA: 12 hours
Coordinate on Telegram