-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.js
69 lines (61 loc) · 1.22 KB
/
index.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
/**
* Known coins
*/
import coins from './coins.json';
/**
* Known pools
*/
import pools from './pools.json';
/**
* Known staking pools
*/
import staking from './staking.json';
const networks = {
/**
* Aptos Mainnet Chain Id
*/
mainnet: 1,
/**
* Aptos Testnet Chain Id
*/
testnet: 2,
/**
* L2 Chain Id
*/
l2: 5,
};
/**
* Main Coins Registry Entry
*/
const coinsRegistry = {
coins,
pools,
staking,
/**
* Get coins list for passed chain name
*
* @param {'mainnet'|'testnet'|'l2'} networkName Name of the chain
* @returns Array<Object>
*/
getCoinsFor: networkName =>
coins.filter(coin => coin.chainId === networks[networkName]),
/**
* Get swap pools list for passed chain name
*
* @param {'mainnet'|'testnet'|'l2'} networkName Name of the chain
* @returns Array<Object>
*/
getPoolsFor: networkName =>
pools.filter(pool => pool.networkId === networks[networkName]),
/**
* Get staking pools list for passed chain name
*
* @param {'mainnet'|'testnet'|'l2'} networkName Name of the chain
* @returns Array<Object>
*/
getStakingPoolsFor: networkName =>
staking.filter(
stakingPool => stakingPool.pool.networkId === networks[networkName],
),
};
export default coinsRegistry;