Skip to content
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

Merged
merged 3 commits into from
Jan 17, 2025
Merged

Hooks improvement #11

merged 3 commits into from
Jan 17, 2025

Conversation

ilamanov
Copy link
Contributor

@ilamanov ilamanov commented Jan 16, 2025

Added inline comments but mostly small optimizations, bug fixes

Copy link
Contributor Author

ilamanov commented Jan 16, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

This was referenced Jan 16, 2025
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";
Copy link
Contributor Author

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)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!

@@ -24,7 +25,7 @@ export const useTokenBalances = (
useEffect(() => {
if (!apiKey) return;
const fetchDataAsync = async () => {
if (!walletAddress) return;
if (!walletAddress || !isAddress(walletAddress)) return;
Copy link
Contributor Author

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

@@ -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;
Copy link
Contributor Author

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

@ilamanov ilamanov marked this pull request as ready for review January 16, 2025 18:52
@ilamanov ilamanov changed the base branch from 01-15-set_up_vitest_testing to graphite-base/11 January 17, 2025 18:42
@ilamanov ilamanov changed the base branch from graphite-base/11 to main January 17, 2025 18:43
@ilamanov ilamanov merged commit b5fbbb1 into main Jan 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants