@tokemak/config 0.0.1 → 0.0.2
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 +7 -2
- package/dist/index.js +28 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
2
|
|
|
3
3
|
declare const SupportedNetworks: Record<string, number>;
|
|
4
|
+
declare const SUPPORTED_DEV_NETWORKS_IDS: (1 | 8453 | 146)[];
|
|
5
|
+
declare const SUPPORTED_PROD_NETWORKS_IDS: (1 | 8453 | 146)[];
|
|
6
|
+
declare const SUPPORTED_NETWORKS_IDS: (1 | 8453 | 146)[];
|
|
7
|
+
|
|
4
8
|
type SupportedNetworkNames = keyof typeof SupportedNetworks;
|
|
5
|
-
type SupportedChainIds = (typeof SupportedNetworks)[
|
|
9
|
+
type SupportedChainIds = (typeof SupportedNetworks)[number];
|
|
6
10
|
type SupportedNetwork = {
|
|
7
11
|
name: SupportedNetworkNames;
|
|
8
12
|
chainId: SupportedChainIds;
|
|
@@ -23,6 +27,7 @@ interface CoreNetworkConfig {
|
|
|
23
27
|
testnet?: boolean;
|
|
24
28
|
explorerUrl: string;
|
|
25
29
|
subgraphEndpoint: string;
|
|
30
|
+
rootPriceOracle: Address;
|
|
26
31
|
}
|
|
27
32
|
interface MainnetNetworkConfig extends CoreNetworkConfig {
|
|
28
33
|
autoEthGuardedRewards: Address;
|
|
@@ -71,4 +76,4 @@ declare const getMainnetConfig: (chainId?: SupportedChainIds) => MainnetNetworkC
|
|
|
71
76
|
declare const AUTOPOOLS_WHITELIST_PROD: string[];
|
|
72
77
|
declare const STOKE_VOTE_WHITELIST: string[];
|
|
73
78
|
|
|
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 };
|
|
79
|
+
export { AUTOPOOLS_WHITELIST_PROD, BASE_SUBGRAPH, CoreNetworkConfig, ETH_SUBGRAPH, MainnetNetworkConfig, NetworkConfig, SONIC_SUBGRAPH, STOKE_VOTE_WHITELIST, SUBGRAPH_ID, SUBGRAPH_URL, SUPPORTED_DEV_NETWORKS_IDS, SUPPORTED_NETWORKS_IDS, SUPPORTED_PROD_NETWORKS_IDS, SupportedChainIds, SupportedNetwork, SupportedNetworkNames, SupportedNetworkNamesLowercased, SupportedNetworks, coreBaseConfig, coreMainnetConfig, coreNetworkConfigs, coreSonicConfig, getCoreConfig, getMainnetConfig, isSupportedChainId, mainnetConfig };
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,9 @@ __export(config_exports, {
|
|
|
27
27
|
STOKE_VOTE_WHITELIST: () => STOKE_VOTE_WHITELIST,
|
|
28
28
|
SUBGRAPH_ID: () => SUBGRAPH_ID,
|
|
29
29
|
SUBGRAPH_URL: () => SUBGRAPH_URL,
|
|
30
|
+
SUPPORTED_DEV_NETWORKS_IDS: () => SUPPORTED_DEV_NETWORKS_IDS,
|
|
31
|
+
SUPPORTED_NETWORKS_IDS: () => SUPPORTED_NETWORKS_IDS,
|
|
32
|
+
SUPPORTED_PROD_NETWORKS_IDS: () => SUPPORTED_PROD_NETWORKS_IDS,
|
|
30
33
|
SupportedNetworks: () => SupportedNetworks,
|
|
31
34
|
coreBaseConfig: () => coreBaseConfig,
|
|
32
35
|
coreMainnetConfig: () => coreMainnetConfig,
|
|
@@ -71,7 +74,8 @@ var coreMainnetConfig = {
|
|
|
71
74
|
stokeExtend: "0x6e1F006c98B7389001eB427b1f593936B5c50673",
|
|
72
75
|
stokeVote: "0xFE3f64e47E2474bc2b337F348B9AA0ef6e1ccD01",
|
|
73
76
|
explorerUrl: `${import_chains.mainnet.blockExplorers.default.url}/`,
|
|
74
|
-
subgraphEndpoint: `${SUBGRAPH_URL}/${ETH_SUBGRAPH}/api
|
|
77
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${ETH_SUBGRAPH}/api`,
|
|
78
|
+
rootPriceOracle: "0x61F8BE7FD721e80C0249829eaE6f0DAf21bc2CaC"
|
|
75
79
|
};
|
|
76
80
|
var mainnetConfig = {
|
|
77
81
|
...coreMainnetConfig,
|
|
@@ -111,7 +115,8 @@ var coreBaseConfig = {
|
|
|
111
115
|
stokeVote: "0x388cFF4079E382FD7C11d699eB183882868d0FB9",
|
|
112
116
|
stokeExtend: "0x0",
|
|
113
117
|
explorerUrl: `${import_chains2.base.blockExplorers.default.url}/`,
|
|
114
|
-
subgraphEndpoint: `${SUBGRAPH_URL}/${BASE_SUBGRAPH}/api
|
|
118
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${BASE_SUBGRAPH}/api`,
|
|
119
|
+
rootPriceOracle: "0xBCf67d1d643C53E9C2f84aCBd830A5EDC2661795"
|
|
115
120
|
};
|
|
116
121
|
|
|
117
122
|
// chains/sonic.ts
|
|
@@ -128,7 +133,8 @@ var coreSonicConfig = {
|
|
|
128
133
|
stokeVote: "0x0",
|
|
129
134
|
stokeExtend: "0x0",
|
|
130
135
|
explorerUrl: `${import_chains3.sonic.blockExplorers.default.url}/`,
|
|
131
|
-
subgraphEndpoint: `${SUBGRAPH_URL}/${SONIC_SUBGRAPH}/api
|
|
136
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${SONIC_SUBGRAPH}/api`,
|
|
137
|
+
rootPriceOracle: "0x356d6e38efd2f33B162eC63534B449B96846751F"
|
|
132
138
|
};
|
|
133
139
|
|
|
134
140
|
// helpers/getCoreConfig.ts
|
|
@@ -148,27 +154,32 @@ var getCoreConfig = (chainId = coreMainnetConfig.id) => {
|
|
|
148
154
|
return config;
|
|
149
155
|
};
|
|
150
156
|
|
|
157
|
+
// whitelist/chains.ts
|
|
158
|
+
var import_chains4 = require("viem/chains");
|
|
159
|
+
var SupportedNetworks = Object.fromEntries(
|
|
160
|
+
coreNetworkConfigs.map((config) => [config.name, config.id])
|
|
161
|
+
);
|
|
162
|
+
var SUPPORTED_DEV_NETWORKS_IDS = [import_chains4.mainnet.id, import_chains4.base.id, import_chains4.sonic.id];
|
|
163
|
+
var SUPPORTED_PROD_NETWORKS_IDS = [import_chains4.mainnet.id, import_chains4.base.id, import_chains4.sonic.id];
|
|
164
|
+
var SUPPORTED_NETWORKS_IDS = [
|
|
165
|
+
...SUPPORTED_DEV_NETWORKS_IDS,
|
|
166
|
+
...SUPPORTED_PROD_NETWORKS_IDS
|
|
167
|
+
];
|
|
168
|
+
|
|
151
169
|
// helpers/isSupportedChainId.ts
|
|
152
170
|
var isSupportedChainId = (chainId) => {
|
|
153
|
-
return
|
|
154
|
-
chainId
|
|
155
|
-
);
|
|
171
|
+
return SUPPORTED_NETWORKS_IDS.includes(chainId);
|
|
156
172
|
};
|
|
157
173
|
|
|
158
174
|
// helpers/getMainnetConfig.ts
|
|
159
|
-
var
|
|
160
|
-
var getMainnetConfig = (chainId =
|
|
161
|
-
if (chainId ===
|
|
175
|
+
var import_chains6 = require("viem/chains");
|
|
176
|
+
var getMainnetConfig = (chainId = import_chains6.mainnet.id) => {
|
|
177
|
+
if (chainId === import_chains6.mainnet.id) {
|
|
162
178
|
return mainnetConfig;
|
|
163
179
|
}
|
|
164
180
|
return mainnetConfig;
|
|
165
181
|
};
|
|
166
182
|
|
|
167
|
-
// types/SupportedNetworks.ts
|
|
168
|
-
var SupportedNetworks = Object.fromEntries(
|
|
169
|
-
coreNetworkConfigs.map((config) => [config.name, config.id])
|
|
170
|
-
);
|
|
171
|
-
|
|
172
183
|
// whitelist/autopools.ts
|
|
173
184
|
var AUTOPOOLS_WHITELIST_PROD = [
|
|
174
185
|
"0x0A2b94F6871c1D7A32Fe58E1ab5e6deA2f114E56",
|
|
@@ -203,6 +214,9 @@ var STOKE_VOTE_WHITELIST = [
|
|
|
203
214
|
STOKE_VOTE_WHITELIST,
|
|
204
215
|
SUBGRAPH_ID,
|
|
205
216
|
SUBGRAPH_URL,
|
|
217
|
+
SUPPORTED_DEV_NETWORKS_IDS,
|
|
218
|
+
SUPPORTED_NETWORKS_IDS,
|
|
219
|
+
SUPPORTED_PROD_NETWORKS_IDS,
|
|
206
220
|
SupportedNetworks,
|
|
207
221
|
coreBaseConfig,
|
|
208
222
|
coreMainnetConfig,
|