@berachain/config 0.1.18-beta.2 → 0.1.19

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.
Files changed (89) hide show
  1. package/dist/bepolia.cjs +1 -8
  2. package/dist/bepolia.mjs +1 -8
  3. package/dist/chunk-276AZYTL.cjs +1 -0
  4. package/dist/chunk-2HIIMZE4.cjs +1 -0
  5. package/dist/chunk-2OLL4MUY.cjs +1 -0
  6. package/dist/chunk-3KQLFIHT.cjs +2 -0
  7. package/dist/chunk-3WZ7JUD6.cjs +1 -0
  8. package/dist/chunk-4EBBM3AH.mjs +1 -0
  9. package/dist/chunk-4EBC3WWP.mjs +1 -0
  10. package/dist/chunk-4VDLQK6F.cjs +1 -0
  11. package/dist/chunk-BWV5APOW.cjs +1 -0
  12. package/dist/chunk-DL645PXT.mjs +1 -0
  13. package/dist/chunk-DUO7UEQD.cjs +1 -0
  14. package/dist/chunk-DVULZ7ID.cjs +1 -0
  15. package/dist/chunk-FVNATITS.mjs +1 -0
  16. package/dist/chunk-FZ23S6ID.mjs +1 -0
  17. package/dist/chunk-JYSZ2GU3.cjs +1 -0
  18. package/dist/chunk-JZXLCA2E.mjs +1 -0
  19. package/dist/chunk-LCQFSMRO.mjs +1 -0
  20. package/dist/chunk-MB5HZZ3S.mjs +1 -0
  21. package/dist/chunk-MS6UGFXI.mjs +1 -0
  22. package/dist/chunk-O243TIHY.mjs +1 -0
  23. package/dist/chunk-S2A3Z34I.mjs +2 -0
  24. package/dist/chunk-S5CMEFTY.cjs +1 -0
  25. package/dist/chunk-VPOS7FPU.cjs +1 -0
  26. package/dist/chunk-XO2H4NRK.mjs +1 -0
  27. package/dist/index.cjs +1 -11
  28. package/dist/index.mjs +1 -11
  29. package/dist/internal/edge-config/index.cjs +1 -37
  30. package/dist/internal/edge-config/index.mjs +1 -37
  31. package/dist/internal/flags/index.cjs +1 -199
  32. package/dist/internal/flags/index.d.cts +3 -1
  33. package/dist/internal/flags/index.d.ts +3 -1
  34. package/dist/internal/flags/index.mjs +1 -199
  35. package/dist/internal/header-sources.cjs +11 -283
  36. package/dist/internal/header-sources.mjs +11 -283
  37. package/dist/internal/index.cjs +1 -40
  38. package/dist/internal/index.mjs +1 -40
  39. package/dist/internal/maintenance.cjs +1 -26
  40. package/dist/internal/maintenance.mjs +1 -26
  41. package/dist/internal/nextjs/index.cjs +1 -85
  42. package/dist/internal/nextjs/index.mjs +1 -85
  43. package/dist/internal/nextjs/utils/index.cjs +1 -39
  44. package/dist/internal/nextjs/utils/index.mjs +1 -39
  45. package/dist/internal/sentry/index.cjs +1 -11
  46. package/dist/internal/sentry/index.mjs +1 -11
  47. package/dist/internal/sentry/sentry.client.config.cjs +1 -67
  48. package/dist/internal/sentry/sentry.client.config.mjs +1 -67
  49. package/dist/internal/tailwind/index.cjs +1 -239
  50. package/dist/internal/tailwind/index.mjs +1 -239
  51. package/dist/internal/tsup/index.cjs +1 -73
  52. package/dist/internal/tsup/index.mjs +1 -73
  53. package/dist/internal/wagmi/index.cjs +1 -60
  54. package/dist/internal/wagmi/index.mjs +1 -60
  55. package/dist/mainnet.cjs +1 -10
  56. package/dist/mainnet.mjs +1 -10
  57. package/dist/sentry.edge.config-DS2KE3CX.cjs +1 -0
  58. package/dist/sentry.edge.config-OEQTPQ2L.mjs +1 -0
  59. package/dist/sentry.server.config-KRS7OUMO.mjs +1 -0
  60. package/dist/sentry.server.config-RNY6FTJT.cjs +1 -0
  61. package/package.json +1 -1
  62. package/dist/chunk-2JZ7QJEW.cjs +0 -84
  63. package/dist/chunk-2XYRGOX3.mjs +0 -64
  64. package/dist/chunk-3K6IUX3G.mjs +0 -25
  65. package/dist/chunk-4H4HDUCC.mjs +0 -179
  66. package/dist/chunk-6TL5ZQOM.cjs +0 -75
  67. package/dist/chunk-75ZPJI57.cjs +0 -9
  68. package/dist/chunk-7P6ASYW6.mjs +0 -9
  69. package/dist/chunk-ADH7F47T.cjs +0 -26
  70. package/dist/chunk-AP2XG6GJ.mjs +0 -84
  71. package/dist/chunk-BM46XQJA.mjs +0 -55
  72. package/dist/chunk-CAOMAWN5.mjs +0 -26
  73. package/dist/chunk-CD24O7M2.cjs +0 -138
  74. package/dist/chunk-EYYJ2UZT.cjs +0 -10
  75. package/dist/chunk-FNTZIXS7.cjs +0 -179
  76. package/dist/chunk-KJXYSGNH.mjs +0 -10
  77. package/dist/chunk-LALEUPWL.mjs +0 -8
  78. package/dist/chunk-NC5YZP6P.cjs +0 -169
  79. package/dist/chunk-NQ3UKQHW.mjs +0 -75
  80. package/dist/chunk-NX4FI7G3.cjs +0 -64
  81. package/dist/chunk-ONKAV4AG.cjs +0 -25
  82. package/dist/chunk-POXE63WP.mjs +0 -138
  83. package/dist/chunk-WARW3DCH.mjs +0 -169
  84. package/dist/chunk-WRTYGXJM.cjs +0 -55
  85. package/dist/chunk-YT7WZDGI.cjs +0 -8
  86. package/dist/sentry.edge.config-F4334LEP.cjs +0 -24
  87. package/dist/sentry.edge.config-JU55FF2U.mjs +0 -24
  88. package/dist/sentry.server.config-KFRT37Q3.cjs +0 -24
  89. package/dist/sentry.server.config-M77KFJ6J.mjs +0 -24
@@ -1,64 +0,0 @@
1
- import {
2
- currentDapp,
3
- defaultChainId
4
- } from "./chunk-CAOMAWN5.mjs";
5
-
6
- // src/internal/edge-config/isFlagEnabled.ts
7
- function _checkChain(flag, chain, defaultReturn) {
8
- if (flag.chain?.length) {
9
- return flag.chain.includes(
10
- chain === 80094 /* MAINNET */ ? "mainnet" : "bepolia"
11
- );
12
- }
13
- return defaultReturn;
14
- }
15
- function _checkBranch(flag, _environment, defaultReturn) {
16
- if (!_environment) {
17
- return defaultReturn;
18
- }
19
- const environment = _environment === "development" ? "preview" : _environment;
20
- if (flag.branch?.length) {
21
- return flag.branch.includes(
22
- environment
23
- );
24
- }
25
- return defaultReturn;
26
- }
27
- function _checkAppName(flag, app, defaultReturn) {
28
- if (flag.app?.length && app) {
29
- return flag.app.includes(app);
30
- }
31
- return defaultReturn;
32
- }
33
- function _checkTime(flag, key, defaultReturn) {
34
- const time = flag[key];
35
- if (!time) {
36
- return defaultReturn;
37
- }
38
- if (key === "startAt") {
39
- return time ? new Date(time) <= /* @__PURE__ */ new Date() : defaultReturn;
40
- } else {
41
- return time ? new Date(time) >= /* @__PURE__ */ new Date() : defaultReturn;
42
- }
43
- }
44
- function isFlagEnabled(flag, {
45
- chain = defaultChainId,
46
- environment = process.env.VERCEL_TARGET_ENV,
47
- app = currentDapp
48
- } = {}) {
49
- if (!flag) return false;
50
- if (typeof flag === "boolean") {
51
- return flag;
52
- }
53
- if (flag.condition === "OR") {
54
- return _checkChain(flag, chain, false) || _checkBranch(flag, environment, false) || _checkAppName(flag, app, false) || // this condition is weird but it's consistent with the logic in the AND condition
55
- // this means that if startAt is false, but endAt is true, the flag is enabled anyway
56
- // we should prob consider a cleaner way to handle the OR condition in the future
57
- _checkTime(flag, "startAt", false) || _checkTime(flag, "endAt", false);
58
- }
59
- return _checkChain(flag, chain, true) && _checkBranch(flag, environment, true) && _checkAppName(flag, app, true) && _checkTime(flag, "startAt", true) && _checkTime(flag, "endAt", true);
60
- }
61
-
62
- export {
63
- isFlagEnabled
64
- };
@@ -1,25 +0,0 @@
1
- import {
2
- defaultChainId,
3
- isLocalHost,
4
- isProduction
5
- } from "./chunk-CAOMAWN5.mjs";
6
-
7
- // src/internal/sentry/sentryEnvironment.ts
8
- var sentryEnvironment = defaultChainId === 80094 /* MAINNET */ ? "mainnet-" : "bepolia-";
9
- if (isProduction) {
10
- sentryEnvironment += "production";
11
- } else if (isLocalHost) {
12
- sentryEnvironment += "development";
13
- } else {
14
- sentryEnvironment += "preview";
15
- }
16
- var tracesSampleRate = isProduction ? 0.1 : 1;
17
- var sentryRelease = process.env.VERCEL_GIT_COMMIT_SHA;
18
- var sentryDebug = process.env.NEXT_PUBLIC_SENTRY_DEBUG === "true";
19
-
20
- export {
21
- sentryEnvironment,
22
- tracesSampleRate,
23
- sentryRelease,
24
- sentryDebug
25
- };
@@ -1,179 +0,0 @@
1
- // src/bepolia.ts
2
- var bepolia = {
3
- chainId: 80069 /* BEPOLIA */,
4
- tokens: {
5
- wbera: "0x6969696969696969696969696969696969696969",
6
- swbera: "0x118D2cEeE9785eaf70C15Cd74CD84c9f8c3EeC9a",
7
- bgt: "0x656b95E550C07a9ffe548bd4085c72418Ceb1dba",
8
- wbtc: "0x",
9
- weth: "0x"
10
- },
11
- depositContract: "0x4242424242424242424242424242424242424242",
12
- pol: {
13
- rewardVaultHelper: "0xEe233a69A36Db7fC10E03e921D90DEC52Cdce6e2",
14
- beraChef: "0xdf960E8F3F19C481dDE769edEDD439ea1a63426a",
15
- factory: "0x94Ad6Ac84f6C6FbA8b8CCbD71d9f4f101def52a8",
16
- rewardAllocationFactory: "0x7f09Cf6958631513aF0400488F65c7B5c0313F52",
17
- staker: "0x44F07Ce5AfeCbCC406e6beFD40cc2998eEb8c7C6",
18
- // Same pattern as bend.whiskApi: non-public env values are only available server-side.
19
- subgraph: {
20
- name: "pol-subgraph",
21
- uri: process.env.PRIVATE_80069_POL_SUBGRAPH_UPSTREAM ?? "https://api.subgraph.ormilabs.com/api/private/948207bc-bbb5-47e7-969a-06f9a6f35af3/subgraphs/pol-subgraph/bepolia-v1.7.3/gn",
22
- headers: process.env.ORMI_API_KEY ? { Authorization: `Bearer ${process.env.ORMI_API_KEY}` } : void 0
23
- },
24
- bribeBoostApi: process.env.NEXT_PUBLIC_80069_INCENTIVES_API || "https://bepolia.api-claim.berachain.com",
25
- supplyMonitor: {
26
- name: "supply-monitor",
27
- uri: process.env.NEXT_PUBLIC_SUPPLY_MONITOR_API ?? "https://supply-api.berachain.com"
28
- },
29
- bgtIncentiveDistributor: "0xb0d005Fe83E3F1ec876C1a64700c5F0d6265d9E3",
30
- lstStakerVaultFactory: "0xAf10B532cCC25B26a8e28913D5C4056a77e7a178"
31
- },
32
- api: {
33
- name: "Berachain API",
34
- uri: process.env.PRIVATE_80069_BEX_API_URL ?? process.env.NEXT_PUBLIC_80069_BEX_API_URL ?? "https://bepolia-api.berachain.com",
35
- headers: process.env.PRIVATE_80069_BEX_API_KEY ? {
36
- "x-api-key": process.env.PRIVATE_80069_BEX_API_KEY
37
- } : void 0
38
- },
39
- backend: {
40
- name: "Berachain Backend",
41
- uri: process.env.NEXT_PUBLIC_80069_BACKEND_API_URL ?? "https://backend-production-351b.up.railway.app"
42
- },
43
- beep: {
44
- name: "Berachain Beep",
45
- uri: process.env.NEXT_PUBLIC_80069_BEEP_API_URL ?? "https://beep.testnet.berachain.com"
46
- },
47
- bex: {
48
- chainName: "BEPOLIA",
49
- vault: "0x708cA656b68A6b7384a488A36aD33505a77241FE",
50
- helper: "0xC7c981ADcDC5d48fed0CD52807fb2bAB22676C8f",
51
- queries: "0xE3723383a0EA73D5c0dE424BAA97F97f86f6cF92",
52
- relayer: "0x343215E156Ff586711a5B8C49Fe3099BAF22624C",
53
- factories: {
54
- composableStable: "0xB60DbBaCEaeC23486a64d12089F467ef949f1bb1",
55
- weighted: "0xf1d23276C7b271B2aC595C78977b2312E9954D57"
56
- },
57
- poolCreationHelper: "0x0dC9964F6CA33d9EF38DEB4925234766127C6B36",
58
- aggregatorsRouter: "0x0000000000000000000000000000000000000000",
59
- aggregatorsRouterExecutor: "0x0000000000000000000000000000000000000000",
60
- haikuRouter: null,
61
- haikuAgentAddress: null,
62
- aggregatorsProxyUrl: process.env.NEXT_PUBLIC_80069_AGGREGATORS_PROXY_URL ?? "",
63
- recoverFundsApi: "https://t3stbe4i5d40p.testnet.berachain.com",
64
- recoverFundsContract: "0x0eFeC4379805fAFA7269Ec599a6921f388C8841a",
65
- balancerDelegatedOwnership: "0xba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b"
66
- },
67
- honey: {
68
- name: "Honey",
69
- url: "https://bepolia.honey.berachain.com",
70
- // Same pattern as bend.whiskApi: non-public env values are only available server-side.
71
- subgraph: {
72
- name: "honey-subgraph",
73
- uri: process.env.PRIVATE_80069_HONEY_SUBGRAPH_UPSTREAM ?? "https://api.subgraph.ormilabs.com/api/private/948207bc-bbb5-47e7-969a-06f9a6f35af3/subgraphs/honey-subgraph/bepolia-v1.2.1/gn",
74
- headers: process.env.ORMI_API_KEY ? { Authorization: `Bearer ${process.env.ORMI_API_KEY}` } : void 0
75
- },
76
- factory: "0xA4aFef880F5cE1f63c9fb48F661E27F8B4216401",
77
- pythOracle: "0x5CA67e134c52B1d11E038A5a4eD8Ddcdb1238943",
78
- pythWrapper: "0xE5Ad9BA751714ec8cdd554b5a9f12BFcA13980cB",
79
- reader: "0x285e147060CDc5ba902786d3A471224ee6cE0F91",
80
- token: "0xFCBD14DC51f0A4d49d5E53C2E0950e0bC26d0Dce"
81
- },
82
- hub: {
83
- name: "BeraHub",
84
- url: "https://bepolia.hub.berachain.com"
85
- },
86
- governance: {
87
- governor: process.env.NEXT_PUBLIC_80069_GOVERNANCE_ADDRESS ?? "0x4f4A5c2194B8e856b7a05B348F6ba3978FB6f6D5",
88
- timelock: process.env.NEXT_PUBLIC_80069_GOVERNANCE_TIMELOCK ?? "0xb5f2000b5744f207c931526cAE2134cAa8b6862a"
89
- },
90
- lists: {
91
- rewardVaultList: "https://raw.githubusercontent.com/berachain/metadata/refs/heads/main/src/vaults/bepolia.json",
92
- tokenList: "https://raw.githubusercontent.com/berachain/metadata/refs/heads/main/src/tokens/bepolia.json",
93
- validatorList: "https://raw.githubusercontent.com/berachain/metadata/refs/heads/main/src/validators/bepolia.json"
94
- },
95
- external: {
96
- pyth: "0x2880aB155794e7179c9eE2e38200202908C17B43"
97
- },
98
- averageBlockTime: 2,
99
- bridge: {
100
- name: "BeraBridge",
101
- url: "https://bepolia.bridge.berachain.com",
102
- nft: {
103
- name: "BeraBridge NFT",
104
- url: "#",
105
- eth: {
106
- subgraph: "#"
107
- },
108
- berachain: {
109
- subgraph: "#"
110
- }
111
- }
112
- },
113
- bend: {
114
- name: "Bend",
115
- url: "https://bepolia.bend.berachain.com",
116
- whiskApi: null,
117
- production: {
118
- morpho: null,
119
- adaptiveCurveIrm: null,
120
- metaMorphoFactory: null,
121
- publicAllocator: null,
122
- bundler3: null,
123
- generalAdapter1: null,
124
- supportedVaults: [],
125
- curatorVaults: []
126
- },
127
- staging: {
128
- morpho: null,
129
- adaptiveCurveIrm: null,
130
- metaMorphoFactory: null,
131
- publicAllocator: null,
132
- bundler3: null,
133
- generalAdapter1: null,
134
- supportedVaults: [],
135
- curatorVaults: []
136
- }
137
- },
138
- enso: {
139
- walletV2Factory: null,
140
- walletFlashloanAdapter: null
141
- },
142
- explore: {
143
- name: "Explore",
144
- url: "https://explore.berachain.com"
145
- },
146
- explorer: {
147
- name: "Berascan",
148
- url: "https://testnet.berascan.com"
149
- },
150
- chain: {
151
- name: process.env.NEXT_PUBLIC_CHAIN_NAME ?? "Berachain Bepolia"
152
- },
153
- /**
154
- * Public faucet configuration.
155
- *
156
- * Mainly used in static-monobera.
157
- */
158
- faucet: {
159
- name: "Faucet",
160
- url: "https://bepolia.faucet.berachain.com",
161
- /**
162
- * Amount of BERA the user will receive when using the faucet
163
- */
164
- dripAmount: 1,
165
- /**
166
- * Time in hours between each drip
167
- */
168
- timeGap: 8,
169
- cloudflareKey: process.env.CLOUDFLARE_KEY || "0x4AAAAAAARdAuciFArKhVwt",
170
- /**
171
- * API endpoint to send the request to the faucet
172
- */
173
- endpoint: "https://faucet-api.testnet.berachain.com"
174
- }
175
- };
176
-
177
- export {
178
- bepolia
179
- };
@@ -1,75 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/internal/sentry/index.ts
2
- var _nextjs = require('@sentry/nextjs'); var Sentry = _interopRequireWildcard(_nextjs);
3
- async function registerSentry(opt = {}) {
4
- if (process.env.NEXT_RUNTIME === "edge") {
5
- const { initSentryEdge } = await Promise.resolve().then(() => _interopRequireWildcard(require("./sentry.edge.config-F4334LEP.cjs")));
6
- initSentryEdge(Sentry, opt);
7
- } else if (process.env.NEXT_RUNTIME === "nodejs") {
8
- const { initSentryServer } = await Promise.resolve().then(() => _interopRequireWildcard(require("./sentry.server.config-KFRT37Q3.cjs")));
9
- initSentryServer(Sentry, opt);
10
- } else {
11
- }
12
- }
13
- function withSentryConfig2(config) {
14
- const _config = {
15
- ...config,
16
- env: {
17
- ...config.env,
18
- // This is needed for sentry to know the environment.
19
- VERCEL_TARGET_ENV: process.env.VERCEL_TARGET_ENV
20
- },
21
- webpack: (wpConfig, args) => {
22
- if (args.isServer && !args.dev && process.env.UPLOAD_SOURCEMAPS === "true") {
23
- wpConfig.devtool = "source-map";
24
- }
25
- return _nullishCoalesce(_optionalChain([config, 'access', _ => _.webpack, 'optionalCall', _2 => _2(wpConfig, args)]), () => ( wpConfig));
26
- }
27
- };
28
- return Sentry.withSentryConfig(_config, {
29
- // For all available options, see:
30
- // https://github.com/getsentry/sentry-webpack-plugin#options
31
- // Suppresses source map uploading logs during build
32
- // silent: process.env.NODE_ENV === "development",
33
- org: process.env.SENTRY_ORG,
34
- project: process.env.SENTRY_PROJECT,
35
- telemetry: false,
36
- reactComponentAnnotation: {
37
- enabled: process.env.UPLOAD_SOURCEMAPS === "true"
38
- },
39
- // For all available options, see:
40
- // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
41
- // Upload a larger set of source maps for prettier stack traces (increases build time)
42
- widenClientFileUpload: process.env.UPLOAD_SOURCEMAPS === "true",
43
- sourcemaps: {
44
- disable: process.env.UPLOAD_SOURCEMAPS !== "true"
45
- // deleteSourcemapsAfterUpload: true,
46
- },
47
- debug: process.env.UPLOAD_SOURCEMAPS === "true",
48
- // sourcemaps: {
49
- // disable: false,
50
- // // disable: !["production", "staging"].includes(
51
- // // process.env.VERCEL_TARGET_ENV ?? "",
52
- // // ),
53
- // assets,
54
- // // deleteSourcemapsAfterUpload: true,
55
- // },
56
- // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
57
- tunnelRoute: "/monitoring-tunnel",
58
- // Hides source maps from generated client bundles
59
- // hideSourceMaps: true,
60
- // Automatically tree-shake Sentry logger statements to reduce bundle size
61
- // disableLogger: true,
62
- // Enables automatic instrumentation of Vercel Cron Monitors.
63
- // See the following for more information:
64
- // https://docs.sentry.io/product/crons/
65
- // https://vercel.com/docs/cron-jobs
66
- automaticVercelMonitors: true
67
- });
68
- }
69
- var onRequestError = Sentry.captureRequestError;
70
-
71
-
72
-
73
-
74
-
75
- exports.registerSentry = registerSentry; exports.withSentryConfig = withSentryConfig2; exports.onRequestError = onRequestError;
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
-
8
-
9
- exports.__export = __export;
@@ -1,9 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- export {
8
- __export
9
- };
@@ -1,26 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkEYYJ2UZTcjs = require('./chunk-EYYJ2UZT.cjs');
4
-
5
- // src/utils/dynamicEnvVariable.ts
6
- var defaultChainId = process.env.NEXT_PUBLIC_CHAIN_ID ? Number(process.env.NEXT_PUBLIC_CHAIN_ID) : 80094 /* MAINNET */;
7
- if (!Object.values(_chunkEYYJ2UZTcjs.ChainId).includes(defaultChainId)) {
8
- throw new Error(
9
- `process.env.NEXT_PUBLIC_CHAIN_ID is invalid: ${defaultChainId}.
10
- This value must be one of the following: ${Object.values(_chunkEYYJ2UZTcjs.ChainId).filter(Number).join(", ")} when using @berachain/config/internal.`
11
- );
12
- }
13
- var isProduction = process.env.VERCEL_TARGET_ENV === "production";
14
- var isLocalHost = process.env.NODE_ENV === "development";
15
- var isPreview = process.env.VERCEL_TARGET_ENV === "preview" || isLocalHost;
16
- var isStaging = process.env.VERCEL_TARGET_ENV === "staging";
17
- var currentDapp = process.env.NEXT_PUBLIC_BERA_APP_NAME;
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
- exports.defaultChainId = defaultChainId; exports.isProduction = isProduction; exports.isLocalHost = isLocalHost; exports.isPreview = isPreview; exports.isStaging = isStaging; exports.currentDapp = currentDapp;
@@ -1,84 +0,0 @@
1
- // src/internal/nextjs/const.ts
2
- var IMAGE_REMOTE_PATTERNS = [
3
- {
4
- protocol: "https",
5
- hostname: "cdn.morpho.org",
6
- // bend
7
- port: "",
8
- pathname: "**"
9
- },
10
- {
11
- protocol: "https",
12
- hostname: "raw.githubusercontent.com",
13
- // bend
14
- port: "",
15
- pathname: "/trustwallet/assets/**"
16
- },
17
- {
18
- protocol: "https",
19
- hostname: "static.debank.com",
20
- // enso
21
- port: "",
22
- pathname: "/image/*/logo_url/**"
23
- },
24
- {
25
- protocol: "https",
26
- hostname: "cdn.whisk.so",
27
- // bend
28
- port: "",
29
- pathname: "**"
30
- },
31
- {
32
- protocol: "https",
33
- hostname: "raw.githubusercontent.com",
34
- port: "",
35
- pathname: "/berachain/**"
36
- },
37
- {
38
- protocol: "https",
39
- hostname: "assets.coingecko.com",
40
- port: "",
41
- pathname: "/coins/images/**"
42
- },
43
- {
44
- protocol: "https",
45
- hostname: "coin-images.coingecko.com",
46
- port: "",
47
- pathname: "/coins/images/**"
48
- },
49
- {
50
- protocol: "https",
51
- hostname: "beranames-assets-berachain.s3.eu-central-003.backblazeb2.com",
52
- port: "",
53
- pathname: "/**"
54
- },
55
- {
56
- protocol: "https",
57
- hostname: "icons.llama.fi",
58
- port: "",
59
- pathname: "/**"
60
- },
61
- {
62
- protocol: "https",
63
- hostname: "icons.llamao.fi",
64
- port: "",
65
- pathname: "/**"
66
- },
67
- {
68
- protocol: "https",
69
- hostname: "coin-images.coingecko.com",
70
- port: "",
71
- pathname: "/asset_platforms/images/**"
72
- },
73
- // token logos on metadata repo are hosted here. We own the directory
74
- {
75
- protocol: "https",
76
- hostname: "imagedelivery.net",
77
- port: "",
78
- pathname: "/qNj7Q3MCke89zoKzav7eDQ/**"
79
- }
80
- ];
81
-
82
- export {
83
- IMAGE_REMOTE_PATTERNS
84
- };
@@ -1,55 +0,0 @@
1
- import {
2
- defaultChainId
3
- } from "./chunk-CAOMAWN5.mjs";
4
-
5
- // src/utils/env.ts
6
- if (defaultChainId !== 80094 /* MAINNET */ && defaultChainId !== 80069 /* BEPOLIA */) {
7
- throw new Error(`Invalid chainId: ${defaultChainId}`);
8
- }
9
- var _defaultChainId = defaultChainId;
10
- var imageBaseUrl = "https://imagedelivery.net/qNj7Q3MCke89zoKzav7eDQ";
11
- var goldskyBaseUrl = "https://api.goldsky.com/api/public/project_clq1h5ct0g4a201x18tfte5iv/subgraphs/";
12
- function getRpcUrls(chainId = _defaultChainId) {
13
- if (chainId === 80069 /* BEPOLIA */ && process.env.NEXT_PUBLIC_80069_ANVIL_RPC_URL || chainId === 80094 /* MAINNET */ && process.env.NEXT_PUBLIC_80094_ANVIL_RPC_URL) {
14
- let anvilUrl = chainId === 80069 /* BEPOLIA */ ? process.env.NEXT_PUBLIC_80069_ANVIL_RPC_URL : process.env.NEXT_PUBLIC_80094_ANVIL_RPC_URL;
15
- if (process.env.VITEST_WORKER_ID) {
16
- anvilUrl = `${anvilUrl}/${process.env.VITEST_WORKER_ID ?? 1}`;
17
- } else {
18
- console.log("Using anvil RPC for bepolia", anvilUrl);
19
- }
20
- return {
21
- publicJsonRpcUrl: anvilUrl,
22
- jsonRpcUrl: anvilUrl,
23
- alchemyJsonRpcUrl: void 0,
24
- privateRcpUrl: void 0,
25
- isAnvil: true
26
- };
27
- }
28
- return {
29
- publicJsonRpcUrl: chainId === 80069 /* BEPOLIA */ ? process.env.NEXT_PUBLIC_80069_PUBLIC_JSON_RPC_URL ?? "https://bepolia.rpc.berachain.com" : process.env.NEXT_PUBLIC_80094_PUBLIC_JSON_RPC_URL ?? "https://rpc.berachain.com",
30
- jsonRpcUrl: chainId === 80069 /* BEPOLIA */ ? process.env.NEXT_PUBLIC_80069_JSON_RPC_URL ?? "https://bepolia.rpc.berachain.com" : process.env.NEXT_PUBLIC_80094_JSON_RPC_URL ?? "https://rpc.berachain.com",
31
- alchemyJsonRpcUrl: chainId === 80069 /* BEPOLIA */ ? process.env.NEXT_PUBLIC_80069_ALCHEMY_JSON_RPC_URL : process.env.NEXT_PUBLIC_80094_ALCHEMY_JSON_RPC_URL,
32
- privateRcpUrl: chainId === 80069 /* BEPOLIA */ ? process.env.PRIVATE_80069_JSON_RPC_URL : process.env.PRIVATE_80094_JSON_RPC_URL,
33
- isAnvil: false
34
- };
35
- }
36
- var {
37
- publicJsonRpcUrl,
38
- jsonRpcUrl,
39
- alchemyJsonRpcUrl,
40
- /**
41
- * Dedicated private RPC URL for server side with higher rate limits.
42
- * Not available on client side.
43
- */
44
- privateRcpUrl
45
- } = getRpcUrls(defaultChainId);
46
-
47
- export {
48
- imageBaseUrl,
49
- goldskyBaseUrl,
50
- getRpcUrls,
51
- publicJsonRpcUrl,
52
- jsonRpcUrl,
53
- alchemyJsonRpcUrl,
54
- privateRcpUrl
55
- };
@@ -1,26 +0,0 @@
1
- import {
2
- ChainId
3
- } from "./chunk-KJXYSGNH.mjs";
4
-
5
- // src/utils/dynamicEnvVariable.ts
6
- var defaultChainId = process.env.NEXT_PUBLIC_CHAIN_ID ? Number(process.env.NEXT_PUBLIC_CHAIN_ID) : 80094 /* MAINNET */;
7
- if (!Object.values(ChainId).includes(defaultChainId)) {
8
- throw new Error(
9
- `process.env.NEXT_PUBLIC_CHAIN_ID is invalid: ${defaultChainId}.
10
- This value must be one of the following: ${Object.values(ChainId).filter(Number).join(", ")} when using @berachain/config/internal.`
11
- );
12
- }
13
- var isProduction = process.env.VERCEL_TARGET_ENV === "production";
14
- var isLocalHost = process.env.NODE_ENV === "development";
15
- var isPreview = process.env.VERCEL_TARGET_ENV === "preview" || isLocalHost;
16
- var isStaging = process.env.VERCEL_TARGET_ENV === "staging";
17
- var currentDapp = process.env.NEXT_PUBLIC_BERA_APP_NAME;
18
-
19
- export {
20
- defaultChainId,
21
- isProduction,
22
- isLocalHost,
23
- isPreview,
24
- isStaging,
25
- currentDapp
26
- };