Summary
The indexer receives raw Soroban event data from the Stellar RPC and must map it to the server's internal trade event schema. This mapping should live in a dedicated helper so it can be unit tested without invoking the RPC and reused across different event parsers.
Scope
- Add
parseStellarTradeEvent(rawEvent): TradeEvent helper
- Maps raw Soroban event topic and data fields to:
event_type, creator_id, actor_address, amount, price, fee, ledger_sequence, timestamp
- Throws a typed
ParseError if any required field is missing or the wrong type
- Add unit tests for a valid buy event, a valid sell event, and a missing required field
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
The indexer receives raw Soroban event data from the Stellar RPC and must map it to the server's internal trade event schema. This mapping should live in a dedicated helper so it can be unit tested without invoking the RPC and reused across different event parsers.
Scope
parseStellarTradeEvent(rawEvent): TradeEventhelperevent_type,creator_id,actor_address,amount,price,fee,ledger_sequence,timestampParseErrorif any required field is missing or the wrong typeAcceptance Criteria
ParseErrorETA: 12 hours
Coordinate on Telegram