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

Add API key dialog to DashboardControls #4

Merged
merged 1 commit into from
Jan 4, 2025
Merged

Conversation

rhochmayr
Copy link
Owner

Add functionality for users to input and save their API key for querying api-sepolia.arbiscan.io.

  • DashboardControls Component:

    • Add a button to open a dialog for entering the API key.
    • Add state variables to manage the API key input.
    • Use useEffect to load the API key from local storage on component mount.
    • Add a Dialog component to enter and save the API key.
    • Use toast notification to provide feedback when the API key is saved.
  • Transactions API:

    • Modify the fetchWalletTransactions function to include the user-provided API key in the query.
    • Add a parameter for the API key to the fetchWalletTransactions function.
  • Wallet Data Hook:

    • Add a parameter for the API key to the useWalletData hook.
    • Pass the API key to the fetchWalletTransactions function when calling it.
    • Update the addWallet function to include the API key parameter.
  • Storage Constants:

    • Add a new key for storing the API key in local storage.
  • App Component:

    • Add a state variable to manage the API key.
    • Pass the API key and its setter function to the DashboardControls component.

Add functionality for users to input and save their API key for querying `api-sepolia.arbiscan.io`.

* **DashboardControls Component**:
  - Add a button to open a dialog for entering the API key.
  - Add state variables to manage the API key input.
  - Use `useEffect` to load the API key from local storage on component mount.
  - Add a Dialog component to enter and save the API key.
  - Use toast notification to provide feedback when the API key is saved.

* **Transactions API**:
  - Modify the `fetchWalletTransactions` function to include the user-provided API key in the query.
  - Add a parameter for the API key to the `fetchWalletTransactions` function.

* **Wallet Data Hook**:
  - Add a parameter for the API key to the `useWalletData` hook.
  - Pass the API key to the `fetchWalletTransactions` function when calling it.
  - Update the `addWallet` function to include the API key parameter.

* **Storage Constants**:
  - Add a new key for storing the API key in local storage.

* **App Component**:
  - Add a state variable to manage the API key.
  - Pass the API key and its setter function to the `DashboardControls` component.
@rhochmayr rhochmayr merged commit 27bab1c into main Jan 4, 2025
2 checks passed
@rhochmayr rhochmayr deleted the add-api-key-dialog branch January 4, 2025 16:46
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.

1 participant