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 Zerion Balances provider #1096

Merged
merged 11 commits into from
Feb 5, 2024
Merged

Conversation

hectorgomezv
Copy link
Member

@hectorgomezv hectorgomezv commented Jan 31, 2024

Summary

This PR adds a new Ethereum address balance provider (Zerion). This provider is disabled by default. To use this provider on a specific chain, the chain ID should be included in the feature flag environment variable FF_ZERION_BALANCES_CHAIN_IDS.

This PR also reuses the concept of BalancesApiManager. This class acts as a common router/façade for the available balance providers.

Changes

  • Three new environment variables are introduced:
    • ZERION_BASE_URI: contains the base URI for the Zerion API. Has a default value in the configuration.
    • ZERION_API_KEY: contains the API key for the Zerion API. Defaults to undefined. This is done on purpose as it shouldn't be needed to provide an API key for each potential provider the CGW uses (moreover considering the provider could be not managing any chain at a given point in time).
    • FF_ZERION_BALANCES_CHAIN_IDS: as stated above, this manages the chains that are associated with the Zerion API for balance retrieval. The expected values are comma-separated numbers (e.g.: 1,100,137)
  • Zerion-specific configuration is added to configuration.ts under the key balances.providers.zerion.
  • Zerion-specific entities, and ZerionBalancesApi (with tests) have been added.
  • BalancesController tests have been extended to test the new integration.

Out of scope

  • GET /v1/balances/supported-fiat-codes endpoint adjustments will be done in a separate PR.

@hectorgomezv hectorgomezv self-assigned this Jan 31, 2024
@hectorgomezv hectorgomezv marked this pull request as ready for review February 1, 2024 15:22
@hectorgomezv hectorgomezv requested a review from a team as a code owner February 1, 2024 15:22
@fmrsabino fmrsabino added the in review Someone is reviewing this Pull Request label Feb 2, 2024
@fmrsabino fmrsabino removed the in review Someone is reviewing this Pull Request label Feb 2, 2024
Copy link
Contributor

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

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

👏

….entity.builder.ts

Co-authored-by: Aaron Cook <aaron@safe.global>
@hectorgomezv hectorgomezv merged commit 0c61711 into main Feb 5, 2024
16 checks passed
@hectorgomezv hectorgomezv deleted the add-zerion-balances-provider branch February 5, 2024 10:55
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.

None yet

3 participants