Skip to content

Commit

Permalink
Rename: feed type -> feed category
Browse files Browse the repository at this point in the history
  • Loading branch information
adg-flare committed Mar 29, 2024
1 parent 6145653 commit 80caf3c
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 51 deletions.
66 changes: 33 additions & 33 deletions apps/example_provider/src/config/coston.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"feed": { "type": 1, "name": "FLR/USD" },
"feed": { "category": 1, "name": "FLR/USD" },
"sources": [
{
"exchange": "coinbasepro",
Expand All @@ -25,7 +25,7 @@
]
},
{
"feed": { "type": 1, "name": "SGB/USD" },
"feed": { "category": 1, "name": "SGB/USD" },
"sources": [
{
"exchange": "gate",
Expand All @@ -38,7 +38,7 @@
]
},
{
"feed": { "type": 1, "name": "XRP/USD" },
"feed": { "category": 1, "name": "XRP/USD" },
"sources": [
{
"exchange": "bitget",
Expand Down Expand Up @@ -75,7 +75,7 @@
]
},
{
"feed": { "type": 1, "name": "LTC/USD" },
"feed": { "category": 1, "name": "LTC/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -112,7 +112,7 @@
]
},
{
"feed": { "type": 1, "name": "XLM/USD" },
"feed": { "category": 1, "name": "XLM/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -153,7 +153,7 @@
]
},
{
"feed": { "type": 1, "name": "DOGE/USD" },
"feed": { "category": 1, "name": "DOGE/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -195,7 +195,7 @@
]
},
{
"feed": { "type": 1, "name": "ADA/USD" },
"feed": { "category": 1, "name": "ADA/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -237,7 +237,7 @@
]
},
{
"feed": { "type": 1, "name": "ALGO/USD" },
"feed": { "category": 1, "name": "ALGO/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -271,7 +271,7 @@
]
},
{
"feed": { "type": 1, "name": "BTC/USD" },
"feed": { "category": 1, "name": "BTC/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -312,7 +312,7 @@
]
},
{
"feed": { "type": 1, "name": "ETH/USD" },
"feed": { "category": 1, "name": "ETH/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -353,7 +353,7 @@
]
},
{
"feed": { "type": 1, "name": "FIL/USD" },
"feed": { "category": 1, "name": "FIL/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -390,7 +390,7 @@
]
},
{
"feed": { "type": 1, "name": "ARB/USD" },
"feed": { "category": 1, "name": "ARB/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -427,7 +427,7 @@
]
},
{
"feed": { "type": 1, "name": "AVAX/USD" },
"feed": { "category": 1, "name": "AVAX/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -468,7 +468,7 @@
]
},
{
"feed": { "type": 1, "name": "BNB/USD" },
"feed": { "category": 1, "name": "BNB/USD" },
"sources": [
{
"exchange": "binance",
Expand All @@ -493,7 +493,7 @@
]
},
{
"feed": { "type": 1, "name": "MATIC/USD" },
"feed": { "category": 1, "name": "MATIC/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -530,7 +530,7 @@
]
},
{
"feed": { "type": 1, "name": "SOL/USD" },
"feed": { "category": 1, "name": "SOL/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -571,7 +571,7 @@
]
},
{
"feed": { "type": 1, "name": "USDC/USD" },
"feed": { "category": 1, "name": "USDC/USD" },
"sources": [
{
"exchange": "binance",
Expand All @@ -596,7 +596,7 @@
]
},
{
"feed": { "type": 1, "name": "USDT/USD" },
"feed": { "category": 1, "name": "USDT/USD" },
"sources": [
{
"exchange": "coinbasepro",
Expand All @@ -605,7 +605,7 @@
]
},
{
"feed": { "type": 1, "name": "XDC/USD" },
"feed": { "category": 1, "name": "XDC/USD" },
"sources": [
{
"exchange": "bitget",
Expand All @@ -622,7 +622,7 @@
]
},
{
"feed": { "type": 1, "name": "TRX/USD" },
"feed": { "category": 1, "name": "TRX/USD" },
"sources": [
{
"exchange": "binance",
Expand All @@ -647,7 +647,7 @@
]
},
{
"feed": { "type": 1, "name": "DOT/USD" },
"feed": { "category": 1, "name": "DOT/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -688,7 +688,7 @@
]
},
{
"feed": { "type": 1, "name": "LINK/USD" },
"feed": { "category": 1, "name": "LINK/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -729,7 +729,7 @@
]
},
{
"feed": { "type": 1, "name": "TON/USD" },
"feed": { "category": 1, "name": "TON/USD" },
"sources": [
{
"exchange": "gate",
Expand All @@ -746,7 +746,7 @@
]
},
{
"feed": { "type": 1, "name": "ICP/USD" },
"feed": { "category": 1, "name": "ICP/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -787,7 +787,7 @@
]
},
{
"feed": { "type": 1, "name": "SHIB/USD" },
"feed": { "category": 1, "name": "SHIB/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -828,7 +828,7 @@
]
},
{
"feed": { "type": 1, "name": "DAI/USD" },
"feed": { "category": 1, "name": "DAI/USD" },
"sources": [
{
"exchange": "bitget",
Expand Down Expand Up @@ -857,7 +857,7 @@
]
},
{
"feed": { "type": 1, "name": "BCH/USD" },
"feed": { "category": 1, "name": "BCH/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -894,7 +894,7 @@
]
},
{
"feed": { "type": 1, "name": "ATOM/USD" },
"feed": { "category": 1, "name": "ATOM/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -935,7 +935,7 @@
]
},
{
"feed": { "type": 1, "name": "UNI/USD" },
"feed": { "category": 1, "name": "UNI/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -972,7 +972,7 @@
]
},
{
"feed": { "type": 1, "name": "LEO/USD" },
"feed": { "category": 1, "name": "LEO/USD" },
"sources": [
{
"exchange": "gate",
Expand All @@ -985,7 +985,7 @@
]
},
{
"feed": { "type": 1, "name": "ETC/USD" },
"feed": { "category": 1, "name": "ETC/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -1022,7 +1022,7 @@
]
},
{
"feed": { "type": 1, "name": "INJ/USD" },
"feed": { "category": 1, "name": "INJ/USD" },
"sources": [
{
"exchange": "binance",
Expand Down Expand Up @@ -1059,7 +1059,7 @@
]
},
{
"feed": { "type": 2, "name": "EUR/USD" },
"feed": { "category": 2, "name": "EUR/USD" },
"sources": [
{
"exchange": "binance",
Expand Down
6 changes: 3 additions & 3 deletions apps/example_provider/src/config/local.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"feed": { "type": 1, "name": "BTC/USD" },
"feed": { "category": 1, "name": "BTC/USD" },
"sources": [
{
"exchange": "binance",
Expand All @@ -17,7 +17,7 @@
]
},
{
"feed": { "type": 1, "name": "ETH/USD" },
"feed": { "category": 1, "name": "ETH/USD" },
"sources": [
{
"exchange": "binance",
Expand All @@ -35,7 +35,7 @@
},

{
"feed": { "type": 1, "name": "USDT/USD" },
"feed": { "category": 1, "name": "USDT/USD" },
"sources": [
{
"exchange": "coinbasepro",
Expand Down
6 changes: 3 additions & 3 deletions apps/example_provider/src/data-feeds/ccxt-provider-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { networks } from "../../../../libs/ftso-core/src/configs/networks";
import { retry } from "../../../../libs/ftso-core/src/utils/retry";
import { FeedId, FeedValueData } from "../dto/provider-requests.dto";
import { BaseDataFeed } from "./base-feed";
import { FeedType } from "../../../../libs/ftso-core/src/voting-types";
import { FeedCategory } from "../../../../libs/ftso-core/src/voting-types";

export const CCXT_FALLBACK_VALUE = 0.01;
const CONFIG_PREFIX = "apps/example_provider/src/config/";
Expand All @@ -25,7 +25,7 @@ interface PriceInfo {
exchange: string;
}

const usdtToUsdFeedId: FeedId = { type: FeedType.Crypto.valueOf(), name: "USDT/USD" };
const usdtToUsdFeedId: FeedId = { category: FeedCategory.Crypto.valueOf(), name: "USDT/USD" };

export class CcxtFeed implements BaseDataFeed {
private readonly logger = new Logger(CcxtFeed.name);
Expand Down Expand Up @@ -212,5 +212,5 @@ export class CcxtFeed implements BaseDataFeed {
}

function feedsEqual(a: FeedId, b: FeedId): boolean {
return a.type === b.type && a.name === b.name;
return a.category === b.category && a.name === b.name;
}
2 changes: 1 addition & 1 deletion apps/example_provider/src/dto/provider-requests.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export class FeedId {
type: number;
category: number;
name: string;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/ftso-data-provider/src/docs/feed-provider-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Where `FeedId` is defined as:

```json
{
type: number,
category: number,
name: string
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"operationId": "getFeedValue",
"parameters": [
{ "name": "votingRoundId", "required": true, "in": "path", "schema": { "type": "number" } },
{ "required": true, "name": "type", "in": "query", "schema": { "type": "number" } },
{ "required": true, "name": "category", "in": "query", "schema": { "type": "number" } },
{ "required": true, "name": "name", "in": "query", "schema": { "type": "string" } }
],
"responses": {
Expand All @@ -48,8 +48,8 @@
"schemas": {
"FeedId": {
"type": "object",
"properties": { "type": { "type": "number" }, "name": { "type": "string" } },
"required": ["type", "name"]
"properties": { "category": { "type": "number" }, "name": { "type": "string" } },
"required": ["category", "name"]
},
"FeedValuesRequest": {
"type": "object",
Expand Down
Loading

0 comments on commit 80caf3c

Please sign in to comment.