Closed whoabuddy closed 2 years ago
This PR contains a breaking change to set up the data structure for multiple versions of CityCoins contracts.
The structure allows enough flexibility that this should be the preferred format moving forward.
Any routes that involve querying a city now start with :version/:cityname instead of the route category.
:version/:cityname
/activation/get-activation-block/mia
/v1/mia/activation/get-activation-block
/mining/get-mining-stats-at-block/mia/57934
/v1/mia/mining/get-mining-stats-at-block/57934
/stacking/get-stacker-at-cycle/mia/15/1848
/v1/mia/stacking/get-stacker-at-cycle/15/1848
In the previous version the CityConfig object represented a single set of contracts. This refactors the code to allow for:
CityConfig
CityVersions
getCityConfig()
Merging this into develop to fit in a few bug fixes and new endpoints before the release!
develop
To test the new version, it will be available at https://citycoins-api.citycoins.workers.dev/
⚠️Breaking Change⚠️
This PR contains a breaking change to set up the data structure for multiple versions of CityCoins contracts.
The structure allows enough flexibility that this should be the preferred format moving forward.
What is changing?
Routes and Paths
Any routes that involve querying a city now start with
:version/:cityname
instead of the route category./activation/get-activation-block/mia
/v1/mia/activation/get-activation-block
/mining/get-mining-stats-at-block/mia/57934
/v1/mia/mining/get-mining-stats-at-block/57934
/stacking/get-stacker-at-cycle/mia/15/1848
/v1/mia/stacking/get-stacker-at-cycle/15/1848
CityConfig Definition
In the previous version the
CityConfig
object represented a single set of contracts. This refactors the code to allow for:CityVersions
objectCityConfig
per version, returned bygetCityConfig()
getCityConfig()
to pass the version parametergetCityConfig()
error handling to pass response if not foundWhat is left to do?
getCityConfig()