Skip to content

Smart contracts: get supported languages for filter from the API instead of ENV#3200

Merged
tom2drum merged 5 commits intomainfrom
tom2drum/issue-3158
Jan 5, 2026
Merged

Smart contracts: get supported languages for filter from the API instead of ENV#3200
tom2drum merged 5 commits intomainfrom
tom2drum/issue-3158

Conversation

@tom2drum
Copy link
Copy Markdown
Collaborator

Description and Related Issue(s)

Resolves #3158

This PR replaces the NEXT_PUBLIC_VIEWS_CONTRACT_LANGUAGE_FILTERS environment variable with a dynamic API-based approach. The verified contracts page language filter now fetches supported languages from the backend API (/api/v2/config/smart-contracts/languages) instead of relying on a static environment variable configuration.

Proposed Changes

  • Removed NEXT_PUBLIC_VIEWS_CONTRACT_LANGUAGE_FILTERS environment variable from ENVS.md and added it to DEPRECATED_ENVS.md
  • Added new API endpoint general:config_contract_languages to fetch contract languages from the backend
  • Updated VerifiedContractsFilter component to fetch languages dynamically from the API instead of using the ENV variable
  • Updated OpSuperchainVerifiedContracts component to remove the chain config dependency for language filters
  • Updated environment validator schemas to remove the deprecated variable
  • Updated Playwright tests to mock the new API endpoint

Environment Variables Changes

  • Removed NEXT_PUBLIC_VIEWS_CONTRACT_LANGUAGE_FILTERS: This variable previously allowed configuring which contract languages would appear as filter options on the verified contracts page. It has been replaced with configuration retrieved from the API endpoint /api/v2/config/smart-contracts/languages, making the language filter options dynamic and consistent with backend capabilities.

Breaking or Incompatible Changes

This change removes the NEXT_PUBLIC_VIEWS_CONTRACT_LANGUAGE_FILTERS environment variable. Users who were using this variable to customize the language filter options will need to configure the supported languages through the backend API instead. The filter will now automatically display all languages supported by the backend.

Additional Information

The implementation includes proper loading states and error handling for the API call. The filter component gracefully handles the API response and formats language names using the existing formatLanguageName utility function.

Checklist for PR author

  • I have tested these changes locally.
  • I added tests to cover any new functionality, following this guide
  • Whenever I fix a bug, I include a regression test to ensure that the bug does not reappear silently.
  • If I have added, changed, renamed, or removed an environment variable
    • I updated the list of environment variables in the documentation
    • I made the necessary changes to the validator script according to the guide
    • I added "ENVs" label to this pull request

@tom2drum tom2drum added the ENVs label Dec 23, 2025
@tom2drum tom2drum requested a review from isstuev December 23, 2025 16:57
@tom2drum tom2drum merged commit 4fc7050 into main Jan 5, 2026
11 checks passed
@tom2drum tom2drum deleted the tom2drum/issue-3158 branch January 5, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart contracts: get supported languages for filter from the API instead of ENV

2 participants