mirror of
https://github.com/kremalicious/blog.git
synced 2024-10-08 00:33:12 +02:00
api url tweaks
This commit is contained in:
parent
67c4aa1ea2
commit
810b763b80
@ -4,4 +4,5 @@ PUBLIC_TYPEKIT_ID=xxx
|
||||
PUBLIC_UMAMI_SCRIPT_URL=xxx
|
||||
PUBLIC_UMAMI_WEBSITE_ID=xxx
|
||||
PUBLIC_INFURA_ID=xxx
|
||||
PUBLIC_WALLETCONNECT_ID="xxx"
|
||||
PUBLIC_WALLETCONNECT_ID="xxx"
|
||||
PUBLIC_WEB3_API_URL="xxx"
|
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -16,6 +16,7 @@ env:
|
||||
PUBLIC_UMAMI_WEBSITE_ID: ${{ secrets.GATSBY_UMAMI_WEBSITE_ID }}
|
||||
PUBLIC_INFURA_ID: ${{ secrets.GATSBY_INFURA_ID }}
|
||||
PUBLIC_WALLETCONNECT_ID: ${{ secrets.GATSBY_WALLETCONNECT_ID }}
|
||||
PUBLIC_WEB3_API_URL: ${{ secrets.PUBLIC_WEB3_API_URL }}
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
|
@ -6,6 +6,7 @@ import { $setTokens } from '@features/Web3/stores/tokens'
|
||||
import { $setSelectedToken } from '@features/Web3/stores/selectedToken'
|
||||
|
||||
const fetcher = (url: string) => fetch(url).then((res) => res.json())
|
||||
const apiUrl = import.meta.env.PUBLIC_WEB3_API_URL
|
||||
|
||||
//
|
||||
// Wrapper for fetching user tokens with swr.
|
||||
@ -24,7 +25,7 @@ export function useFetchTokens() {
|
||||
useEffect(() => {
|
||||
if (!address || !chain?.id) return
|
||||
|
||||
const url = `https://web3.kremalicious.com/api/balance?address=${address}&chainId=${chain?.id}`
|
||||
const url = `${apiUrl}/balance?address=${address}&chainId=${chain?.id}`
|
||||
setUrl(url)
|
||||
console.log('useFetchTokens', url)
|
||||
}, [address, chain?.id])
|
||||
|
Loading…
Reference in New Issue
Block a user