Skip to content

Commit

Permalink
Update src/utils/V3Utils.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
  • Loading branch information
nicholaspai and mrice32 committed Feb 8, 2024
1 parent 2589214 commit b5b4fc0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/V3Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ export function isSlowFill(fill: Fill): boolean {
return isV2Fill(fill) ? fill.updatableRelayData.isSlowRelay : fill.updatableRelayData.fillType === FillType.SlowFill;
}

// If needed, this can be made generic in the future.
export function isSlowFillRequest(fill: Fill | SlowFillRequest): fill is SlowFillRequest {
return !isV2Fill(fill as Fill) && !isV3Fill(fill as Fill);
// Relayer field exists in V2Fill, V3Fill, but not SlowFillRequest.
return (fill as Fill).relayer === undefined;
}

type MinV2SlowFillLeaf = Pick<V2SlowFillLeaf, "payoutAdjustmentPct">;
type MinV3SlowFillLeaf = Pick<V3SlowFillLeaf, "updatedOutputAmount">;
export function isV2SlowFillLeaf<T extends MinV2SlowFillLeaf, U extends MinV3SlowFillLeaf>(
Expand Down

0 comments on commit b5b4fc0

Please sign in to comment.