1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-23 18:32:49 +01:00

api url tweaks

This commit is contained in:
Matthias Kretschmann 2023-11-01 22:25:33 +00:00
parent 67c4aa1ea2
commit 810b763b80
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 5 additions and 2 deletions

View File

@ -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"

View File

@ -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:

View File

@ -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])