From 7928a3574a14774f1176d7be6035dad249da6a51 Mon Sep 17 00:00:00 2001 From: Neven Hsu Date: Mon, 29 May 2023 15:15:38 +0800 Subject: [PATCH] feat: trade getEventsForLogs --- src/trade/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/trade/index.ts b/src/trade/index.ts index ef7ac8ce..6b48fade 100644 --- a/src/trade/index.ts +++ b/src/trade/index.ts @@ -438,6 +438,12 @@ export class Trade { return Array.from(new Set(positionIds)) } + static getEventsForLogs(logs: Log[], network: Network) { + const trades = parsePartialTradeEventsFromLogs(logs, network) + const updates = parsePartialPositionUpdatedEventsFromLogs(logs, network) + return { trades, updates } + } + // Transactions static approveQuote(market: Market, owner: string, amountQuote: BigNumber): PopulatedTransaction {