-
Notifications
You must be signed in to change notification settings - Fork 19
✨ New endpoints, Safe API Key and add new Safe version #68
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
Conversation
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.
Pull Request Overview
This PR updates the application to support new Safe API endpoints, introduces Safe API key authentication for improved request reliability, and adds support for Safe version 1.5.0. The changes modernize the API integration and enhance security through proper authentication while maintaining backward compatibility.
- Centralizes API endpoint configuration and adds new canonical contract addresses for Safe v1.5.0
- Implements Safe API key authentication with automatic rate limiting when no key is provided
- Updates to use the latest v2 Safe Transaction Service API endpoints
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
.env.example | Added SAFE_API_KEY environment variable template |
app/constants.ts | Centralized API configuration with BASE_URL constant and added apiUrl field to networks |
components/result/trusted-addresses.tsx | Added Safe v1.5.0 canonical contract addresses |
components/transaction/ApiInputFields.tsx | Modified network selection to only show networks with valid API URLs |
lib/utils.ts | Removed redundant API_URLS object and isValidNetwork function |
utils/api.ts | Implemented API key authentication and updated to v2 endpoints with rate limiting |
safe_hashes.sh | Removed entire bash script file |
app/api/calculate-hashes/route.ts | Removed API route that used the bash script |
README.md | Updated documentation for new API key feature and removed bash script references |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
LGTM! Great job @ferrabled
Description
This PR introduces support for the latest Safe API endpoints, adds the ability to use a Safe API key for more reliable requests, and includes compatibility for Safe version 1.5.0.
0g
,monad
andplasma
networks have also been added.Motivation
Previously, our application relied on older Safe API endpoints that were becoming deprecated. This PR updates our API integrations to the new endpoints, preventing future failures. Additionally, it introduces the ability to use a Safe API key to avoid rate-limiting issues and reorganizes network configurations for better scalability.
Changes
.env.example
app/constants.ts
components/result/trusted-addresses.tsx
components/transaction/ApiInputFields.tsx
apiUrl
defined. This ensures that users can only select networks that are compatible with the API-based calculation method.lib/utils.ts
apiUrl
field within the NETWORKS constant.utils/api.ts
apiUrl
for each network.Issues