mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
[Internal] Tag values config in typed file (#6016)
* Tag values config in typed file. * Lint fix Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
This commit is contained in:
parent
ee8d3c8e4f
commit
6b22d924be
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
53
script/tags-config.ts
Normal file
53
script/tags-config.ts
Normal file
|
@ -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."
|
||||
},
|
||||
];
|
|
@ -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."
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user