Skip to content

Commit 063277c

Browse files
authored
fix: twap executed buy sell amount was incorrect (#191)
CGW can return null in situations when fetching all children twap orders is undesirable/impossible. This was not reflected in the TWAP type and lead to crash if we try to convert the amount to a bigInt
1 parent 04a28b5 commit 063277c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/types/transactions.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,13 @@ export type SwapTransferOrder = Omit<Transfer, 'type'> &
315315
}
316316

317317
// Specific type for TwapOrder
318-
export type TwapOrder = BaseOrder & {
318+
export type TwapOrder = Omit<BaseOrder, 'executedBuyAmount' | 'executedSellAmount'> & {
319319
type: TransactionInfoType.TWAP_ORDER
320+
/** @description The executed sell token raw amount (no decimals) */
321+
executedSellAmount: null | string
322+
/** @description The executed buy token raw amount (no decimals) */
323+
executedBuyAmount: null | string
324+
/** @description The number of parts the order is split into */
320325
numberOfParts: string
321326
/** @description The amount of sellToken to sell in each part */
322327
partSellAmount: string

0 commit comments

Comments
 (0)