Skip to content

Commit

Permalink
run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesfracari committed Dec 4, 2024
1 parent b5b2afd commit d560d67
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions apps/deposit-pool/src/hooks/useCowAmmPools.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useIFrameContext, useBalancerPools } from "@bleu/cow-hooks-ui";
import { useBalancerPools, useIFrameContext } from "@bleu/cow-hooks-ui";

export function useCowAmmPools() {
const { context } = useIFrameContext();
Expand All @@ -8,6 +8,6 @@ export function useCowAmmPools() {
poolTypeIn: ["COW_AMM"],
},
context?.chainId,
"totalLiquidity"
"totalLiquidity",
);
}
4 changes: 2 additions & 2 deletions apps/deposit-pool/src/hooks/useTokenBuyPools.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useIFrameContext, useBalancerPools } from "@bleu/cow-hooks-ui";
import { useBalancerPools, useIFrameContext } from "@bleu/cow-hooks-ui";
import type { Address } from "viem";

export function useTokenBuyPools() {
Expand All @@ -12,6 +12,6 @@ export function useTokenBuyPools() {
: [],
},
context?.chainId,
"totalLiquidity"
"totalLiquidity",
);
}
6 changes: 3 additions & 3 deletions apps/withdraw-cow-amm/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
PoolItemInfo,
PoolsDropdownMenu,
Spinner,
useIFrameContext,
useBalancerUserPools,
useIFrameContext,
} from "@bleu/cow-hooks-ui";
import {
type WithdrawSchemaType,
Expand All @@ -32,7 +32,7 @@ export default function Page() {

try {
const data = await decodeExitPoolHookCalldata(
context?.hookToEdit?.hook.callData as `0x${string}`
context?.hookToEdit?.hook.callData as `0x${string}`,
);
setValue("poolId", data.poolId);
setValue("withdrawPct", data.withdrawPct);
Expand All @@ -43,7 +43,7 @@ export default function Page() {

const selectedPool = useMemo(() => {
return pools?.find(
(pool) => pool.id.toLowerCase() === poolId?.toLowerCase()
(pool) => pool.id.toLowerCase() === poolId?.toLowerCase(),
);
}, [pools, poolId]);

Expand Down
4 changes: 2 additions & 2 deletions apps/withdraw-cow-amm/src/context/withdrawHookForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function WithdrawFormContextProvider({

const selectedPool = useMemo(() => {
return pools?.find(
(pool) => pool.id.toLowerCase() === poolId?.toLowerCase()
(pool) => pool.id.toLowerCase() === poolId?.toLowerCase(),
);
}, [pools, poolId]);

Expand All @@ -51,7 +51,7 @@ export function WithdrawFormContextProvider({
setHookInfo(hookInfo);
router.push("/signing");
},
[getHookInfo, setHookInfo, router, selectedPool]
[getHookInfo, setHookInfo, router, selectedPool],
);

// biome-ignore lint:
Expand Down
12 changes: 6 additions & 6 deletions packages/cow-hooks-ui/src/hooks/useBalancerPools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ interface IGetPoolsWhere {
export function useBalancerPools(
where: IGetPoolsWhere,
chainId?: SupportedChainId,
orderBy?: string
orderBy?: string,
) {
return useSWR(
[where, chainId],
Expand All @@ -126,23 +126,23 @@ export function useBalancerPools(
...pool.userBalance,
walletBalance: parseUnits(
pool.userBalance.walletBalance,
pool.decimals
pool.decimals,
),
stakedBalances: pool.userBalance.stakedBalances.map(
(staked) => ({
balance: parseUnits(
Number(staked.balance).toFixed(pool.decimals),
pool.decimals
pool.decimals,
),
stakingId: staked.stakingId,
})
}),
),
},
dynamicData: {
...pool.dynamicData,
totalShares: parseUnits(
Number(pool.dynamicData.totalShares).toFixed(pool.decimals),
pool.decimals
pool.decimals,
),
},
}))
Expand All @@ -151,6 +151,6 @@ export function useBalancerPools(
},
{
revalidateOnFocus: false,
}
},
);
}
12 changes: 6 additions & 6 deletions packages/cow-hooks-ui/src/hooks/useBalancerUserPoolBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const POOL_QUERY = gql`
async function fetchUserPoolBalance(
chainId?: SupportedChainId,
poolId?: string,
user?: string
user?: string,
): Promise<IBalance[]> {
if (!user || !chainId || !poolId) return [];
const chainName = BalancerChainName[chainId];
Expand All @@ -86,11 +86,11 @@ async function fetchUserPoolBalance(
}
const userBpt = parseUnits(
result.pool.userBalance.walletBalance.toString(),
result.pool.decimals
result.pool.decimals,
);
const totalBpt = parseUnits(
result.pool.dynamicData.totalShares.toString(),
result.pool.decimals
result.pool.decimals,
);
return result.pool.poolTokens.map((token) => {
const balanceUSDTotal = parseUnits(token.balanceUSD.toString(), 18);
Expand All @@ -101,11 +101,11 @@ async function fetchUserPoolBalance(
token.address,
token.decimals,
token.symbol,
token.name
token.name,
),
balance: balanceTotal.mul(userBpt).div(totalBpt),
fiatAmount: Number(
formatUnits(balanceUSDTotal.mul(userBpt).div(totalBpt), 18)
formatUnits(balanceUSDTotal.mul(userBpt).div(totalBpt), 18),
),
weight: token.weight,
};
Expand All @@ -126,6 +126,6 @@ export function useBalancerUserPoolBalance({
() => fetchUserPoolBalance(chainId, poolId, user),
{
revalidateOnFocus: false,
}
},
);
}
4 changes: 2 additions & 2 deletions packages/cow-hooks-ui/src/hooks/useBalancerUserPools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export function useBalancerUserPools(poolType: "WEIGHTED" | "COW_AMM") {
protocolVersionIn,
},
context?.chainId,
"userbalanceUsd"
"userbalanceUsd",
);

const data = useSwrData.data?.filter((pool) =>
BigNumber.from(pool.userBalance.walletBalance).gt(BigNumber.from("10"))
BigNumber.from(pool.userBalance.walletBalance).gt(BigNumber.from("10")),
);

return { ...useSwrData, data };
Expand Down

0 comments on commit d560d67

Please sign in to comment.