@berachain/config 0.1.24-beta.3 → 0.1.24-beta.5
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/bepolia.cjs +0 -1
- package/dist/bepolia.mjs +0 -1
- package/dist/{chunk-4RBW7LA7.mjs → chunk-5SH7AT43.mjs} +1 -1
- package/dist/{chunk-WRTYGXJM.cjs → chunk-AU3LYJAB.cjs} +26 -6
- package/dist/{chunk-ONKAV4AG.cjs → chunk-B2BTOQVP.cjs} +5 -5
- package/dist/{chunk-TJPHIVC5.mjs → chunk-IGYS2XEK.mjs} +2 -2
- package/dist/{chunk-3K6IUX3G.mjs → chunk-OWAB24JG.mjs} +1 -1
- package/dist/{chunk-ZG7CKYT4.cjs → chunk-SHM2VD4A.cjs} +10 -10
- package/dist/{chunk-BM46XQJA.mjs → chunk-VWRKCGMU.mjs} +22 -2
- package/dist/{chunk-4UCGQIWY.mjs → chunk-XA5DMTFW.mjs} +2 -2
- package/dist/{chunk-EPWUWEWI.cjs → chunk-ZJEZCW5Z.cjs} +3 -3
- package/dist/{chunk-3NQ3NFWW.cjs → chunk-ZTYHPIUW.cjs} +2 -2
- package/dist/index.cjs +0 -1
- package/dist/index.mjs +0 -1
- package/dist/internal/dedupeCspSources.d.ts +9 -0
- package/dist/internal/dedupeCspSources.d.ts.map +1 -0
- package/dist/internal/header-sources.cjs +258 -148
- package/dist/internal/header-sources.d.ts +108 -2
- package/dist/internal/header-sources.d.ts.map +1 -1
- package/dist/internal/header-sources.mjs +254 -144
- package/dist/internal/index.cjs +4 -7
- package/dist/internal/index.mjs +5 -8
- package/dist/internal/maintenance.cjs +1 -3
- package/dist/internal/maintenance.mjs +0 -2
- package/dist/internal/nextjs/index.cjs +9 -11
- package/dist/internal/nextjs/index.mjs +6 -8
- package/dist/internal/nextjs/utils/index.cjs +0 -1
- package/dist/internal/nextjs/utils/index.mjs +0 -1
- package/dist/internal/sentry/index.cjs +2 -3
- package/dist/internal/sentry/index.mjs +1 -2
- package/dist/internal/sentry/sentry.client.config.cjs +6 -8
- package/dist/internal/sentry/sentry.client.config.mjs +2 -4
- package/dist/internal/tailwind/index.cjs +1 -3
- package/dist/internal/tailwind/index.mjs +0 -2
- package/dist/internal/wagmi/index.cjs +8 -11
- package/dist/internal/wagmi/index.mjs +4 -7
- package/dist/mainnet.cjs +3 -5
- package/dist/mainnet.mjs +2 -4
- package/dist/{sentry.edge.config-F4334LEP.cjs → sentry.edge.config-3Y5ABKSB.cjs} +4 -6
- package/dist/{sentry.edge.config-JU55FF2U.mjs → sentry.edge.config-SIWSKDGR.mjs} +2 -4
- package/dist/{sentry.server.config-M77KFJ6J.mjs → sentry.server.config-HY6I2WQ5.mjs} +2 -4
- package/dist/{sentry.server.config-KFRT37Q3.cjs → sentry.server.config-ZXGUVYT6.cjs} +4 -6
- package/package.json +1 -1
- package/dist/chunk-2XYRGOX3.mjs +0 -64
- package/dist/chunk-75ZPJI57.cjs +0 -9
- package/dist/chunk-7P6ASYW6.mjs +0 -9
- package/dist/chunk-ADH7F47T.cjs +0 -26
- package/dist/chunk-CAOMAWN5.mjs +0 -26
- package/dist/chunk-NX4FI7G3.cjs +0 -64
- package/dist/internal/edge-config/edgeConfig.codegen.d.ts +0 -344
- package/dist/internal/edge-config/edgeConfig.codegen.d.ts.map +0 -1
- package/dist/internal/edge-config/index.cjs +0 -37
- package/dist/internal/edge-config/index.d.ts +0 -5
- package/dist/internal/edge-config/index.d.ts.map +0 -1
- package/dist/internal/edge-config/index.mjs +0 -37
- package/dist/internal/edge-config/isFlagEnabled.d.ts +0 -17
- package/dist/internal/edge-config/isFlagEnabled.d.ts.map +0 -1
- package/dist/internal/edge-config/safeGetAll.d.ts +0 -15
- package/dist/internal/edge-config/safeGetAll.d.ts.map +0 -1
- package/dist/internal/edge-config/safeGetConfig.d.ts +0 -19
- package/dist/internal/edge-config/safeGetConfig.d.ts.map +0 -1
- package/dist/internal/flags/beraEdgeConfigAdapter.d.ts +0 -9
- package/dist/internal/flags/beraEdgeConfigAdapter.d.ts.map +0 -1
- package/dist/internal/flags/flags.d.ts +0 -29
- package/dist/internal/flags/flags.d.ts.map +0 -1
- package/dist/internal/flags/index.cjs +0 -206
- package/dist/internal/flags/index.d.ts +0 -2
- package/dist/internal/flags/index.d.ts.map +0 -1
- package/dist/internal/flags/index.mjs +0 -206
|
@@ -1,27 +1,80 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sentryEnvironment,
|
|
3
3
|
sentryRelease
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-OWAB24JG.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getUriFromLink
|
|
7
7
|
} from "../chunk-LALEUPWL.mjs";
|
|
8
8
|
import {
|
|
9
9
|
chainConfigs
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-IGYS2XEK.mjs";
|
|
11
11
|
import "../chunk-KPZI7IXR.mjs";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-5SH7AT43.mjs";
|
|
13
13
|
import {
|
|
14
14
|
alchemyJsonRpcUrl,
|
|
15
|
+
defaultChainId,
|
|
15
16
|
goldskyBaseUrl,
|
|
16
17
|
imageBaseUrl,
|
|
17
18
|
jsonRpcUrl,
|
|
18
19
|
publicJsonRpcUrl
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import {
|
|
21
|
-
defaultChainId
|
|
22
|
-
} from "../chunk-CAOMAWN5.mjs";
|
|
20
|
+
} from "../chunk-VWRKCGMU.mjs";
|
|
23
21
|
import "../chunk-KJXYSGNH.mjs";
|
|
24
|
-
|
|
22
|
+
|
|
23
|
+
// src/internal/dedupeCspSources.ts
|
|
24
|
+
function parseSource(raw) {
|
|
25
|
+
const schemeSplit = raw.indexOf("://");
|
|
26
|
+
if (schemeSplit === -1) {
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
const scheme = raw.slice(0, schemeSplit).toLowerCase();
|
|
30
|
+
const rest = raw.slice(schemeSplit + 3);
|
|
31
|
+
const pathStart = rest.indexOf("/");
|
|
32
|
+
const host = (pathStart === -1 ? rest : rest.slice(0, pathStart)).toLowerCase();
|
|
33
|
+
const path = pathStart === -1 ? "/" : rest.slice(pathStart);
|
|
34
|
+
if (!host) {
|
|
35
|
+
return void 0;
|
|
36
|
+
}
|
|
37
|
+
return { raw, scheme, host, path };
|
|
38
|
+
}
|
|
39
|
+
function hostMatches(patternHost, targetHost) {
|
|
40
|
+
if (!patternHost.startsWith("*.")) {
|
|
41
|
+
return patternHost === targetHost;
|
|
42
|
+
}
|
|
43
|
+
const suffix = patternHost.slice(1);
|
|
44
|
+
return targetHost.endsWith(suffix) && targetHost.length > suffix.length;
|
|
45
|
+
}
|
|
46
|
+
function covers(pattern, target) {
|
|
47
|
+
if (pattern.scheme !== target.scheme) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (!hostMatches(pattern.host, target.host)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (pattern.path === "/") {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
return target.path === pattern.path || target.path.startsWith(pattern.path);
|
|
57
|
+
}
|
|
58
|
+
function dedupeCspSources(sources) {
|
|
59
|
+
const parsed = sources.map((raw) => ({ raw, parsed: parseSource(raw) }));
|
|
60
|
+
return parsed.filter(({ parsed: target }, i) => {
|
|
61
|
+
if (!target) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return !parsed.some(({ parsed: pattern }, j) => {
|
|
65
|
+
if (i === j || !pattern) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (!covers(pattern, target)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
if (covers(target, pattern)) {
|
|
72
|
+
return j < i;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
});
|
|
76
|
+
}).map(({ raw }) => raw);
|
|
77
|
+
}
|
|
25
78
|
|
|
26
79
|
// src/internal/sentry/getSentryKeys.ts
|
|
27
80
|
function getSentryKeys({
|
|
@@ -60,146 +113,200 @@ function getSentryKeys({
|
|
|
60
113
|
}
|
|
61
114
|
|
|
62
115
|
// src/internal/header-sources.ts
|
|
116
|
+
var config = chainConfigs[defaultChainId];
|
|
117
|
+
var modules = {
|
|
118
|
+
berachain: {
|
|
119
|
+
connect: [
|
|
120
|
+
"https://*.berachain.com/",
|
|
121
|
+
"https://*.berachain-staging.com/",
|
|
122
|
+
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
123
|
+
`${imageBaseUrl}/`,
|
|
124
|
+
"https://*.quiknode.pro",
|
|
125
|
+
goldskyBaseUrl,
|
|
126
|
+
// Subgraph queries are served by same-origin typed REST endpoints under
|
|
127
|
+
// /api/honey/* and /api/pol/* (covered by 'self'), not direct browser
|
|
128
|
+
// requests to the upstream URLs.
|
|
129
|
+
config.pol.bribeBoostApi,
|
|
130
|
+
getUriFromLink(config.api),
|
|
131
|
+
jsonRpcUrl,
|
|
132
|
+
publicJsonRpcUrl,
|
|
133
|
+
alchemyJsonRpcUrl,
|
|
134
|
+
"https://api.routescan.io/v2/network/"
|
|
135
|
+
],
|
|
136
|
+
img: [
|
|
137
|
+
// trailing slash so sub-paths (e.g. /bend-curators/x.png/public) match;
|
|
138
|
+
// CSP path-matches exactly without it
|
|
139
|
+
`${imageBaseUrl}/`,
|
|
140
|
+
"https://raw.githubusercontent.com/berachain/metadata/"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
beranames: {
|
|
144
|
+
connect: [
|
|
145
|
+
// avatars
|
|
146
|
+
"https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/"
|
|
147
|
+
],
|
|
148
|
+
img: [
|
|
149
|
+
"https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/"
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
swapAggregators: {
|
|
153
|
+
connect: [
|
|
154
|
+
`${config.bex.aggregatorsProxyUrl}/`,
|
|
155
|
+
"https://open-api.openocean.finance/",
|
|
156
|
+
"https://api.haiku.trade/",
|
|
157
|
+
"https://api.fly.trade/",
|
|
158
|
+
"https://api.enso.finance/"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
walletConnect: {
|
|
162
|
+
connect: [
|
|
163
|
+
"wss://relay.walletconnect.com/",
|
|
164
|
+
"wss://relay.walletconnect.org/",
|
|
165
|
+
"https://verify.walletconnect.org/v3/public-key"
|
|
166
|
+
],
|
|
167
|
+
frame: [
|
|
168
|
+
"https://verify.walletconnect.com/",
|
|
169
|
+
"https://verify.walletconnect.org/"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
coinbaseWallet: {
|
|
173
|
+
connect: [
|
|
174
|
+
"wss://www.walletlink.org/rpc",
|
|
175
|
+
"https://www.walletlink.org/events",
|
|
176
|
+
"https://chain-proxy.wallet.coinbase.com/"
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
metamask: {
|
|
180
|
+
connect: [
|
|
181
|
+
"wss://metamask-sdk.api.cx.metamask.io/socket.io/",
|
|
182
|
+
"https://metamask-sdk.api.cx.metamask.io"
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
thirdweb: {
|
|
186
|
+
connect: ["https://*.thirdweb.com/"],
|
|
187
|
+
// export pk iframe
|
|
188
|
+
frame: ["https://embedded-wallet.thirdweb.com/"]
|
|
189
|
+
},
|
|
190
|
+
dynamic: {
|
|
191
|
+
connect: ["https://app.dynamicauth.com/api"]
|
|
192
|
+
},
|
|
193
|
+
porto: {
|
|
194
|
+
connect: ["https://rpc.porto.sh"],
|
|
195
|
+
frame: ["https://id.porto.sh"]
|
|
196
|
+
},
|
|
197
|
+
binance: {
|
|
198
|
+
connect: ["https://wallet.binance.com/tonbridge/"]
|
|
199
|
+
},
|
|
200
|
+
tron: {
|
|
201
|
+
connect: ["https://api.trongrid.io/"]
|
|
202
|
+
},
|
|
203
|
+
layerZero: {
|
|
204
|
+
connect: [
|
|
205
|
+
"https://api-mainnet.layerzero-scan.com/",
|
|
206
|
+
"https://api-testnet.layerzero-scan.com/"
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
pelagus: {
|
|
210
|
+
img: ["https://pelaguswallet.io/docs/img"]
|
|
211
|
+
},
|
|
212
|
+
externalRpcs: {
|
|
213
|
+
// non-Berachain chains read by wallets/bridges
|
|
214
|
+
connect: [
|
|
215
|
+
"https://api.avax.network/ext/bc/C/rpc",
|
|
216
|
+
"https://polygon-rpc.com",
|
|
217
|
+
"https://mainnet.optimism.io/",
|
|
218
|
+
"https://arb1.arbitrum.io/rpc",
|
|
219
|
+
"https://mainnet.base.org/",
|
|
220
|
+
"https://eth.merkle.io"
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
tokenIcons: {
|
|
224
|
+
img: [
|
|
225
|
+
"https://assets.coingecko.com/coins/images/",
|
|
226
|
+
"https://coin-images.coingecko.com/coins/images/",
|
|
227
|
+
"https://icons.llama.fi/",
|
|
228
|
+
"https://icons.llamao.fi/",
|
|
229
|
+
"https://static.debank.com/",
|
|
230
|
+
"https://raw.githubusercontent.com/trustwallet/assets/"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
bend: {
|
|
234
|
+
connect: [
|
|
235
|
+
// used to fetch tokens
|
|
236
|
+
"https://cdn.whisk.so/"
|
|
237
|
+
],
|
|
238
|
+
img: ["https://cdn.whisk.so/", "https://cdn.morpho.org/"]
|
|
239
|
+
},
|
|
240
|
+
pyth: {
|
|
241
|
+
connect: ["https://hermes.pyth.network/v2/"]
|
|
242
|
+
},
|
|
243
|
+
fonts: {
|
|
244
|
+
font: [
|
|
245
|
+
"https://cdn.jsdelivr.net/npm/@fontsource/",
|
|
246
|
+
// collected by sentry (needed by browser extensions)
|
|
247
|
+
"https://fonts.gstatic.com",
|
|
248
|
+
"https://use.typekit.net/"
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
sentry: {
|
|
252
|
+
// csp reporting
|
|
253
|
+
connect: ["https://*.sentry.io/"]
|
|
254
|
+
},
|
|
255
|
+
posthog: {
|
|
256
|
+
// toolbar + heatmaps
|
|
257
|
+
connect: ["https://*.posthog.com"],
|
|
258
|
+
img: ["https://*.posthog.com"],
|
|
259
|
+
frame: ["https://*.posthog.com"],
|
|
260
|
+
font: ["https://*.posthog.com"],
|
|
261
|
+
style: ["https://*.posthog.com"]
|
|
262
|
+
},
|
|
263
|
+
vercel: {
|
|
264
|
+
// toolbar + live comments
|
|
265
|
+
connect: ["https://vercel.live", "wss://ws-us3.pusher.com"],
|
|
266
|
+
img: ["https://vercel.live", "https://vercel.com"],
|
|
267
|
+
frame: ["https://vercel.live/"],
|
|
268
|
+
font: ["https://vercel.live", "https://assets.vercel.com"],
|
|
269
|
+
style: ["https://vercel.live"]
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
var headerSourceModules = modules;
|
|
63
273
|
function getContentSecurityPolicy({
|
|
64
274
|
isDevelopment,
|
|
65
275
|
nonce,
|
|
66
276
|
cspReporting,
|
|
277
|
+
modules: enabledModules = {},
|
|
67
278
|
...args
|
|
68
279
|
}) {
|
|
69
280
|
const defaultSrc = [];
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
"https://verify.walletconnect.org/v3/public-key",
|
|
100
|
-
"https://api.routescan.io/v2/network/",
|
|
101
|
-
"wss://metamask-sdk.api.cx.metamask.io/socket.io/",
|
|
102
|
-
"https://metamask-sdk.api.cx.metamask.io",
|
|
103
|
-
"https://app.dynamicauth.com/api",
|
|
104
|
-
"https://www.walletlink.org/events",
|
|
105
|
-
"https://api.trongrid.io/",
|
|
106
|
-
"https://api-mainnet.layerzero-scan.com/",
|
|
107
|
-
"https://api-testnet.layerzero-scan.com/",
|
|
108
|
-
"https://chain-proxy.wallet.coinbase.com/",
|
|
109
|
-
"https://wallet.binance.com/tonbridge/",
|
|
110
|
-
"https://*.thirdweb.com/",
|
|
111
|
-
"https://eth.merkle.io/",
|
|
112
|
-
"https://cdn.whisk.so/",
|
|
113
|
-
// use to fetch tokens
|
|
114
|
-
// POSTHOG TOOLBAR
|
|
115
|
-
"https://*.posthog.com",
|
|
116
|
-
// VERCEL TOOLBAR
|
|
117
|
-
"https://vercel.live",
|
|
118
|
-
"wss://ws-us3.pusher.com",
|
|
119
|
-
// PYTH
|
|
120
|
-
"https://hermes.pyth.network/v2/",
|
|
121
|
-
// PORTO WALLET
|
|
122
|
-
"https://rpc.porto.sh",
|
|
123
|
-
// external rpc urls
|
|
124
|
-
"https://api.avax.network/ext/bc/C/rpc",
|
|
125
|
-
"https://polygon-rpc.com",
|
|
126
|
-
"https://mainnet.optimism.io/",
|
|
127
|
-
"https://arb1.arbitrum.io/rpc",
|
|
128
|
-
"wss://www.walletlink.org/rpc",
|
|
129
|
-
"https://eth.merkle.io",
|
|
130
|
-
"https://mainnet.base.org/",
|
|
131
|
-
// enso api
|
|
132
|
-
"https://api.enso.finance/",
|
|
133
|
-
"wss://www.walletlink.org/rpc"
|
|
134
|
-
].concat(args.connectionSources ?? []).filter((link) => {
|
|
135
|
-
if (!link) {
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
const url = getUriFromLink(link);
|
|
139
|
-
if (!url || url.trim() === "") {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
if (url.startsWith(goldskyBaseUrl) && url !== goldskyBaseUrl) {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
return true;
|
|
146
|
-
});
|
|
147
|
-
const pictureSources = [
|
|
148
|
-
imageBaseUrl,
|
|
149
|
-
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
150
|
-
"https://assets.coingecko.com/coins/images/",
|
|
151
|
-
"https://coin-images.coingecko.com/coins/images/",
|
|
152
|
-
"https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/",
|
|
153
|
-
"https://icons.llama.fi/",
|
|
154
|
-
"https://icons.llamao.fi/",
|
|
155
|
-
"https://static.debank.com/",
|
|
156
|
-
"https://cdn.whisk.so/",
|
|
157
|
-
// bend
|
|
158
|
-
"https://cdn.morpho.org/",
|
|
159
|
-
// bend
|
|
160
|
-
"https://raw.githubusercontent.com/trustwallet/assets/",
|
|
161
|
-
// bend
|
|
162
|
-
"https://pelaguswallet.io/docs/img",
|
|
163
|
-
// POSTHOG TOOLBAR
|
|
164
|
-
"https://*.posthog.com",
|
|
165
|
-
// VERCEL TOOLBAR
|
|
166
|
-
"https://vercel.live",
|
|
167
|
-
"https://vercel.com"
|
|
168
|
-
].concat(args.pictureSources ?? []).filter((url) => {
|
|
169
|
-
if (!url || url.trim() === "") {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
return true;
|
|
173
|
-
});
|
|
174
|
-
const frameSources = [
|
|
175
|
-
"https://verify.walletconnect.com/",
|
|
176
|
-
"https://verify.walletconnect.org/",
|
|
177
|
-
// thirdweb export pk iframe
|
|
178
|
-
"https://embedded-wallet.thirdweb.com/",
|
|
179
|
-
// POSTHOG TOOLBAR
|
|
180
|
-
"https://*.posthog.com",
|
|
181
|
-
// VERCEL TOOLBAR
|
|
182
|
-
"https://vercel.live/",
|
|
183
|
-
// PORTO WALLET
|
|
184
|
-
"https://id.porto.sh"
|
|
185
|
-
].concat(args.frameSources ?? []);
|
|
186
|
-
const fontSources = [
|
|
187
|
-
"https://cdn.jsdelivr.net/npm/@fontsource/",
|
|
188
|
-
// POSTHOG TOOLBAR
|
|
189
|
-
"https://*.posthog.com",
|
|
190
|
-
// VERCEL TOOLBAR
|
|
191
|
-
"https://vercel.live",
|
|
192
|
-
"https://assets.vercel.com",
|
|
193
|
-
// collected by sentry (need by browsers extensions)
|
|
194
|
-
"https://fonts.gstatic.com",
|
|
195
|
-
"https://use.typekit.net/"
|
|
196
|
-
].concat(args.fontSources ?? []);
|
|
197
|
-
const styleSources = [
|
|
198
|
-
// POSTHOG TOOLBAR
|
|
199
|
-
"https://*.posthog.com",
|
|
200
|
-
// VERCEL TOOLBAR
|
|
201
|
-
"https://vercel.live"
|
|
202
|
-
].concat(args.styleSources ?? []);
|
|
281
|
+
function collect(directive) {
|
|
282
|
+
return Object.entries(headerSourceModules).filter(
|
|
283
|
+
([module]) => enabledModules[module] !== false
|
|
284
|
+
).flatMap(([, sources]) => sources[directive] ?? []).filter((url) => Boolean(url?.trim()));
|
|
285
|
+
}
|
|
286
|
+
const connectionSources = dedupeCspSources(
|
|
287
|
+
collect("connect").concat(args.connectionSources ?? []).filter((link) => {
|
|
288
|
+
const url = getUriFromLink(link);
|
|
289
|
+
if (!url || url.trim() === "") {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
if (url.startsWith(goldskyBaseUrl) && url !== goldskyBaseUrl) {
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
return true;
|
|
296
|
+
})
|
|
297
|
+
);
|
|
298
|
+
const pictureSources = dedupeCspSources(
|
|
299
|
+
collect("img").concat(args.pictureSources ?? [])
|
|
300
|
+
);
|
|
301
|
+
const frameSources = dedupeCspSources(
|
|
302
|
+
collect("frame").concat(args.frameSources ?? [])
|
|
303
|
+
);
|
|
304
|
+
const fontSources = dedupeCspSources(
|
|
305
|
+
collect("font").concat(args.fontSources ?? [])
|
|
306
|
+
);
|
|
307
|
+
const styleSources = dedupeCspSources(
|
|
308
|
+
collect("style").concat(args.styleSources ?? [])
|
|
309
|
+
);
|
|
203
310
|
let cspHeader = `
|
|
204
311
|
default-src 'self' ${defaultSrc.join(" ")};
|
|
205
312
|
base-uri 'self';
|
|
@@ -223,7 +330,7 @@ function getContentSecurityPolicy({
|
|
|
223
330
|
}
|
|
224
331
|
var staticPictureSources = [
|
|
225
332
|
// Only add image delivery URL if it exists and can be processed
|
|
226
|
-
imageBaseUrl
|
|
333
|
+
`${imageBaseUrl}/`,
|
|
227
334
|
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
228
335
|
"https://assets.coingecko.com/coins/images/",
|
|
229
336
|
"https://berachain.ghost.io/content/images/"
|
|
@@ -234,7 +341,8 @@ var staticPictureSources = [
|
|
|
234
341
|
return true;
|
|
235
342
|
});
|
|
236
343
|
function cspMiddleware({
|
|
237
|
-
response
|
|
344
|
+
response,
|
|
345
|
+
modules: modules2
|
|
238
346
|
}) {
|
|
239
347
|
const sentryCspEndpoint = getSentryKeys()?.cspEndpoint;
|
|
240
348
|
const nonce = Buffer.from(crypto.randomUUID()).toString("base64");
|
|
@@ -245,7 +353,8 @@ function cspMiddleware({
|
|
|
245
353
|
value: getContentSecurityPolicy({
|
|
246
354
|
isDevelopment,
|
|
247
355
|
cspReporting: sentryCspEndpoint?.toString(),
|
|
248
|
-
nonce
|
|
356
|
+
nonce,
|
|
357
|
+
modules: modules2
|
|
249
358
|
})
|
|
250
359
|
},
|
|
251
360
|
{
|
|
@@ -279,5 +388,6 @@ function cspMiddleware({
|
|
|
279
388
|
export {
|
|
280
389
|
cspMiddleware,
|
|
281
390
|
getContentSecurityPolicy,
|
|
391
|
+
headerSourceModules,
|
|
282
392
|
staticPictureSources
|
|
283
393
|
};
|
package/dist/internal/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkSHM2VD4Acjs = require('../chunk-SHM2VD4A.cjs');
|
|
6
6
|
require('../chunk-MQOVN5NH.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-ZJEZCW5Z.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -13,15 +13,12 @@ require('../chunk-EPWUWEWI.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var _chunkWRTYGXJMcjs = require('../chunk-WRTYGXJM.cjs');
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
var _chunkADH7F47Tcjs = require('../chunk-ADH7F47T.cjs');
|
|
18
|
+
var _chunkAU3LYJABcjs = require('../chunk-AU3LYJAB.cjs');
|
|
21
19
|
|
|
22
20
|
|
|
23
21
|
var _chunkEYYJ2UZTcjs = require('../chunk-EYYJ2UZT.cjs');
|
|
24
|
-
require('../chunk-75ZPJI57.cjs');
|
|
25
22
|
|
|
26
23
|
|
|
27
24
|
|
|
@@ -37,4 +34,4 @@ require('../chunk-75ZPJI57.cjs');
|
|
|
37
34
|
|
|
38
35
|
|
|
39
36
|
|
|
40
|
-
exports.ChainId = _chunkEYYJ2UZTcjs.ChainId; exports.alchemyJsonRpcUrl =
|
|
37
|
+
exports.ChainId = _chunkEYYJ2UZTcjs.ChainId; exports.alchemyJsonRpcUrl = _chunkAU3LYJABcjs.alchemyJsonRpcUrl; exports.appConfig = _chunkSHM2VD4Acjs.appConfig; exports.chainConfigs = _chunkSHM2VD4Acjs.chainConfigs; exports.chainId = _chunkAU3LYJABcjs.defaultChainId; exports.config = _chunkSHM2VD4Acjs.config; exports.currentDapp = _chunkAU3LYJABcjs.currentDapp; exports.defaultChainId = _chunkAU3LYJABcjs.defaultChainId; exports.getRpcUrls = _chunkAU3LYJABcjs.getRpcUrls; exports.goldskyBaseUrl = _chunkAU3LYJABcjs.goldskyBaseUrl; exports.imageBaseUrl = _chunkAU3LYJABcjs.imageBaseUrl; exports.jsonRpcUrl = _chunkAU3LYJABcjs.jsonRpcUrl; exports.privateRcpUrl = _chunkAU3LYJABcjs.privateRcpUrl; exports.publicJsonRpcUrl = _chunkAU3LYJABcjs.publicJsonRpcUrl;
|
package/dist/internal/index.mjs
CHANGED
|
@@ -2,26 +2,23 @@ import {
|
|
|
2
2
|
appConfig,
|
|
3
3
|
chainConfigs,
|
|
4
4
|
config
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-IGYS2XEK.mjs";
|
|
6
6
|
import "../chunk-KPZI7IXR.mjs";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-5SH7AT43.mjs";
|
|
8
8
|
import {
|
|
9
9
|
alchemyJsonRpcUrl,
|
|
10
|
+
currentDapp,
|
|
11
|
+
defaultChainId,
|
|
10
12
|
getRpcUrls,
|
|
11
13
|
goldskyBaseUrl,
|
|
12
14
|
imageBaseUrl,
|
|
13
15
|
jsonRpcUrl,
|
|
14
16
|
privateRcpUrl,
|
|
15
17
|
publicJsonRpcUrl
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import {
|
|
18
|
-
currentDapp,
|
|
19
|
-
defaultChainId
|
|
20
|
-
} from "../chunk-CAOMAWN5.mjs";
|
|
18
|
+
} from "../chunk-VWRKCGMU.mjs";
|
|
21
19
|
import {
|
|
22
20
|
ChainId
|
|
23
21
|
} from "../chunk-KJXYSGNH.mjs";
|
|
24
|
-
import "../chunk-7P6ASYW6.mjs";
|
|
25
22
|
export {
|
|
26
23
|
ChainId,
|
|
27
24
|
alchemyJsonRpcUrl,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
2
|
-
|
|
3
|
-
// src/internal/maintenance.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/internal/maintenance.ts
|
|
4
2
|
var _server = require('next/server');
|
|
5
3
|
var DEFAULT_MAINTENANCE_EXEMPT_PATHS = [
|
|
6
4
|
"/maintenance",
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var _chunk3NQ3NFWWcjs = require('../../chunk-3NQ3NFWW.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
var _chunkOA5M6XYFcjs = require('../../chunk-OA5M6XYF.cjs');
|
|
7
4
|
|
|
8
5
|
|
|
9
|
-
var
|
|
6
|
+
var _chunkSHM2VD4Acjs = require('../../chunk-SHM2VD4A.cjs');
|
|
10
7
|
require('../../chunk-MQOVN5NH.cjs');
|
|
11
|
-
require('../../chunk-
|
|
12
|
-
require('../../chunk-
|
|
13
|
-
require('../../chunk-ADH7F47T.cjs');
|
|
8
|
+
require('../../chunk-ZJEZCW5Z.cjs');
|
|
9
|
+
require('../../chunk-AU3LYJAB.cjs');
|
|
14
10
|
require('../../chunk-EYYJ2UZT.cjs');
|
|
15
|
-
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkZTYHPIUWcjs = require('../../chunk-ZTYHPIUW.cjs');
|
|
16
14
|
|
|
17
15
|
// src/internal/nextjs/index.ts
|
|
18
16
|
var _dotenv = require('dotenv'); var _dotenv2 = _interopRequireDefault(_dotenv);
|
|
@@ -64,11 +62,11 @@ function withBeraConfig(config, {
|
|
|
64
62
|
return [
|
|
65
63
|
{
|
|
66
64
|
source: "/ph/static/:path*",
|
|
67
|
-
destination: `https://${
|
|
65
|
+
destination: `https://${_chunkSHM2VD4Acjs.appConfig.urls.postHog.region}-assets.i.posthog.com/static/:path*`
|
|
68
66
|
},
|
|
69
67
|
{
|
|
70
68
|
source: "/ph/:path*",
|
|
71
|
-
destination: `https://${
|
|
69
|
+
destination: `https://${_chunkSHM2VD4Acjs.appConfig.urls.postHog.region}.i.posthog.com/:path*`
|
|
72
70
|
}
|
|
73
71
|
];
|
|
74
72
|
}
|
|
@@ -77,7 +75,7 @@ function withBeraConfig(config, {
|
|
|
77
75
|
nextConfig.env.NEXT_PUBLIC_PH_REVERSE_PROXY_PATH = "/ph";
|
|
78
76
|
nextConfig.skipTrailingSlashRedirect = true;
|
|
79
77
|
}
|
|
80
|
-
if (withSentry) return
|
|
78
|
+
if (withSentry) return _chunkZTYHPIUWcjs.withSentryConfig.call(void 0, nextConfig);
|
|
81
79
|
return nextConfig;
|
|
82
80
|
}
|
|
83
81
|
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
withSentryConfig
|
|
3
|
-
} from "../../chunk-4UCGQIWY.mjs";
|
|
4
1
|
import {
|
|
5
2
|
IMAGE_REMOTE_PATTERNS
|
|
6
3
|
} from "../../chunk-4WAGOEXT.mjs";
|
|
7
4
|
import {
|
|
8
5
|
appConfig
|
|
9
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-IGYS2XEK.mjs";
|
|
10
7
|
import "../../chunk-KPZI7IXR.mjs";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-CAOMAWN5.mjs";
|
|
8
|
+
import "../../chunk-5SH7AT43.mjs";
|
|
9
|
+
import "../../chunk-VWRKCGMU.mjs";
|
|
14
10
|
import "../../chunk-KJXYSGNH.mjs";
|
|
15
|
-
import
|
|
11
|
+
import {
|
|
12
|
+
withSentryConfig
|
|
13
|
+
} from "../../chunk-XA5DMTFW.mjs";
|
|
16
14
|
|
|
17
15
|
// src/internal/nextjs/index.ts
|
|
18
16
|
import dotenv from "dotenv";
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../chunk-75ZPJI57.cjs');
|
|
5
|
+
var _chunkZTYHPIUWcjs = require('../../chunk-ZTYHPIUW.cjs');
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
exports.onRequestError =
|
|
10
|
+
exports.onRequestError = _chunkZTYHPIUWcjs.onRequestError; exports.registerSentry = _chunkZTYHPIUWcjs.registerSentry; exports.withSentryConfig = _chunkZTYHPIUWcjs.withSentryConfig;
|