From ffc3f99aea0ac1fc491e83b41bc751ee0383f323 Mon Sep 17 00:00:00 2001 From: Majorfi Date: Mon, 27 Nov 2023 12:43:30 +0100 Subject: [PATCH] fix: balance endpoint --- CHANGELOG.md | 6 ++++++ apps/vaults/contexts/useWalletForZaps.tsx | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 058e9ff72..16b240089 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.3.0 (x/12/2023) + +- Release the V3 vaults +- Release the multichain config +- Fix the zap balances fetching to use the multichain endpoint rather than the currently connected one + # 0.1.25 (28/08/2023) - Gauge voting for veYFI under the `gauge-voting` feature flag diff --git a/apps/vaults/contexts/useWalletForZaps.tsx b/apps/vaults/contexts/useWalletForZaps.tsx index 5d8820464..d2d0d39b6 100755 --- a/apps/vaults/contexts/useWalletForZaps.tsx +++ b/apps/vaults/contexts/useWalletForZaps.tsx @@ -2,7 +2,6 @@ import {createContext, memo, useCallback, useContext, useMemo, useState} from 'r import {useDeepCompareEffect} from '@react-hookz/web'; import {useUI} from '@yearn-finance/web-lib/contexts/useUI'; import {useWeb3} from '@yearn-finance/web-lib/contexts/useWeb3'; -import {useChainID} from '@yearn-finance/web-lib/hooks/useChainID'; import {isZeroAddress, toAddress, zeroAddress} from '@yearn-finance/web-lib/utils/address'; import {type TNormalizedBN, toNormalizedBN} from '@yearn-finance/web-lib/utils/format.bigNumber'; import {useWallet} from '@common/contexts/useWallet'; @@ -58,8 +57,7 @@ export const WalletForZapAppContextApp = memo(function WalletForZapAppContextApp }): ReactElement { const {address} = useWeb3(); const {refresh} = useWallet(); - const {safeChainID} = useChainID(); - const {yDaemonBaseUri} = useYDaemonBaseURI({chainID: safeChainID}); + const {yDaemonBaseUri: yDaemonBaseUriWithoutChain} = useYDaemonBaseURI(); const {onLoadStart, onLoadDone} = useUI(); const [zapTokens, set_zapTokens] = useState({}); @@ -67,7 +65,7 @@ export const WalletForZapAppContextApp = memo(function WalletForZapAppContextApp ** Fetching, for this user, the list of tokens available for zaps ***************************************************************************/ const {data: tokensList} = useFetch({ - endpoint: address ? `${yDaemonBaseUri}/tokenlistbalances/${address}` : null, + endpoint: address ? `${yDaemonBaseUriWithoutChain}/balances/${address}` : null, schema: yDaemonTokenListBalances });