@tokemak/config 0.0.1 → 0.0.3
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 +12 -2
- package/dist/index.js +107 -24
- package/package.json +8 -8
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 | 42161 | 9745)[];
|
|
5
|
+
declare const SUPPORTED_PROD_NETWORKS_IDS: (1 | 8453 | 146 | 42161 | 9745)[];
|
|
6
|
+
declare const SUPPORTED_NETWORKS_IDS: (1 | 8453 | 146 | 42161 | 9745)[];
|
|
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;
|
|
@@ -55,11 +60,16 @@ declare const coreBaseConfig: CoreNetworkConfig;
|
|
|
55
60
|
|
|
56
61
|
declare const coreSonicConfig: CoreNetworkConfig;
|
|
57
62
|
|
|
63
|
+
declare const corePlasmaConfig: CoreNetworkConfig;
|
|
64
|
+
|
|
65
|
+
declare const coreArbitrumConfig: CoreNetworkConfig;
|
|
66
|
+
|
|
58
67
|
declare const SUBGRAPH_ID = "108d48ba91e3";
|
|
59
68
|
declare const SUBGRAPH_URL = "https://subgraph.satsuma-prod.com/108d48ba91e3/tokemak";
|
|
60
69
|
declare const ETH_SUBGRAPH = "v2-gen3-eth-mainnet";
|
|
61
70
|
declare const BASE_SUBGRAPH = "v2-gen3-base-mainnet";
|
|
62
71
|
declare const SONIC_SUBGRAPH = "v2-gen3-sonic-mainnet2";
|
|
72
|
+
declare const ARBITRUM_SUBGRAPH = "v2-gen3-arbitrum-mainnet";
|
|
63
73
|
|
|
64
74
|
declare const coreNetworkConfigs: CoreNetworkConfig[];
|
|
65
75
|
declare const getCoreConfig: (chainId?: SupportedChainIds) => CoreNetworkConfig;
|
|
@@ -71,4 +81,4 @@ declare const getMainnetConfig: (chainId?: SupportedChainIds) => MainnetNetworkC
|
|
|
71
81
|
declare const AUTOPOOLS_WHITELIST_PROD: string[];
|
|
72
82
|
declare const STOKE_VOTE_WHITELIST: string[];
|
|
73
83
|
|
|
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 };
|
|
84
|
+
export { ARBITRUM_SUBGRAPH, 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, coreArbitrumConfig, coreBaseConfig, coreMainnetConfig, coreNetworkConfigs, corePlasmaConfig, coreSonicConfig, getCoreConfig, getMainnetConfig, isSupportedChainId, mainnetConfig };
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// index.ts
|
|
21
21
|
var config_exports = {};
|
|
22
22
|
__export(config_exports, {
|
|
23
|
+
ARBITRUM_SUBGRAPH: () => ARBITRUM_SUBGRAPH,
|
|
23
24
|
AUTOPOOLS_WHITELIST_PROD: () => AUTOPOOLS_WHITELIST_PROD,
|
|
24
25
|
BASE_SUBGRAPH: () => BASE_SUBGRAPH,
|
|
25
26
|
ETH_SUBGRAPH: () => ETH_SUBGRAPH,
|
|
@@ -27,10 +28,15 @@ __export(config_exports, {
|
|
|
27
28
|
STOKE_VOTE_WHITELIST: () => STOKE_VOTE_WHITELIST,
|
|
28
29
|
SUBGRAPH_ID: () => SUBGRAPH_ID,
|
|
29
30
|
SUBGRAPH_URL: () => SUBGRAPH_URL,
|
|
31
|
+
SUPPORTED_DEV_NETWORKS_IDS: () => SUPPORTED_DEV_NETWORKS_IDS,
|
|
32
|
+
SUPPORTED_NETWORKS_IDS: () => SUPPORTED_NETWORKS_IDS,
|
|
33
|
+
SUPPORTED_PROD_NETWORKS_IDS: () => SUPPORTED_PROD_NETWORKS_IDS,
|
|
30
34
|
SupportedNetworks: () => SupportedNetworks,
|
|
35
|
+
coreArbitrumConfig: () => coreArbitrumConfig,
|
|
31
36
|
coreBaseConfig: () => coreBaseConfig,
|
|
32
37
|
coreMainnetConfig: () => coreMainnetConfig,
|
|
33
38
|
coreNetworkConfigs: () => coreNetworkConfigs,
|
|
39
|
+
corePlasmaConfig: () => corePlasmaConfig,
|
|
34
40
|
coreSonicConfig: () => coreSonicConfig,
|
|
35
41
|
getCoreConfig: () => getCoreConfig,
|
|
36
42
|
getMainnetConfig: () => getMainnetConfig,
|
|
@@ -42,23 +48,16 @@ module.exports = __toCommonJS(config_exports);
|
|
|
42
48
|
// chains/index.ts
|
|
43
49
|
var chains_exports = {};
|
|
44
50
|
__export(chains_exports, {
|
|
51
|
+
coreArbitrumConfig: () => coreArbitrumConfig,
|
|
45
52
|
coreBaseConfig: () => coreBaseConfig,
|
|
46
53
|
coreMainnetConfig: () => coreMainnetConfig,
|
|
54
|
+
corePlasmaConfig: () => corePlasmaConfig,
|
|
47
55
|
coreSonicConfig: () => coreSonicConfig,
|
|
48
56
|
mainnetConfig: () => mainnetConfig
|
|
49
57
|
});
|
|
50
58
|
|
|
51
59
|
// chains/mainnet.ts
|
|
52
60
|
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
61
|
var coreMainnetConfig = {
|
|
63
62
|
name: import_chains.mainnet.name,
|
|
64
63
|
id: import_chains.mainnet.id,
|
|
@@ -71,7 +70,9 @@ var coreMainnetConfig = {
|
|
|
71
70
|
stokeExtend: "0x6e1F006c98B7389001eB427b1f593936B5c50673",
|
|
72
71
|
stokeVote: "0xFE3f64e47E2474bc2b337F348B9AA0ef6e1ccD01",
|
|
73
72
|
explorerUrl: `${import_chains.mainnet.blockExplorers.default.url}/`,
|
|
74
|
-
subgraphEndpoint: `${SUBGRAPH_URL}/${ETH_SUBGRAPH}/api
|
|
73
|
+
// subgraphEndpoint: `${SUBGRAPH_URL}/${ETH_SUBGRAPH}/api`,
|
|
74
|
+
subgraphEndpoint: "https://ethereum-mainnet.graph-eu.p2pify.com/36c1106ec8369413ddc2396b35fd7f0c/sgr-626-485-741",
|
|
75
|
+
rootPriceOracle: "0x61F8BE7FD721e80C0249829eaE6f0DAf21bc2CaC"
|
|
75
76
|
};
|
|
76
77
|
var mainnetConfig = {
|
|
77
78
|
...coreMainnetConfig,
|
|
@@ -99,6 +100,16 @@ var mainnetConfig = {
|
|
|
99
100
|
|
|
100
101
|
// chains/base.ts
|
|
101
102
|
var import_chains2 = require("viem/chains");
|
|
103
|
+
|
|
104
|
+
// subgraph/index.ts
|
|
105
|
+
var SUBGRAPH_ID = "108d48ba91e3";
|
|
106
|
+
var SUBGRAPH_URL = `https://subgraph.satsuma-prod.com/${SUBGRAPH_ID}/tokemak`;
|
|
107
|
+
var ETH_SUBGRAPH = "v2-gen3-eth-mainnet";
|
|
108
|
+
var BASE_SUBGRAPH = "v2-gen3-base-mainnet";
|
|
109
|
+
var SONIC_SUBGRAPH = "v2-gen3-sonic-mainnet2";
|
|
110
|
+
var ARBITRUM_SUBGRAPH = "v2-gen3-arbitrum-mainnet";
|
|
111
|
+
|
|
112
|
+
// chains/base.ts
|
|
102
113
|
var coreBaseConfig = {
|
|
103
114
|
name: import_chains2.base.name,
|
|
104
115
|
id: import_chains2.base.id,
|
|
@@ -111,7 +122,8 @@ var coreBaseConfig = {
|
|
|
111
122
|
stokeVote: "0x388cFF4079E382FD7C11d699eB183882868d0FB9",
|
|
112
123
|
stokeExtend: "0x0",
|
|
113
124
|
explorerUrl: `${import_chains2.base.blockExplorers.default.url}/`,
|
|
114
|
-
subgraphEndpoint: `${SUBGRAPH_URL}/${BASE_SUBGRAPH}/api
|
|
125
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${BASE_SUBGRAPH}/api`,
|
|
126
|
+
rootPriceOracle: "0xBCf67d1d643C53E9C2f84aCBd830A5EDC2661795"
|
|
115
127
|
};
|
|
116
128
|
|
|
117
129
|
// chains/sonic.ts
|
|
@@ -128,7 +140,45 @@ var coreSonicConfig = {
|
|
|
128
140
|
stokeVote: "0x0",
|
|
129
141
|
stokeExtend: "0x0",
|
|
130
142
|
explorerUrl: `${import_chains3.sonic.blockExplorers.default.url}/`,
|
|
131
|
-
subgraphEndpoint: `${SUBGRAPH_URL}/${SONIC_SUBGRAPH}/api
|
|
143
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${SONIC_SUBGRAPH}/api`,
|
|
144
|
+
rootPriceOracle: "0x356d6e38efd2f33B162eC63534B449B96846751F"
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// chains/plasma.ts
|
|
148
|
+
var import_chains4 = require("viem/chains");
|
|
149
|
+
var PLASMA_SUBGRAPH_URL = "https://subgraph.tokemaklabs.com/api/graphql/9745";
|
|
150
|
+
var corePlasmaConfig = {
|
|
151
|
+
name: import_chains4.plasma.name,
|
|
152
|
+
id: import_chains4.plasma.id,
|
|
153
|
+
shortName: "plasma",
|
|
154
|
+
systemRegistry: "0x9065C0E33Bc8FB31A21874f399985e39bC187D48",
|
|
155
|
+
weth: "0x9895D81bB462A195b4922ED7De0e3ACD007c32CB",
|
|
156
|
+
toke: "0x223C0d94dbc8c0E5df1f6B2C75F06c0229c91950",
|
|
157
|
+
lens: "0x8dBaD46D468d57fdd1FCbA0452C8cD4d7FaE72E8",
|
|
158
|
+
stoke: "0x0",
|
|
159
|
+
stokeVote: "0x0",
|
|
160
|
+
stokeExtend: "0x0",
|
|
161
|
+
explorerUrl: `${import_chains4.plasma.blockExplorers.default.url}/`,
|
|
162
|
+
subgraphEndpoint: PLASMA_SUBGRAPH_URL,
|
|
163
|
+
rootPriceOracle: "0xf25BDd81822aB430F6637Ea31D8b5aDd0B6d124F"
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// chains/arbitrum.ts
|
|
167
|
+
var import_chains5 = require("viem/chains");
|
|
168
|
+
var coreArbitrumConfig = {
|
|
169
|
+
name: import_chains5.arbitrum.name,
|
|
170
|
+
id: import_chains5.arbitrum.id,
|
|
171
|
+
shortName: "arbitrum",
|
|
172
|
+
systemRegistry: "0xBFd8E6C9bF2CD5466f5651746f8E946A6C7b4220",
|
|
173
|
+
weth: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
174
|
+
toke: "0x223c0d94dbc8c0e5df1f6b2c75f06c0229c91950",
|
|
175
|
+
lens: "0x590A31453390A1bB266672156A87eFB1302FC754",
|
|
176
|
+
stoke: "0x0",
|
|
177
|
+
stokeVote: "0x0",
|
|
178
|
+
stokeExtend: "0x0",
|
|
179
|
+
explorerUrl: `${import_chains5.arbitrum.blockExplorers.default.url}/`,
|
|
180
|
+
subgraphEndpoint: `${SUBGRAPH_URL}/${ARBITRUM_SUBGRAPH}/api`,
|
|
181
|
+
rootPriceOracle: "0xe84CEa5553CC9D65166A7850DAB2E7712072D97F"
|
|
132
182
|
};
|
|
133
183
|
|
|
134
184
|
// helpers/getCoreConfig.ts
|
|
@@ -148,27 +198,44 @@ var getCoreConfig = (chainId = coreMainnetConfig.id) => {
|
|
|
148
198
|
return config;
|
|
149
199
|
};
|
|
150
200
|
|
|
201
|
+
// whitelist/chains.ts
|
|
202
|
+
var import_chains6 = require("viem/chains");
|
|
203
|
+
var SupportedNetworks = Object.fromEntries(
|
|
204
|
+
coreNetworkConfigs.map((config) => [config.name, config.id])
|
|
205
|
+
);
|
|
206
|
+
var SUPPORTED_DEV_NETWORKS_IDS = [
|
|
207
|
+
import_chains6.mainnet.id,
|
|
208
|
+
import_chains6.base.id,
|
|
209
|
+
import_chains6.sonic.id,
|
|
210
|
+
import_chains6.arbitrum.id,
|
|
211
|
+
import_chains6.plasma.id
|
|
212
|
+
];
|
|
213
|
+
var SUPPORTED_PROD_NETWORKS_IDS = [
|
|
214
|
+
import_chains6.mainnet.id,
|
|
215
|
+
import_chains6.base.id,
|
|
216
|
+
import_chains6.sonic.id,
|
|
217
|
+
import_chains6.arbitrum.id,
|
|
218
|
+
import_chains6.plasma.id
|
|
219
|
+
];
|
|
220
|
+
var SUPPORTED_NETWORKS_IDS = [
|
|
221
|
+
...SUPPORTED_DEV_NETWORKS_IDS,
|
|
222
|
+
...SUPPORTED_PROD_NETWORKS_IDS
|
|
223
|
+
];
|
|
224
|
+
|
|
151
225
|
// helpers/isSupportedChainId.ts
|
|
152
226
|
var isSupportedChainId = (chainId) => {
|
|
153
|
-
return
|
|
154
|
-
chainId
|
|
155
|
-
);
|
|
227
|
+
return SUPPORTED_NETWORKS_IDS.includes(chainId);
|
|
156
228
|
};
|
|
157
229
|
|
|
158
230
|
// helpers/getMainnetConfig.ts
|
|
159
|
-
var
|
|
160
|
-
var getMainnetConfig = (chainId =
|
|
161
|
-
if (chainId ===
|
|
231
|
+
var import_chains8 = require("viem/chains");
|
|
232
|
+
var getMainnetConfig = (chainId = import_chains8.mainnet.id) => {
|
|
233
|
+
if (chainId === import_chains8.mainnet.id) {
|
|
162
234
|
return mainnetConfig;
|
|
163
235
|
}
|
|
164
236
|
return mainnetConfig;
|
|
165
237
|
};
|
|
166
238
|
|
|
167
|
-
// types/SupportedNetworks.ts
|
|
168
|
-
var SupportedNetworks = Object.fromEntries(
|
|
169
|
-
coreNetworkConfigs.map((config) => [config.name, config.id])
|
|
170
|
-
);
|
|
171
|
-
|
|
172
239
|
// whitelist/autopools.ts
|
|
173
240
|
var AUTOPOOLS_WHITELIST_PROD = [
|
|
174
241
|
"0x0A2b94F6871c1D7A32Fe58E1ab5e6deA2f114E56",
|
|
@@ -182,8 +249,18 @@ var AUTOPOOLS_WHITELIST_PROD = [
|
|
|
182
249
|
// baseUSD
|
|
183
250
|
"0x79eB84B5E30Ef2481c8f00fD0Aa7aAd6Ac0AA54d",
|
|
184
251
|
// autoDOLA
|
|
185
|
-
"0xCb119265AA1195ea363D7A243aD56c73EA42Eb59"
|
|
252
|
+
"0xCb119265AA1195ea363D7A243aD56c73EA42Eb59",
|
|
186
253
|
// sonicUSD
|
|
254
|
+
"0xeb042DEE6f7Ff3B45eF0A71686653D168FB02477",
|
|
255
|
+
// baseEURC
|
|
256
|
+
"0xf63b7F49B4f5Dc5D0e7e583Cfd79DC64E646320c",
|
|
257
|
+
// arbUSD
|
|
258
|
+
"0x52F0D57Fb5D4780a37164f918746f9BD51c684a3",
|
|
259
|
+
//siloETH
|
|
260
|
+
"0x408b6A3E2Daf288864968454AAe786a2A042Df36",
|
|
261
|
+
//siloUSD
|
|
262
|
+
"0x4Ec8f8b0F144ce1fa280B84F01Df9e353e83EC80"
|
|
263
|
+
// plasmaUSD
|
|
187
264
|
// "0xEc4F2F260CfaA25c4524c4cAC8eB4222f25Ff73e", // autoS
|
|
188
265
|
];
|
|
189
266
|
var STOKE_VOTE_WHITELIST = [
|
|
@@ -196,6 +273,7 @@ var STOKE_VOTE_WHITELIST = [
|
|
|
196
273
|
];
|
|
197
274
|
// Annotate the CommonJS export names for ESM import in node:
|
|
198
275
|
0 && (module.exports = {
|
|
276
|
+
ARBITRUM_SUBGRAPH,
|
|
199
277
|
AUTOPOOLS_WHITELIST_PROD,
|
|
200
278
|
BASE_SUBGRAPH,
|
|
201
279
|
ETH_SUBGRAPH,
|
|
@@ -203,10 +281,15 @@ var STOKE_VOTE_WHITELIST = [
|
|
|
203
281
|
STOKE_VOTE_WHITELIST,
|
|
204
282
|
SUBGRAPH_ID,
|
|
205
283
|
SUBGRAPH_URL,
|
|
284
|
+
SUPPORTED_DEV_NETWORKS_IDS,
|
|
285
|
+
SUPPORTED_NETWORKS_IDS,
|
|
286
|
+
SUPPORTED_PROD_NETWORKS_IDS,
|
|
206
287
|
SupportedNetworks,
|
|
288
|
+
coreArbitrumConfig,
|
|
207
289
|
coreBaseConfig,
|
|
208
290
|
coreMainnetConfig,
|
|
209
291
|
coreNetworkConfigs,
|
|
292
|
+
corePlasmaConfig,
|
|
210
293
|
coreSonicConfig,
|
|
211
294
|
getCoreConfig,
|
|
212
295
|
getMainnetConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokemak/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsup index.ts --dts",
|
|
16
|
-
"lint": "eslint \"src/**/*.ts*\"",
|
|
17
|
-
"clean": "rimraf .turbo node_modules dist"
|
|
18
|
-
},
|
|
19
14
|
"devDependencies": {
|
|
20
|
-
"@tokemak/eslint-config": "
|
|
15
|
+
"@tokemak/eslint-config": "0.0.0"
|
|
21
16
|
},
|
|
22
17
|
"peerDependencies": {
|
|
23
18
|
"viem": "2.x"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsup index.ts --dts",
|
|
22
|
+
"lint": "eslint \"src/**/*.ts*\"",
|
|
23
|
+
"clean": "rimraf .turbo node_modules dist"
|
|
24
24
|
}
|
|
25
|
-
}
|
|
25
|
+
}
|