-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: API & general documentation (#8)
* added open api collection * added postman collection * added swagger ui * updated the README
- Loading branch information
Showing
7 changed files
with
282 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions
124
docs/api/Token-Price-Oracle-Orchestrator.openapi_collection.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "Token-Price-Oracle-Orchestrator", | ||
"description": "Token Price Oracle is simple oracle for tracking token prices on-chain.\n\nThis is the documentatino of the API endpoints used for consuming the collected data", | ||
"version": "1.0.0", | ||
"contact": {} | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost" | ||
} | ||
], | ||
"paths": { | ||
"/api/v1/tickers": { | ||
"get": { | ||
"tags": [ | ||
"Tickers" | ||
], | ||
"summary": "Ticker List", | ||
"description": "Returns list of on-chain and off-chain price data of all the tickers available in the storage", | ||
"operationId": "tickerList", | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
}, | ||
"/api/v1/tickers/{tickerSymbol}": { | ||
"get": { | ||
"tags": [ | ||
"Tickers" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "tickerSymbol", | ||
"in": "path", | ||
"description": "Ticker of the asset", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"summary": "Ticker", | ||
"description": "Returns on-chain and off-chain price data of a given ticker.", | ||
"operationId": "ticker", | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
}, | ||
"/api/v1/tickers/{tickerSymbol}/history": { | ||
"get": { | ||
"tags": [ | ||
"Tickers" | ||
], | ||
"summary": "Ticker Historical prices", | ||
"description": "Returns the historical price data of a given ticker between the given Unix timestamps", | ||
"operationId": "tickerHistoricalPrices", | ||
"parameters": [ | ||
{ | ||
"name": "tickerSymbol", | ||
"in": "path", | ||
"description": "Ticker of the asset", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "from", | ||
"in": "query", | ||
"schema": { | ||
"type": "string", | ||
"example": "1702532251" | ||
} | ||
}, | ||
{ | ||
"name": "to", | ||
"in": "query", | ||
"schema": { | ||
"type": "string", | ||
"example": "1702632251" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
}, | ||
"/api/v1/reverts": { | ||
"get": { | ||
"tags": [ | ||
"Reverts" | ||
], | ||
"summary": "On-chain historical reverts", | ||
"description": "Returns all of the reverts that happened on-chain (regardless of the sender) for the price updating action on the TokenPriceStorage contract.", | ||
"operationId": "onChainHistoricalReverts", | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"tags": [ | ||
{ | ||
"name": "Tickers", | ||
"description": "All ticker data" | ||
}, | ||
{ | ||
"name": "Reverts", | ||
"description": "Historical reverts data" | ||
} | ||
] | ||
} |
118 changes: 118 additions & 0 deletions
118
docs/api/Token-Price-Oracle-Orchestrator.postman_collection.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "ba5c6c37-b93c-4d5b-8d4b-74bec4dd9dff", | ||
"name": "Token-Price-Oracle-Orchestrator", | ||
"description": "Token Price Oracle is simple oracle for tracking token prices on-chain.\n\nThis is the documentation of the API endpoints used for consuming the collected data", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", | ||
"_exporter_id": "16309767" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Ticker List", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3001/api/v1/tickers", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3001", | ||
"path": [ | ||
"api", | ||
"v1", | ||
"tickers" | ||
] | ||
}, | ||
"description": "Returns list of on-chain and off-chain price data of all the tickers available in the storage" | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Ticker", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3001/api/v1/tickers/{{tickerSymbol}}", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3001", | ||
"path": [ | ||
"api", | ||
"v1", | ||
"tickers", | ||
"{{tickerSymbol}}" | ||
] | ||
}, | ||
"description": "Returns on-chain and off-chain price data of a given ticker." | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Ticker Historical prices", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3001/api/v1/tickers/{{tickerSymbol}}/history?from=1702532251&to=1702632251", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3001", | ||
"path": [ | ||
"api", | ||
"v1", | ||
"tickers", | ||
"{{tickerSymbol}}", | ||
"history" | ||
], | ||
"query": [ | ||
{ | ||
"key": "from", | ||
"value": "1702532251" | ||
}, | ||
{ | ||
"key": "to", | ||
"value": "1702632251" | ||
} | ||
] | ||
}, | ||
"description": "Returns the historical price data of a given ticker between the given Unix timestamps" | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "On-chain historical reverts", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "http://localhost:3001/api/v1/reverts", | ||
"protocol": "http", | ||
"host": [ | ||
"localhost" | ||
], | ||
"port": "3001", | ||
"path": [ | ||
"api", | ||
"v1", | ||
"reverts" | ||
] | ||
}, | ||
"description": "Returns all of the reverts that happened on-chain (regardless of the sender) for the price updating action on the TokenPriceStorage contract." | ||
}, | ||
"response": [] | ||
} | ||
], | ||
"variable": [ | ||
{ | ||
"key": "tickerSymbol", | ||
"value": "ETH" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters