Skip to content

Commit

Permalink
fix: add chain check to find correct token balance
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Sep 13, 2022
1 parent 4afe42a commit cff5de2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/widget/src/hooks/useGasSufficiency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export const useGasSufficiency = (route?: Route) => {
if (gasCosts[chainId]) {
const gasTokenBalance = Big(
tokenBalances?.find(
(t) => t.address === gasCosts[chainId].token.address,
(t) =>
t.chainId === gasCosts[chainId].token.chainId &&
t.address === gasCosts[chainId].token.address,
)?.amount ?? 0,
);

Expand Down

0 comments on commit cff5de2

Please sign in to comment.