-
Notifications
You must be signed in to change notification settings - Fork 3
/
yieldscan.config.js
115 lines (111 loc) · 3.55 KB
/
yieldscan.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import { isNil } from "lodash";
export const networks = [
{
id: "polkadot-cc1",
name: "Polkadot",
network: "polkadot",
isTestNetwork: false,
denom: "DOT",
coinGeckoDenom: "polkadot",
decimalPlaces: 10,
feesAddress: isNil(process?.env?.NEXT_PUBLIC_POLKADOT_FEES_ADDRESS)
? false
: process?.env?.NEXT_PUBLIC_POLKADOT_FEES_ADDRESS,
feesEnabled: isNil(process?.env?.NEXT_PUBLIC_POLKADOT_FEES_ENABLED)
? false
: JSON.parse(process?.env?.NEXT_PUBLIC_POLKADOT_FEES_ENABLED),
feesRatio: isNil(process.env.NEXT_PUBLIC_POLKADOT_FEES_RATIO)
? 0
: JSON.parse(process.env.NEXT_PUBLIC_POLKADOT_FEES_RATIO),
lastDiscountDate: isNil(process?.env?.NEXT_PUBLIC_LAST_DISCOUNT_DATE)
? new Date("1 Jan 1990 00:00:00 UTC")
: new Date(process?.env?.NEXT_PUBLIC_LAST_DISCOUNT_DATE),
twitterUrl: "@Polkadot",
addressPrefix: 0,
nodeWs: process.env.NEXT_PUBLIC_POLKADOT,
erasPerDay: 1,
lockUpPeriod: 28,
reserveAmount: 1,
recommendedAdditionalAmount: 50,
about: "Polkadot is a heterogeneous multi‑chain technology.",
},
{
id: "kusama-cc3",
name: "Kusama",
network: "kusama",
isTestNetwork: false,
denom: "KSM",
feesAddress: isNil(process?.env?.NEXT_PUBLIC_KUSAMA_FEES_ADDRESS)
? false
: process.env.NEXT_PUBLIC_KUSAMA_FEES_ADDRESS,
feesEnabled: isNil(process?.env?.NEXT_PUBLIC_KUSAMA_FEES_ENABLED)
? false
: JSON.parse(process.env.NEXT_PUBLIC_KUSAMA_FEES_ENABLED),
feesRatio: isNil(process?.env?.NEXT_PUBLIC_KUSAMA_FEES_RATIO)
? 0
: JSON.parse(process.env.NEXT_PUBLIC_KUSAMA_FEES_RATIO),
lastDiscountDate: isNil(process?.env?.NEXT_PUBLIC_LAST_DISCOUNT_DATE)
? new Date("1 Jan 1990 00:00:00 UTC")
: new Date(process?.env?.NEXT_PUBLIC_LAST_DISCOUNT_DATE),
twitterUrl: "@kusamanetwork",
coinGeckoDenom: "kusama",
decimalPlaces: 12,
addressPrefix: 2,
nodeWs: process.env.NEXT_PUBLIC_KUSAMA,
erasPerDay: 4,
lockUpPeriod: 7,
reserveAmount: 0.01,
recommendedAdditionalAmount: 0.5,
about: "Kusama is an early, unaudited, and unrefined release of Polkadot.",
},
{
id: "westend",
name: "Westend",
network: "westend",
isTestNetwork: true,
denom: "WND",
feesAddress: isNil(process?.env?.NEXT_PUBLIC_WESTEND_FEES_ADDRESS)
? false
: process.env.NEXT_PUBLIC_WESTEND_FEES_ADDRESS,
feesEnabled: isNil(process?.env?.NEXT_PUBLIC_WESTEND_FEES_ENABLED)
? false
: JSON.parse(process.env.NEXT_PUBLIC_WESTEND_FEES_ENABLED),
feesRatio: isNil(process?.env?.NEXT_PUBLIC_WESTEND_FEES_RATIO)
? 0
: JSON.parse(process.env.NEXT_PUBLIC_WESTEND_FEES_RATIO),
lastDiscountDate: isNil(process?.env?.NEXT_PUBLIC_LAST_DISCOUNT_DATE)
? new Date("1 Jan 1990 00:00:00 UTC")
: new Date(process?.env?.NEXT_PUBLIC_LAST_DISCOUNT_DATE),
twitterUrl: "@westend",
coinGeckoDenom: undefined,
decimalPlaces: 12,
addressPrefix: 42,
nodeWs: process.env.NEXT_PUBLIC_WESTEND,
erasPerDay: 4,
lockUpPeriod: 7,
reserveAmount: 1,
recommendedAdditionalAmount: 0.5,
about: "Westend is one of the test networks for polkadot ecosystem.",
},
];
export const getNetworkInfo = (networkName) => {
return networks.find(({ name }) => name === networkName);
};
export const getAllNetworksInfo = () => {
const supportedNetworks = networks.filter(
(network) =>
JSON.parse(process.env.NEXT_PUBLIC_TESTNETS_ENABLED) ||
!network.isTestNetwork
);
return supportedNetworks;
};
export const getAllNetworks = () => {
const supportedNetworks = networks
.filter(
(network) =>
JSON.parse(process.env.NEXT_PUBLIC_TESTNETS_ENABLED) ||
!network.isTestNetwork
)
.map((network) => network.name);
return supportedNetworks;
};