diff --git a/script/generic/tag-values.ts b/script/generic/tag-values.ts index e06cfa246..23e7f1bb3 100644 --- a/script/generic/tag-values.ts +++ b/script/generic/tag-values.ts @@ -1,16 +1,16 @@ import { readJsonFile } from "../generic/json"; - -const tags: any = readJsonFile("script/tags.json") as any; +import { TagValues } from "../tags-config"; export function isValidTagValue(value: string): boolean { //console.log(`isValidTagValue ${value}`); if (!value) { return false; } - if (!(value in tags)) { + const tag = TagValues.find(t => t.id === value); + if (!tag) { return false; } - //console.log(`TAG ${tags[value]['name']}`); + //console.log(`TAG ${tag.name}`); return true; } diff --git a/script/tags-config.ts b/script/tags-config.ts new file mode 100644 index 000000000..1f614e88a --- /dev/null +++ b/script/tags-config.ts @@ -0,0 +1,53 @@ +export interface TagDescription { + id: string; + name: string; + description: string; +} + +export const TagValues: TagDescription[] = [ + { + id: "stablecoin", + name: "Stablecoin", + description: "Tokens that are fixed to an external asset, e.g. the US dollar." + }, + { + id: "wrapped", + name: "Wrapped", + description: "Tokens that are wrapped or peg representation of digital assets. Excluded stablecoins" + }, + { + id: "synthetics", + name: "Synthetics", + description: "Synthetic assets created to track the value of another asset" + }, + { + id: "nft", + name: "NFT", + description: "Non-fungible tokens or tokens associated with the NFT ecosystem." + }, + { + id: "governance", + name: "Governance", + description: "Tokens that used to participate in the governance process of the project." + }, + { + id: "defi", + name: "DeFi", + description: "Tokens that are used for variety of decentralized financial applications." + }, + { + id: "staking", + name: "Staking", + description: "Tokens that are used for staking to receive rewards." + }, + { + id: "staking-native", + name: "Staking Native", + description: "Coins/Blockchains that are used for staking to secure the network to receive rewards." + }, + { + id: "privacy", + name: "Privacy", + description: "Privacy tokens." + }, +]; diff --git a/script/tags.json b/script/tags.json deleted file mode 100644 index fb8e8ec86..000000000 --- a/script/tags.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "stablecoin": { - "name": "Stablecoin", - "description": "Tokens that are fixed to an external asset, e.g. the US dollar." - }, - "wrapped": { - "name": "Wrapped", - "description": "Tokens that are wrapped or peg representation of digital assets. Excluded stablecoins" - }, - "synthetics": { - "name": "Synthetics", - "description": "Synthetic assets created to track the value of another asset" - }, - "nft": { - "name": "NFT", - "description": "Non-fungible tokens or tokens associated with the NFT ecosystem." - }, - "governance": { - "name": "Governance", - "description": "Tokens that used to participate in the governance process of the project." - }, - "defi": { - "name": "DeFi", - "description": "Tokens that are used for variety of decentralized financial applications." - }, - "staking": { - "name": "Staking", - "description": "Tokens that are used for staking to receive rewards." - }, - "staking-native": { - "name": "Staking Native", - "description": "Coins/Blockchains that are used for staking to secure the network to receive rewards." - }, - "privacy": { - "name": "Privacy", - "description": "Privacy tokens." - } -}