Skip to content

Commit

Permalink
feat: OK-24400 fix v4 swap max input amount limit
Browse files Browse the repository at this point in the history
  • Loading branch information
kwoktung committed Nov 9, 2023
1 parent cda60af commit 6ad3f5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/kit/src/views/Swap/hooks/useSwap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,12 @@ export function useInputLimitsError():
const inputToken = useAppSelector((s) => s.swap.inputToken);
const quoteLimited = useAppSelector((s) => s.swap.quoteLimited);
const typedValue = useAppSelector((s) => s.swap.typedValue);
const v = greaterThanZeroOrUndefined(typedValue);
const inputAmount = useTokenAmount(
inputToken,
greaterThanZeroOrUndefined(typedValue),
v !== undefined && inputToken
? getTokenAmountString(inputToken, v)
: undefined,
);
const maxAmount = useTokenAmount(inputToken, quoteLimited?.max);
const minAmount = useTokenAmount(inputToken, quoteLimited?.min);
Expand Down

0 comments on commit 6ad3f5f

Please sign in to comment.