Skip to content

Commit

Permalink
Merge pull request #74 from citycoins/feat/add-circulating-supply
Browse files Browse the repository at this point in the history
Add circulating supply
  • Loading branch information
whoabuddy authored Aug 3, 2022
2 parents 13600d3 + 57f4f2d commit 3b92f5f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The API is divided into three main folders:
- (optional) add new types in `/types`
- add new handler file to top-level export in `/src/handlers`
- e.g. `export { default as GetDateAtBlock } from './stacks/getdateatblock'`
- add new handler file and route to `/src/handler.ts`
- add new handler file and route to `/src/index.ts`
- if querying city data, starts with: `:version/:cityname/`
- order of operations: `:blockheight > :cycleid > :userid > :address`
- add new endpoint to `/static/openapi.yml`
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ router
.get('/:version/:cityname/token/get-total-supply', Token.GetTotalSupply)
.get('/token/get-total-supply/:cityname', Token.GetFullTotalSupply) // legacy route for old API integrations
.get('/:cityname/token/get-total-supply', Token.GetFullTotalSupply)
.get('/:cityname/token/get-circulating-supply', Token.GetFullTotalSupply) // additional route for aggregate services
// Tools
.get('/tools/get-city-list', Tools.GetCityList)
.get('/:cityname/tools/get-city-info', Tools.GetCityInfo)
Expand Down
20 changes: 20 additions & 0 deletions static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,26 @@ paths:
"404":
$ref: '#/components/responses/404NotFound'

/{cityname}/token/get-circulating-supply:
get:
summary: Get Circulating Supply (all)
description: |
Get the SIP-010 circulating supply for a given CityCoin across all versions.
Note: This will return the value in "CityCoins" not "micro-CityCoins" with 6 decimal places added to the calculation.
tags:
- Token
parameters:
- $ref: '#/components/parameters/format'
- $ref: '#/components/parameters/cityname'
responses:
"200":
$ref: '#/components/responses/200SuccessJsonString'
"400":
$ref: '#/components/responses/400BadRequest'
"404":
$ref: '#/components/responses/404NotFound'

/{version}/{cityname}/token/get-token-uri:
get:
summary: Get Token URI
Expand Down

0 comments on commit 3b92f5f

Please sign in to comment.