From fd17805e5c1863ef4cf02a64501aa2754e499f46 Mon Sep 17 00:00:00 2001 From: nawar-hisso Date: Tue, 10 Dec 2024 15:03:03 +0400 Subject: [PATCH] :bug: Fix Asset Amount Fetching --- .../packages/nextjs/hooks/custom/useFetchContractData.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spikes/spike-liquid-stone/packages/nextjs/hooks/custom/useFetchContractData.ts b/spikes/spike-liquid-stone/packages/nextjs/hooks/custom/useFetchContractData.ts index cd8d5ed3..9b077ba6 100644 --- a/spikes/spike-liquid-stone/packages/nextjs/hooks/custom/useFetchContractData.ts +++ b/spikes/spike-liquid-stone/packages/nextjs/hooks/custom/useFetchContractData.ts @@ -111,7 +111,14 @@ export const useFetchContractData = ({ setCurrentPeriod(_currentPeriod); const assetAmountData = await refetchAssetAmount(); - const assetAmountBigInt = BigInt(typeof assetAmountData?.data === "number" || typeof assetAmountData?.data === "string" ? assetAmountData.data : 0); + const assetAmountBigInt = BigInt( + typeof assetAmountData?.data === "number" || + typeof assetAmountData?.data === "string" || + typeof assetAmountData?.data === "bigint" + ? assetAmountData.data + : 0, + ); + setAssetAmount(ethers.formatUnits(assetAmountBigInt, 6)); const startTimeData = await refetchStartTime();