forked from snapshot-labs/snapshot-spaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
35 lines (33 loc) · 821 Bytes
/
index.ts
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
// @ts-ignore
import requireContext from 'require-context';
const requireSpace = requireContext(`${__dirname}/spaces`, true, /[\w-]+\.json$/);
export default Object.fromEntries(
requireSpace
.keys()
.filter(
file =>
![
'domains.json',
'spotlight.json',
'example/index.json'
].includes(file)
)
.map(file => {
const space = requireSpace(file);
const key = file.replace('./', '').replace('/index.json', '');
const strategies = [
[
'erc20-balance-of',
{
address: space.token,
decimals: space.decimals,
symbol: space.symbol
}
]
];
return [
key,
{ ...space, key, strategies: space.strategies || strategies }
];
})
);