@tokemak/config 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +74 -0
- package/dist/index.js +215 -0
- package/package.json +25 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
|
|
3
|
+
declare const SupportedNetworks: Record<string, number>;
|
|
4
|
+
type SupportedNetworkNames = keyof typeof SupportedNetworks;
|
|
5
|
+
type SupportedChainIds = (typeof SupportedNetworks)[keyof typeof SupportedNetworks];
|
|
6
|
+
type SupportedNetwork = {
|
|
7
|
+
name: SupportedNetworkNames;
|
|
8
|
+
chainId: SupportedChainIds;
|
|
9
|
+
};
|
|
10
|
+
type SupportedNetworkNamesLowercased = Lowercase<SupportedNetworkNames>;
|
|
11
|
+
|
|
12
|
+
interface CoreNetworkConfig {
|
|
13
|
+
name: SupportedNetwork["name"];
|
|
14
|
+
shortName: string;
|
|
15
|
+
id: SupportedNetwork["chainId"];
|
|
16
|
+
systemRegistry: Address;
|
|
17
|
+
weth: Address;
|
|
18
|
+
toke: Address;
|
|
19
|
+
lens: Address;
|
|
20
|
+
stoke: Address;
|
|
21
|
+
stokeVote: Address;
|
|
22
|
+
stokeExtend: Address;
|
|
23
|
+
testnet?: boolean;
|
|
24
|
+
explorerUrl: string;
|
|
25
|
+
subgraphEndpoint: string;
|
|
26
|
+
}
|
|
27
|
+
interface MainnetNetworkConfig extends CoreNetworkConfig {
|
|
28
|
+
autoEthGuardedRewards: Address;
|
|
29
|
+
accTokeV1: Address;
|
|
30
|
+
missedTokeRewards: Address;
|
|
31
|
+
accTokeV1Rewards: Address;
|
|
32
|
+
accTokeV1RewardsHash: Address;
|
|
33
|
+
autoETHRewardsHash: Address;
|
|
34
|
+
stokeRewards: Address;
|
|
35
|
+
stokeRewardsHash: Address;
|
|
36
|
+
managerV1: Address;
|
|
37
|
+
stakingV1: Address;
|
|
38
|
+
rewardsV1: Address;
|
|
39
|
+
rewardsV1Hash: Address;
|
|
40
|
+
rewardsV1Url: string;
|
|
41
|
+
sushiPool: Address;
|
|
42
|
+
sushiPoolReactor: Address;
|
|
43
|
+
lpRewardsV1Url: string;
|
|
44
|
+
tSushiLP: Address;
|
|
45
|
+
curveRewardsUrl: string;
|
|
46
|
+
curvePool: Address;
|
|
47
|
+
convexRewarder: Address;
|
|
48
|
+
}
|
|
49
|
+
type NetworkConfig = MainnetNetworkConfig | CoreNetworkConfig;
|
|
50
|
+
|
|
51
|
+
declare const coreMainnetConfig: CoreNetworkConfig;
|
|
52
|
+
declare const mainnetConfig: MainnetNetworkConfig;
|
|
53
|
+
|
|
54
|
+
declare const coreBaseConfig: CoreNetworkConfig;
|
|
55
|
+
|
|
56
|
+
declare const coreSonicConfig: CoreNetworkConfig;
|
|
57
|
+
|
|
58
|
+
declare const SUBGRAPH_ID = "108d48ba91e3";
|
|
59
|
+
declare const SUBGRAPH_URL = "https://subgraph.satsuma-prod.com/108d48ba91e3/tokemak";
|
|
60
|
+
declare const ETH_SUBGRAPH = "v2-gen3-eth-mainnet";
|
|
61
|
+
declare const BASE_SUBGRAPH = "v2-gen3-base-mainnet";
|
|
62
|
+
declare const SONIC_SUBGRAPH = "v2-gen3-sonic-mainnet2";
|
|
63
|
+
|
|
64
|
+
declare const coreNetworkConfigs: CoreNetworkConfig[];
|
|
65
|
+
declare const getCoreConfig: (chainId?: SupportedChainIds) => CoreNetworkConfig;
|
|
66
|
+
|
|
67
|
+
declare const isSupportedChainId: (chainId: number) => chainId is SupportedChainIds;
|
|
68
|
+
|
|
69
|
+
declare const getMainnetConfig: (chainId?: SupportedChainIds) => MainnetNetworkConfig;
|
|
70
|
+
|
|
71
|
+
declare const AUTOPOOLS_WHITELIST_PROD: string[];
|
|
72
|
+
declare const STOKE_VOTE_WHITELIST: string[];
|
|
73
|
+
|
|
74
|
+
export { AUTOPOOLS_WHITELIST_PROD, BASE_SUBGRAPH, CoreNetworkConfig, ETH_SUBGRAPH, MainnetNetworkConfig, NetworkConfig, SONIC_SUBGRAPH, STOKE_VOTE_WHITELIST, SUBGRAPH_ID, SUBGRAPH_URL, SupportedChainIds, SupportedNetwork, SupportedNetworkNames, SupportedNetworkNamesLowercased, SupportedNetworks, coreBaseConfig, coreMainnetConfig, coreNetworkConfigs, coreSonicConfig, getCoreConfig, getMainnetConfig, isSupportedChainId, mainnetConfig };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var config_exports = {};
|
|
22
|
+
__export(config_exports, {
|
|
23
|
+
AUTOPOOLS_WHITELIST_PROD: () => AUTOPOOLS_WHITELIST_PROD,
|
|
24
|
+
BASE_SUBGRAPH: () => BASE_SUBGRAPH,
|
|
25
|
+
ETH_SUBGRAPH: () => ETH_SUBGRAPH,
|
|
26
|
+
SONIC_SUBGRAPH: () => SONIC_SUBGRAPH,
|
|
27
|
+
STOKE_VOTE_WHITELIST: () => STOKE_VOTE_WHITELIST,
|
|
28
|
+
SUBGRAPH_ID: () => SUBGRAPH_ID,
|
|
29
|
+
SUBGRAPH_URL: () => SUBGRAPH_URL,
|
|
30
|
+
SupportedNetworks: () => SupportedNetworks,
|
|
31
|
+
coreBaseConfig: () => coreBaseConfig,
|
|
32
|
+
coreMainnetConfig: () => coreMainnetConfig,
|
|
33
|
+
coreNetworkConfigs: () => coreNetworkConfigs,
|
|
34
|
+
coreSonicConfig: () => coreSonicConfig,
|
|
35
|
+
getCoreConfig: () => getCoreConfig,
|
|
36
|
+
getMainnetConfig: () => getMainnetConfig,
|
|
37
|
+
isSupportedChainId: () => isSupportedChainId,
|
|
38
|
+
mainnetConfig: () => mainnetConfig
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(config_exports);
|
|
41
|
+
|
|
42
|
+
// chains/index.ts
|
|
43
|
+
var chains_exports = {};
|
|
44
|
+
__export(chains_exports, {
|
|
45
|
+
coreBaseConfig: () => coreBaseConfig,
|
|
46
|
+
coreMainnetConfig: () => coreMainnetConfig,
|
|
47
|
+
coreSonicConfig: () => coreSonicConfig,
|
|
48
|
+
mainnetConfig: () => mainnetConfig
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// chains/mainnet.ts
|
|
52
|
+
var import_chains = require("viem/chains");
|
|
53
|
+
|
|
54
|
+
// subgraph/index.ts
|
|
55
|
+
var SUBGRAPH_ID = "108d48ba91e3";
|
|
56
|
+
var SUBGRAPH_URL = `https://subgraph.satsuma-prod.com/${SUBGRAPH_ID}/tokemak`;
|
|
57
|
+
var ETH_SUBGRAPH = "v2-gen3-eth-mainnet";
|
|
58
|
+
var BASE_SUBGRAPH = "v2-gen3-base-mainnet";
|
|
59
|
+
var SONIC_SUBGRAPH = "v2-gen3-sonic-mainnet2";
|
|
60
|
+
|
|
61
|
+
// chains/mainnet.ts
|
|
62
|
+
var coreMainnetConfig = {
|
|
63
|
+
name: import_chains.mainnet.name,
|
|
64
|
+
id: import_chains.mainnet.id,
|
|
65
|
+
shortName: "eth",
|
|
66
|
+
systemRegistry: "0x2218F90A98b0C070676f249EF44834686dAa4285",
|
|
67
|
+
weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
68
|
+
toke: "0x2e9d63788249371f1DFC918a52f8d799F4a38C94",
|
|
69
|
+
lens: "0x75455ae8c9B2Ff7Ae9F21ae06730d614c31D2300",
|
|
70
|
+
stoke: "0xA374A62DdBd21e3d5716cB04821CB710897c0972",
|
|
71
|
+
stokeExtend: "0x6e1F006c98B7389001eB427b1f593936B5c50673",
|
|
72
|
+
stokeVote: "0xFE3f64e47E2474bc2b337F348B9AA0ef6e1ccD01",
|
|
73
|
+
explorerUrl: `${import_chains.mainnet.blockExplorers.default.url}/`,
|
|
74
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${ETH_SUBGRAPH}/api`
|
|
75
|
+
};
|
|
76
|
+
var mainnetConfig = {
|
|
77
|
+
...coreMainnetConfig,
|
|
78
|
+
autoEthGuardedRewards: "0xf81D69f11e5103ce199fF745295a1E3D7a4CEF69",
|
|
79
|
+
accTokeV1: "0xA374A62DdBd21e3d5716cB04821CB710897c0972",
|
|
80
|
+
missedTokeRewards: "0xffd22cee98c24c12b20987d4106148d88269ede3",
|
|
81
|
+
accTokeV1Rewards: "0x086B9734D33783Bbe4fBc8249DF4C686aAe27054",
|
|
82
|
+
accTokeV1RewardsHash: "0x3cCE05568008916d739479958f7a1AF5f67661DD",
|
|
83
|
+
autoETHRewardsHash: "0x9ba21890C1017A7f65989016110c6ECd757B2162",
|
|
84
|
+
stokeRewards: "0xD69e57336377460707d579CB24f9Ba0aEDf88003",
|
|
85
|
+
stokeRewardsHash: "0x70f0f41B354cE2f1378952C50C635633E0373c24",
|
|
86
|
+
managerV1: "0xA86e412109f77c45a3BC1c5870b880492Fb86A14",
|
|
87
|
+
stakingV1: "0x96F98Ed74639689C3A11daf38ef86E59F43417D3",
|
|
88
|
+
rewardsV1: "0x79dD22579112d8a5F7347c5ED7E609e60da713C5",
|
|
89
|
+
rewardsV1Hash: "0x5ec3EC6A8aC774c7d53665ebc5DDf89145d02fB6",
|
|
90
|
+
rewardsV1Url: "https://ipfs-rewards.tokemaklabs.com/ipfs",
|
|
91
|
+
sushiPool: "0xd4e7a6e2D03e4e48DfC27dd3f46DF1c176647E38",
|
|
92
|
+
sushiPoolReactor: "0x8858A739eA1dd3D80FE577EF4e0D03E88561FaA3",
|
|
93
|
+
lpRewardsV1Url: "https://auto-rewards-prod-bucket-pool-stats-api-tokemakxyz.s3.amazonaws.com/current.json",
|
|
94
|
+
tSushiLP: "0x8858A739eA1dd3D80FE577EF4e0D03E88561FaA3",
|
|
95
|
+
curvePool: "0x7ea4aD8C803653498bF6AC1D2dEbc04DCe8Fd2aD",
|
|
96
|
+
convexRewarder: "0x3382607d00cfb668AbaB80D8EE781a2720CbC9ea",
|
|
97
|
+
curveRewardsUrl: "https://tokemakmarketdata.s3.amazonaws.com/curve-convex-apys.json"
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// chains/base.ts
|
|
101
|
+
var import_chains2 = require("viem/chains");
|
|
102
|
+
var coreBaseConfig = {
|
|
103
|
+
name: import_chains2.base.name,
|
|
104
|
+
id: import_chains2.base.id,
|
|
105
|
+
shortName: "base",
|
|
106
|
+
systemRegistry: "0x18Dc926095A7A007C01Ef836683Fdef4c4371b4e",
|
|
107
|
+
weth: "0x4200000000000000000000000000000000000006",
|
|
108
|
+
toke: "0x223c0d94dbc8c0e5df1f6b2c75f06c0229c91950",
|
|
109
|
+
lens: "0x1C00599444dd916eAD61487bc0C8112446DB89F0",
|
|
110
|
+
stoke: "0x2770784de40b9588FE16e4C514820f6bf8901EBf",
|
|
111
|
+
stokeVote: "0x388cFF4079E382FD7C11d699eB183882868d0FB9",
|
|
112
|
+
stokeExtend: "0x0",
|
|
113
|
+
explorerUrl: `${import_chains2.base.blockExplorers.default.url}/`,
|
|
114
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${BASE_SUBGRAPH}/api`
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// chains/sonic.ts
|
|
118
|
+
var import_chains3 = require("viem/chains");
|
|
119
|
+
var coreSonicConfig = {
|
|
120
|
+
name: import_chains3.sonic.name,
|
|
121
|
+
id: import_chains3.sonic.id,
|
|
122
|
+
shortName: "sonic",
|
|
123
|
+
systemRegistry: "0x1a912EB51D3cF8364eBAEE5A982cA37f25aD8848",
|
|
124
|
+
weth: "0x50c42deacd8fc9773493ed674b675be577f2634b",
|
|
125
|
+
toke: "0x223c0d94dbc8c0e5df1f6b2c75f06c0229c91950",
|
|
126
|
+
lens: "0xCB7E450c32D21Eb0168466c8022Ae32EF785a163",
|
|
127
|
+
stoke: "0x0",
|
|
128
|
+
stokeVote: "0x0",
|
|
129
|
+
stokeExtend: "0x0",
|
|
130
|
+
explorerUrl: `${import_chains3.sonic.blockExplorers.default.url}/`,
|
|
131
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${SONIC_SUBGRAPH}/api`
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// helpers/getCoreConfig.ts
|
|
135
|
+
var isCoreNetworkConfig = (config) => {
|
|
136
|
+
return config && !("autoEthGuardedRewards" in config);
|
|
137
|
+
};
|
|
138
|
+
var getCoreNetworkConfigs = () => {
|
|
139
|
+
return Object.values(chains_exports).filter(isCoreNetworkConfig);
|
|
140
|
+
};
|
|
141
|
+
var coreNetworkConfigs = getCoreNetworkConfigs();
|
|
142
|
+
var getCoreConfig = (chainId = coreMainnetConfig.id) => {
|
|
143
|
+
const coreConfigs = getCoreNetworkConfigs();
|
|
144
|
+
const config = coreConfigs.find((config2) => config2.id === chainId);
|
|
145
|
+
if (!config) {
|
|
146
|
+
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
147
|
+
}
|
|
148
|
+
return config;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// helpers/isSupportedChainId.ts
|
|
152
|
+
var isSupportedChainId = (chainId) => {
|
|
153
|
+
return Object.values(SupportedNetworks).includes(
|
|
154
|
+
chainId
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// helpers/getMainnetConfig.ts
|
|
159
|
+
var import_chains4 = require("viem/chains");
|
|
160
|
+
var getMainnetConfig = (chainId = import_chains4.mainnet.id) => {
|
|
161
|
+
if (chainId === import_chains4.mainnet.id) {
|
|
162
|
+
return mainnetConfig;
|
|
163
|
+
}
|
|
164
|
+
return mainnetConfig;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// types/SupportedNetworks.ts
|
|
168
|
+
var SupportedNetworks = Object.fromEntries(
|
|
169
|
+
coreNetworkConfigs.map((config) => [config.name, config.id])
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
// whitelist/autopools.ts
|
|
173
|
+
var AUTOPOOLS_WHITELIST_PROD = [
|
|
174
|
+
"0x0A2b94F6871c1D7A32Fe58E1ab5e6deA2f114E56",
|
|
175
|
+
"0x6dC3ce9C57b20131347FDc9089D740DAf6eB34c5",
|
|
176
|
+
"0xE800e3760FC20aA98c5df6A9816147f190455AF3",
|
|
177
|
+
"0xAADf01DD90aE0A6Bb9Eb908294658037096E0404",
|
|
178
|
+
"0x35911af1B570E26f668905595dEd133D01CD3E5a",
|
|
179
|
+
"0xa7569A44f348d3D70d8ad5889e50F78E33d80D35",
|
|
180
|
+
// autoUSD
|
|
181
|
+
"0x9c6864105AEC23388C89600046213a44C384c831",
|
|
182
|
+
// baseUSD
|
|
183
|
+
"0x79eB84B5E30Ef2481c8f00fD0Aa7aAd6Ac0AA54d",
|
|
184
|
+
// autoDOLA
|
|
185
|
+
"0xCb119265AA1195ea363D7A243aD56c73EA42Eb59"
|
|
186
|
+
// sonicUSD
|
|
187
|
+
// "0xEc4F2F260CfaA25c4524c4cAC8eB4222f25Ff73e", // autoS
|
|
188
|
+
];
|
|
189
|
+
var STOKE_VOTE_WHITELIST = [
|
|
190
|
+
"0x0A2b94F6871c1D7A32Fe58E1ab5e6deA2f114E56",
|
|
191
|
+
"0x6dC3ce9C57b20131347FDc9089D740DAf6eB34c5",
|
|
192
|
+
"0xE800e3760FC20aA98c5df6A9816147f190455AF3",
|
|
193
|
+
"0x35911af1B570E26f668905595dEd133D01CD3E5a"
|
|
194
|
+
// "0xa7569A44f348d3D70d8ad5889e50F78E33d80D35", // autoUSD
|
|
195
|
+
// "0xAADf01DD90aE0A6Bb9Eb908294658037096E0404", // baseETH
|
|
196
|
+
];
|
|
197
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
198
|
+
0 && (module.exports = {
|
|
199
|
+
AUTOPOOLS_WHITELIST_PROD,
|
|
200
|
+
BASE_SUBGRAPH,
|
|
201
|
+
ETH_SUBGRAPH,
|
|
202
|
+
SONIC_SUBGRAPH,
|
|
203
|
+
STOKE_VOTE_WHITELIST,
|
|
204
|
+
SUBGRAPH_ID,
|
|
205
|
+
SUBGRAPH_URL,
|
|
206
|
+
SupportedNetworks,
|
|
207
|
+
coreBaseConfig,
|
|
208
|
+
coreMainnetConfig,
|
|
209
|
+
coreNetworkConfigs,
|
|
210
|
+
coreSonicConfig,
|
|
211
|
+
getCoreConfig,
|
|
212
|
+
getMainnetConfig,
|
|
213
|
+
isSupportedChainId,
|
|
214
|
+
mainnetConfig
|
|
215
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tokemak/config",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/**"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsup index.ts --dts",
|
|
16
|
+
"lint": "eslint \"src/**/*.ts*\"",
|
|
17
|
+
"clean": "rimraf .turbo node_modules dist"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@tokemak/eslint-config": "workspace:*"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"viem": "2.x"
|
|
24
|
+
}
|
|
25
|
+
}
|