Skip to content

Commit

Permalink
fix: twap executed buy sell amount was incorrect (#191)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
compojoom authored Jul 23, 2024
1 parent 04a28b5 commit 063277c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/types/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,13 @@ export type SwapTransferOrder = Omit<Transfer, 'type'> &
}

// Specific type for TwapOrder
export type TwapOrder = BaseOrder & {
export type TwapOrder = Omit<BaseOrder, 'executedBuyAmount' | 'executedSellAmount'> & {
type: TransactionInfoType.TWAP_ORDER
/** @description The executed sell token raw amount (no decimals) */
executedSellAmount: null | string
/** @description The executed buy token raw amount (no decimals) */
executedBuyAmount: null | string
/** @description The number of parts the order is split into */
numberOfParts: string
/** @description The amount of sellToken to sell in each part */
partSellAmount: string
Expand Down

0 comments on commit 063277c

Please sign in to comment.