1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 01:46:51 +01:00

web3-api update

This commit is contained in:
Matthias Kretschmann 2024-03-14 11:53:03 +00:00
parent 86030ada03
commit d1315e7912
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -12,6 +12,7 @@ const apiUrl = import.meta.env.PUBLIC_WEB3_API_URL
export function useFetchTokens(): SWRResponse<GetToken[] | undefined, Error> {
const chainId = useChainId()
const { address } = useAccount()
// const { chains } = useConfig()
const [url, setUrl] = useState<string | undefined>()
@ -25,7 +26,8 @@ export function useFetchTokens(): SWRResponse<GetToken[] | undefined, Error> {
return
}
const url = `${apiUrl}/balance?address=${address}&chainId=${chainId}`
// const chainIds = chains.map((chain) => chain.id).join(',')
const url = `${apiUrl}/balance?address=${address}&chainIds=${chainId}`
setUrl(url)
}, [address, chainId])