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:
parent
86030ada03
commit
d1315e7912
@ -12,6 +12,7 @@ const apiUrl = import.meta.env.PUBLIC_WEB3_API_URL
|
|||||||
export function useFetchTokens(): SWRResponse<GetToken[] | undefined, Error> {
|
export function useFetchTokens(): SWRResponse<GetToken[] | undefined, Error> {
|
||||||
const chainId = useChainId()
|
const chainId = useChainId()
|
||||||
const { address } = useAccount()
|
const { address } = useAccount()
|
||||||
|
// const { chains } = useConfig()
|
||||||
|
|
||||||
const [url, setUrl] = useState<string | undefined>()
|
const [url, setUrl] = useState<string | undefined>()
|
||||||
|
|
||||||
@ -25,7 +26,8 @@ export function useFetchTokens(): SWRResponse<GetToken[] | undefined, Error> {
|
|||||||
return
|
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)
|
setUrl(url)
|
||||||
}, [address, chainId])
|
}, [address, chainId])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user