citycoins / api

A simple API to interact with Stacks and CityCoins data.
https://api.citycoins.co/docs
Apache License 2.0
9 stars 2 forks source link

BREAKING CHANGE: Add contract versioning #55

Closed whoabuddy closed 2 years ago

whoabuddy commented 2 years ago

⚠️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.

Before After
/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:

What is left to do?

whoabuddy commented 2 years ago

Merging this into develop to fit in a few bug fixes and new endpoints before the release!

To test the new version, it will be available at https://citycoins-api.citycoins.workers.dev/