Skip to content

Commit

Permalink
fix: add supplies endpoint vs stats
Browse files Browse the repository at this point in the history
  • Loading branch information
robcxyz committed Nov 1, 2023
1 parent 3d57ea7 commit b4025d5
Show file tree
Hide file tree
Showing 5 changed files with 373 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func Start() *fiber.App {
rest.LogsAddHandlers(app)
rest.AddressesAddHandlers(app)
rest.StatsAddHandlers(app)
rest.SuppliesAddHandlers(app)
ws.WebsocketsAddHandlers(app)

go app.Listen(":" + config.Config.APIPort)
Expand Down
109 changes: 109 additions & 0 deletions src/api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,115 @@ const docTemplate_swagger = `{
}
}
},
"/api/v1/supplies": {
"get": {
"description": "get json with a summary of stats",
"consumes": [
"*/*"
],
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/supplies/circulating-supply": {
"get": {
"description": "get circulating supply (total supply - burn wallet balance)",
"consumes": [
"*/*"
],
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "number"
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/supplies/market-cap": {
"get": {
"description": "get mkt cap (Coin Gecko Price * circulating supply)",
"consumes": [
"*/*"
],
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "number"
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/supplies/total-supply": {
"get": {
"description": "get total supply",
"consumes": [
"*/*"
],
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "number"
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/transactions": {
"get": {
"description": "get historical transactions",
Expand Down
109 changes: 109 additions & 0 deletions src/api/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,115 @@
}
}
},
"/api/v1/supplies": {
"get": {
"description": "get json with a summary of stats",
"consumes": [
"*/*"
],
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/supplies/circulating-supply": {
"get": {
"description": "get circulating supply (total supply - burn wallet balance)",
"consumes": [
"*/*"
],
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "number"
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/supplies/market-cap": {
"get": {
"description": "get mkt cap (Coin Gecko Price * circulating supply)",
"consumes": [
"*/*"
],
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "number"
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/supplies/total-supply": {
"get": {
"description": "get total supply",
"consumes": [
"*/*"
],
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "number"
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/transactions": {
"get": {
"description": "get historical transactions",
Expand Down
73 changes: 73 additions & 0 deletions src/api/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,79 @@ paths:
summary: Get Stats
tags:
- Stats
/api/v1/supplies:
get:
consumes:
- '*/*'
description: get json with a summary of stats
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"422":
description: Unprocessable Entity
schema:
additionalProperties: true
type: object
summary: Get Supplies
tags:
- Supplies
/api/v1/supplies/circulating-supply:
get:
consumes:
- '*/*'
description: get circulating supply (total supply - burn wallet balance)
responses:
"200":
description: OK
schema:
type: number
"422":
description: Unprocessable Entity
schema:
additionalProperties: true
type: object
summary: Get Supplies
tags:
- Supplies
/api/v1/supplies/market-cap:
get:
consumes:
- '*/*'
description: get mkt cap (Coin Gecko Price * circulating supply)
responses:
"200":
description: OK
schema:
type: number
"422":
description: Unprocessable Entity
schema:
additionalProperties: true
type: object
summary: Get Supplies
tags:
- Supplies
/api/v1/supplies/total-supply:
get:
consumes:
- '*/*'
description: get total supply
responses:
"200":
description: OK
schema:
type: number
"422":
description: Unprocessable Entity
schema:
additionalProperties: true
type: object
summary: Get Supplies
tags:
- Supplies
/api/v1/transactions:
get:
consumes:
Expand Down
Loading

0 comments on commit b4025d5

Please sign in to comment.