Skip to content

Add helper for building the trade webhook POST payload from an indexed trade event #450

Description

@Chucks1093

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

  • Buy event maps to correct event_type: 'buy' payload
  • Sell event maps to correct event_type: 'sell' payload
  • All payload fields are populated correctly from the input event

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions