-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hooks improvement #11
Conversation
src/duneApi.ts
Outdated
@@ -5,9 +5,9 @@ import { | |||
TransactionsParams, | |||
} from "./types"; | |||
|
|||
const BALANCE_API_BASE_URL = "https://api.dune.com/api/echo/v1/balances/evm/"; | |||
const BALANCE_API_BASE_URL = "https://api.dune.com/api/echo/v1/balances/evm"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having these slashes here means we have a double slash in the api url (see below in this file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!
src/useTokenBalances.ts
Outdated
@@ -24,7 +25,7 @@ export const useTokenBalances = ( | |||
useEffect(() => { | |||
if (!apiKey) return; | |||
const fetchDataAsync = async () => { | |||
if (!walletAddress) return; | |||
if (!walletAddress || !isAddress(walletAddress)) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small optimization - we don't need to run this when the address is invalid
src/useTransactions.ts
Outdated
@@ -29,7 +30,7 @@ export const useTransactions = ( | |||
|
|||
// Function to fetch data for a specific page | |||
const fetchDataAsync = async (offset: string | null) => { | |||
if (!walletAddress) return; | |||
if (!apiKey || !walletAddress || !isAddress(walletAddress)) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small optimization - we don't need to run this when the address is invalid or the api key is missing
Added inline comments but mostly small optimizations, bug fixes