safe-client-gateway icon indicating copy to clipboard operation
safe-client-gateway copied to clipboard

Get prices provider configuration from Safe Config Service

Open hectorgomezv opened this issue 9 months ago • 1 comments

Summary

This PR changes the source for the Prices Provider (currently CoinGecko) configuration from the CGW hardcoded (configuration.ts) one, by the Chain entity coming from the Safe Config Service.

In this first iteration, the hardcoded configuration (configuration.ts) is kept as a fallback. If the Prices Provider configuration data is not present in the Config Service response, then the fallback data is used.

For more context see the Config Service PR: https://github.com/safe-global/safe-config-service/pull/1124

Changes

  • Changes the primary source for both nativeCoinId and chainName properties in CoingeckoApi to the Chain entity passed.
  • Changes several interfaces accordingly to pass the whole Chain entity (holding the needed configuration) instead of passing the chainId property only.
  • Adds the prices provider configuration fields to the Chain entity/schema.
  • Modifies the affected test classes.

hectorgomezv avatar May 09 '24 15:05 hectorgomezv

Pull Request Test Coverage Report for Build 9064785142

Details

  • 14 of 14 (100.0%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 93.003%

Totals Coverage Status
Change from base Build 9002495810: 0.06%
Covered Lines: 7001
Relevant Lines: 7252

💛 - Coveralls

coveralls avatar May 09 '24 15:05 coveralls

I've added some changes to adapt the PR to the modified pricesProvider field structure (see https://github.com/safe-global/safe-config-service/pull/1124)

hectorgomezv avatar May 13 '24 14:05 hectorgomezv