Skip to content

Commit

Permalink
remove unused useRedemptionStatusV2
Browse files Browse the repository at this point in the history
  • Loading branch information
shan-57blocks committed Dec 31, 2024
1 parent f94b94b commit 772a8c7
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions packages/huma-web-shared/src/hooks/usePoolV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
getDueDetailV2,
getPoolUnderlyingTokenBalanceV2,
getPoolUnderlyingTokenInfoV2,
getTrancheRedemptionStatusV2,
isChainEnum,
POOL_ABI_V2,
POOL_CONFIG_V2_ABI,
Expand Down Expand Up @@ -637,50 +636,6 @@ export function useCancellableRedemptionInfoV2(
return [redemptionInfo, refresh]
}

type RedemptionStatus = {
numSharesRequested: string
withdrawableAssets: string
cancellableRedemptionShares: string
cancellableRedemptionAssets: string
}

export function useRedemptionStatusV2(
poolName: POOL_NAME,
trancheType: TrancheType,
account: string | undefined,
provider: JsonRpcProvider | Web3Provider | undefined,
): [RedemptionStatus | undefined, () => void] {
const [redemptionStatus, setRedemptionStatus] = useState<RedemptionStatus>()
const [refreshCount, refresh] = useForceRefresh()

useEffect(() => {
if (account) {
const fetchData = async () => {
const redemptionStatus = await getTrancheRedemptionStatusV2(
poolName,
trancheType,
account,
provider,
)
if (redemptionStatus) {
setRedemptionStatus({
numSharesRequested:
redemptionStatus.lenderRedemptionRecords.numSharesRequested.toString(),
withdrawableAssets: redemptionStatus.withdrawableAssets.toString(),
cancellableRedemptionShares:
redemptionStatus.cancellableRedemptionShares.toString(),
cancellableRedemptionAssets:
redemptionStatus.cancellableRedemptionAssets.toString(),
})
}
}
fetchData()
}
}, [account, poolName, provider, trancheType, refreshCount])

return [redemptionStatus, refresh]
}

export function useCreditStatsV2(
poolName: POOL_NAME,
account: string | undefined,
Expand Down

0 comments on commit 772a8c7

Please sign in to comment.