@berachain/config 0.1.19 → 0.1.20-beta.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/bepolia.cjs +8 -1
- package/dist/bepolia.mjs +8 -1
- package/dist/chunk-2XYRGOX3.mjs +64 -0
- package/dist/chunk-3K6IUX3G.mjs +25 -0
- package/dist/chunk-4H4HDUCC.mjs +179 -0
- package/dist/chunk-4WAGOEXT.mjs +91 -0
- package/dist/chunk-6TL5ZQOM.cjs +75 -0
- package/dist/chunk-6YB3DKEA.mjs +169 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/chunk-7P6ASYW6.mjs +9 -0
- package/dist/chunk-7RKCKAAC.cjs +138 -0
- package/dist/chunk-ADH7F47T.cjs +26 -0
- package/dist/chunk-B3NSVIEM.mjs +138 -0
- package/dist/chunk-BM46XQJA.mjs +55 -0
- package/dist/chunk-CAOMAWN5.mjs +26 -0
- package/dist/chunk-EYYJ2UZT.cjs +10 -0
- package/dist/chunk-FNTZIXS7.cjs +179 -0
- package/dist/chunk-KJXYSGNH.mjs +10 -0
- package/dist/chunk-LALEUPWL.mjs +8 -0
- package/dist/chunk-NFEXQHYQ.cjs +169 -0
- package/dist/chunk-NQ3UKQHW.mjs +75 -0
- package/dist/chunk-NX4FI7G3.cjs +64 -0
- package/dist/chunk-OA5M6XYF.cjs +91 -0
- package/dist/chunk-ONKAV4AG.cjs +25 -0
- package/dist/chunk-WRTYGXJM.cjs +55 -0
- package/dist/chunk-YT7WZDGI.cjs +8 -0
- package/dist/index.cjs +11 -1
- package/dist/index.mjs +11 -1
- package/dist/internal/edge-config/index.cjs +37 -1
- package/dist/internal/edge-config/index.d.cts +81 -6
- package/dist/internal/edge-config/index.d.ts +81 -6
- package/dist/internal/edge-config/index.mjs +37 -1
- package/dist/internal/flags/index.cjs +206 -1
- package/dist/internal/flags/index.mjs +206 -1
- package/dist/internal/header-sources.cjs +283 -11
- package/dist/internal/header-sources.mjs +283 -11
- package/dist/internal/index.cjs +40 -1
- package/dist/internal/index.mjs +40 -1
- package/dist/internal/maintenance.cjs +26 -1
- package/dist/internal/maintenance.mjs +26 -1
- package/dist/internal/nextjs/index.cjs +85 -1
- package/dist/internal/nextjs/index.mjs +85 -1
- package/dist/internal/nextjs/utils/index.cjs +39 -1
- package/dist/internal/nextjs/utils/index.mjs +39 -1
- package/dist/internal/sentry/index.cjs +11 -1
- package/dist/internal/sentry/index.mjs +11 -1
- package/dist/internal/sentry/sentry.client.config.cjs +67 -1
- package/dist/internal/sentry/sentry.client.config.mjs +67 -1
- package/dist/internal/tailwind/index.cjs +239 -1
- package/dist/internal/tailwind/index.mjs +239 -1
- package/dist/internal/tsup/index.cjs +73 -1
- package/dist/internal/tsup/index.mjs +73 -1
- package/dist/internal/wagmi/index.cjs +60 -1
- package/dist/internal/wagmi/index.mjs +60 -1
- package/dist/mainnet.cjs +10 -1
- package/dist/mainnet.mjs +10 -1
- package/dist/sentry.edge.config-F4334LEP.cjs +24 -0
- package/dist/sentry.edge.config-JU55FF2U.mjs +24 -0
- package/dist/sentry.server.config-KFRT37Q3.cjs +24 -0
- package/dist/sentry.server.config-M77KFJ6J.mjs +24 -0
- package/package.json +1 -1
- package/dist/chunk-276AZYTL.cjs +0 -1
- package/dist/chunk-2HIIMZE4.cjs +0 -1
- package/dist/chunk-2OLL4MUY.cjs +0 -1
- package/dist/chunk-3KQLFIHT.cjs +0 -2
- package/dist/chunk-3WZ7JUD6.cjs +0 -1
- package/dist/chunk-4EBBM3AH.mjs +0 -1
- package/dist/chunk-4EBC3WWP.mjs +0 -1
- package/dist/chunk-4VDLQK6F.cjs +0 -1
- package/dist/chunk-BWV5APOW.cjs +0 -1
- package/dist/chunk-DL645PXT.mjs +0 -1
- package/dist/chunk-DUO7UEQD.cjs +0 -1
- package/dist/chunk-DVULZ7ID.cjs +0 -1
- package/dist/chunk-FVNATITS.mjs +0 -1
- package/dist/chunk-FZ23S6ID.mjs +0 -1
- package/dist/chunk-JYSZ2GU3.cjs +0 -1
- package/dist/chunk-JZXLCA2E.mjs +0 -1
- package/dist/chunk-LCQFSMRO.mjs +0 -1
- package/dist/chunk-MB5HZZ3S.mjs +0 -1
- package/dist/chunk-MS6UGFXI.mjs +0 -1
- package/dist/chunk-O243TIHY.mjs +0 -1
- package/dist/chunk-S2A3Z34I.mjs +0 -2
- package/dist/chunk-S5CMEFTY.cjs +0 -1
- package/dist/chunk-VPOS7FPU.cjs +0 -1
- package/dist/chunk-XO2H4NRK.mjs +0 -1
- package/dist/sentry.edge.config-DS2KE3CX.cjs +0 -1
- package/dist/sentry.edge.config-OEQTPQ2L.mjs +0 -1
- package/dist/sentry.server.config-KRS7OUMO.mjs +0 -1
- package/dist/sentry.server.config-RNY6FTJT.cjs +0 -1
|
@@ -1 +1,206 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
isFlagEnabled
|
|
3
|
+
} from "../../chunk-2XYRGOX3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
isProduction
|
|
6
|
+
} from "../../chunk-CAOMAWN5.mjs";
|
|
7
|
+
import "../../chunk-KJXYSGNH.mjs";
|
|
8
|
+
import {
|
|
9
|
+
__export
|
|
10
|
+
} from "../../chunk-7P6ASYW6.mjs";
|
|
11
|
+
|
|
12
|
+
// src/internal/flags/flags.ts
|
|
13
|
+
var flags_exports = {};
|
|
14
|
+
__export(flags_exports, {
|
|
15
|
+
enableBexFundsRecovery: () => enableBexFundsRecovery,
|
|
16
|
+
enableEip5792: () => enableEip5792,
|
|
17
|
+
enableSimulateCalls: () => enableSimulateCalls,
|
|
18
|
+
hideStakeForSingleHolderVaults: () => hideStakeForSingleHolderVaults,
|
|
19
|
+
isAirdropLive: () => isAirdropLive,
|
|
20
|
+
isBendLoopingEnabled: () => isBendLoopingEnabled,
|
|
21
|
+
isBendNew: () => isBendNew,
|
|
22
|
+
isBendVaultDataHourly: () => isBendVaultDataHourly,
|
|
23
|
+
isBgtPolRewardToken: () => isBgtPolRewardToken,
|
|
24
|
+
isDefaultStakingPoolEnabled: () => isDefaultStakingPoolEnabled,
|
|
25
|
+
isEmbeddedWalletsEnabled: () => isEmbeddedWalletsEnabled,
|
|
26
|
+
isGovernanceEnabled: () => isGovernanceEnabled,
|
|
27
|
+
isHoneyPythWrapperEnabled: () => isHoneyPythWrapperEnabled,
|
|
28
|
+
isMultiChainZapBendEnabled: () => isMultiChainZapBendEnabled,
|
|
29
|
+
isPoolsMerged: () => isPoolsMerged,
|
|
30
|
+
isRefundInExplorer: () => isRefundInExplorer,
|
|
31
|
+
isZapStakeBeraEnabled: () => isZapStakeBeraEnabled,
|
|
32
|
+
mockIncentiveManager: () => mockIncentiveManager,
|
|
33
|
+
mockRewardDurationManager: () => mockRewardDurationManager,
|
|
34
|
+
mockValidatorOperator: () => mockValidatorOperator,
|
|
35
|
+
mockValidatorRewardAllocator: () => mockValidatorRewardAllocator,
|
|
36
|
+
proxyAggregatorsThroughVercel: () => proxyAggregatorsThroughVercel,
|
|
37
|
+
showBendVaultCap: () => showBendVaultCap,
|
|
38
|
+
sponsorGas: () => sponsorGas
|
|
39
|
+
});
|
|
40
|
+
import { flag } from "flags/next";
|
|
41
|
+
|
|
42
|
+
// src/internal/flags/beraEdgeConfigAdapter.ts
|
|
43
|
+
import { edgeConfigAdapter } from "@flags-sdk/edge-config";
|
|
44
|
+
function beraEdgeConfigAdapter({ adapter } = {
|
|
45
|
+
adapter: edgeConfigAdapter()
|
|
46
|
+
}) {
|
|
47
|
+
return {
|
|
48
|
+
...adapter,
|
|
49
|
+
async decide(params) {
|
|
50
|
+
if (isProduction && params.key.startsWith("mock")) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const value = await adapter.decide(params);
|
|
54
|
+
return isFlagEnabled(value);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/internal/flags/flags.ts
|
|
60
|
+
var isGovernanceEnabled = flag({
|
|
61
|
+
key: "isGovernanceEnabled",
|
|
62
|
+
description: "Enable Governance proposals",
|
|
63
|
+
defaultValue: true,
|
|
64
|
+
adapter: beraEdgeConfigAdapter()
|
|
65
|
+
});
|
|
66
|
+
var hideStakeForSingleHolderVaults = flag({
|
|
67
|
+
key: "hideStakeForSingleHolderVaults",
|
|
68
|
+
description: "Hide stake for single holder vaults",
|
|
69
|
+
defaultValue: true,
|
|
70
|
+
adapter: beraEdgeConfigAdapter()
|
|
71
|
+
});
|
|
72
|
+
var enableSimulateCalls = flag({
|
|
73
|
+
key: "enableSimulateCalls",
|
|
74
|
+
description: "Controls the support of eth_simulateV1 from bera-reth/bera-geth",
|
|
75
|
+
defaultValue: false,
|
|
76
|
+
adapter: beraEdgeConfigAdapter()
|
|
77
|
+
});
|
|
78
|
+
var enableBexFundsRecovery = flag({
|
|
79
|
+
key: "enableBexFundsRecovery",
|
|
80
|
+
description: "Enable BEX funds recovery",
|
|
81
|
+
defaultValue: true,
|
|
82
|
+
adapter: beraEdgeConfigAdapter()
|
|
83
|
+
});
|
|
84
|
+
var isRefundInExplorer = flag({
|
|
85
|
+
key: "isRefundInExplorer",
|
|
86
|
+
description: "Show Refund link in the Explorer dropdown",
|
|
87
|
+
defaultValue: false,
|
|
88
|
+
adapter: beraEdgeConfigAdapter()
|
|
89
|
+
});
|
|
90
|
+
var isAirdropLive = flag({
|
|
91
|
+
key: "isAirdropLive",
|
|
92
|
+
description: "Show Airdrop link in the Explorer dropdown",
|
|
93
|
+
defaultValue: false,
|
|
94
|
+
adapter: beraEdgeConfigAdapter()
|
|
95
|
+
});
|
|
96
|
+
var isEmbeddedWalletsEnabled = flag({
|
|
97
|
+
key: "isEmbeddedWalletsEnabled",
|
|
98
|
+
description: "Enable embedded wallets",
|
|
99
|
+
defaultValue: true,
|
|
100
|
+
adapter: beraEdgeConfigAdapter()
|
|
101
|
+
});
|
|
102
|
+
var sponsorGas = flag({
|
|
103
|
+
key: "sponsorGas",
|
|
104
|
+
description: "Enable gasless transactions for embedded wallets",
|
|
105
|
+
defaultValue: false,
|
|
106
|
+
adapter: beraEdgeConfigAdapter()
|
|
107
|
+
});
|
|
108
|
+
var enableEip5792 = flag({
|
|
109
|
+
key: "enableEip5792",
|
|
110
|
+
description: "Enable EIP-5792 to allow batch transactions if wallet supports it",
|
|
111
|
+
defaultValue: true,
|
|
112
|
+
adapter: beraEdgeConfigAdapter()
|
|
113
|
+
});
|
|
114
|
+
var proxyAggregatorsThroughVercel = flag({
|
|
115
|
+
key: "proxyAggregatorsThroughVercel",
|
|
116
|
+
description: "Proxy aggregators quotes through Vercel instead of proxy gateway",
|
|
117
|
+
defaultValue: false,
|
|
118
|
+
adapter: beraEdgeConfigAdapter()
|
|
119
|
+
});
|
|
120
|
+
var isDefaultStakingPoolEnabled = flag({
|
|
121
|
+
key: "isDefaultStakingPoolEnabled",
|
|
122
|
+
description: "Enable default staking pools",
|
|
123
|
+
defaultValue: true,
|
|
124
|
+
adapter: beraEdgeConfigAdapter()
|
|
125
|
+
});
|
|
126
|
+
var isBendVaultDataHourly = flag({
|
|
127
|
+
key: "isBendVaultDataHourly",
|
|
128
|
+
description: "Enable bend vault data to be fetched hourly",
|
|
129
|
+
defaultValue: true,
|
|
130
|
+
adapter: beraEdgeConfigAdapter()
|
|
131
|
+
});
|
|
132
|
+
var showBendVaultCap = flag({
|
|
133
|
+
key: "showBendVaultCap",
|
|
134
|
+
description: "Show the vault deposit cap (the max total supply) on Bend vault surfaces. When off, only the total deposited amount is shown.",
|
|
135
|
+
defaultValue: true,
|
|
136
|
+
adapter: beraEdgeConfigAdapter()
|
|
137
|
+
});
|
|
138
|
+
var isHoneyPythWrapperEnabled = flag({
|
|
139
|
+
key: "isHoneyPythWrapperEnabled",
|
|
140
|
+
description: "Update pyth prices when minting or redeeming Honey",
|
|
141
|
+
defaultValue: false,
|
|
142
|
+
adapter: beraEdgeConfigAdapter()
|
|
143
|
+
});
|
|
144
|
+
var isBendNew = flag({
|
|
145
|
+
key: "isBendNew",
|
|
146
|
+
description: "Enable Bend live",
|
|
147
|
+
defaultValue: false,
|
|
148
|
+
adapter: beraEdgeConfigAdapter()
|
|
149
|
+
});
|
|
150
|
+
var isPoolsMerged = flag({
|
|
151
|
+
key: "isPoolsMerged",
|
|
152
|
+
description: "Enable Pools merged",
|
|
153
|
+
defaultValue: true,
|
|
154
|
+
adapter: beraEdgeConfigAdapter()
|
|
155
|
+
});
|
|
156
|
+
var isBendLoopingEnabled = flag({
|
|
157
|
+
key: "isBendLoopingEnabled",
|
|
158
|
+
description: "Enable multiply/demultiply looping in Bend markets",
|
|
159
|
+
defaultValue: false,
|
|
160
|
+
adapter: beraEdgeConfigAdapter()
|
|
161
|
+
});
|
|
162
|
+
var isMultiChainZapBendEnabled = flag({
|
|
163
|
+
key: "isMultiChainZapBendEnabled",
|
|
164
|
+
description: "Enable multi chain zap for Bend",
|
|
165
|
+
defaultValue: false,
|
|
166
|
+
adapter: beraEdgeConfigAdapter()
|
|
167
|
+
});
|
|
168
|
+
var isZapStakeBeraEnabled = flag({
|
|
169
|
+
key: "isZapStakeBeraEnabled",
|
|
170
|
+
description: "Enable multi chain zap for Staking BERA",
|
|
171
|
+
defaultValue: false,
|
|
172
|
+
adapter: beraEdgeConfigAdapter()
|
|
173
|
+
});
|
|
174
|
+
var isBgtPolRewardToken = flag({
|
|
175
|
+
key: "isBgtPolRewardToken",
|
|
176
|
+
description: "Whether the BGT reward token is the POL reward token",
|
|
177
|
+
defaultValue: true,
|
|
178
|
+
adapter: beraEdgeConfigAdapter()
|
|
179
|
+
});
|
|
180
|
+
var mockValidatorOperator = flag({
|
|
181
|
+
key: "mockValidatorOperator",
|
|
182
|
+
description: "Mock validator role",
|
|
183
|
+
defaultValue: false,
|
|
184
|
+
adapter: beraEdgeConfigAdapter()
|
|
185
|
+
});
|
|
186
|
+
var mockValidatorRewardAllocator = flag({
|
|
187
|
+
key: "mockValidatorRewardAllocator",
|
|
188
|
+
description: "Mock validator reward allocator",
|
|
189
|
+
defaultValue: false,
|
|
190
|
+
adapter: beraEdgeConfigAdapter()
|
|
191
|
+
});
|
|
192
|
+
var mockRewardDurationManager = flag({
|
|
193
|
+
key: "mockRewardDurationManager",
|
|
194
|
+
description: "Mock reward duration manager",
|
|
195
|
+
defaultValue: false,
|
|
196
|
+
adapter: beraEdgeConfigAdapter()
|
|
197
|
+
});
|
|
198
|
+
var mockIncentiveManager = flag({
|
|
199
|
+
key: "mockIncentiveManager",
|
|
200
|
+
description: "Mock incentive manager",
|
|
201
|
+
defaultValue: false,
|
|
202
|
+
adapter: beraEdgeConfigAdapter()
|
|
203
|
+
});
|
|
204
|
+
export {
|
|
205
|
+
flags_exports as flags
|
|
206
|
+
};
|
|
@@ -1,16 +1,288 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
|
|
2
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkONKAV4AGcjs = require('../chunk-ONKAV4AG.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkYT7WZDGIcjs = require('../chunk-YT7WZDGI.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunk7RKCKAACcjs = require('../chunk-7RKCKAAC.cjs');
|
|
11
|
+
require('../chunk-FNTZIXS7.cjs');
|
|
12
|
+
require('../chunk-NFEXQHYQ.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunkWRTYGXJMcjs = require('../chunk-WRTYGXJM.cjs');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var _chunkADH7F47Tcjs = require('../chunk-ADH7F47T.cjs');
|
|
23
|
+
require('../chunk-EYYJ2UZT.cjs');
|
|
24
|
+
require('../chunk-75ZPJI57.cjs');
|
|
25
|
+
|
|
26
|
+
// src/internal/sentry/getSentryKeys.ts
|
|
27
|
+
function getSentryKeys({
|
|
28
|
+
dsn = process.env.NEXT_PUBLIC_SENTRY_DSN
|
|
29
|
+
} = {}) {
|
|
30
|
+
if (!dsn) {
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
const re = /^(?:https:\/\/)([A-z0-9]{32})(?::{0,1})([A-z0-9]*)(?:@)(o[a-z0-9]+)(?:\.ingest\.us\.sentry\.io)\/([0-9]{16})/i;
|
|
34
|
+
const match = _optionalChain([dsn, 'optionalAccess', _ => _.match, 'call', _2 => _2(re)]);
|
|
35
|
+
if (!match) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
const [
|
|
39
|
+
,
|
|
40
|
+
key,
|
|
41
|
+
// this is a secret stored in a deprecated dns format
|
|
42
|
+
deprecatedSecret,
|
|
43
|
+
org,
|
|
44
|
+
projectId
|
|
45
|
+
] = match;
|
|
46
|
+
const cspEndpoint = new URL(
|
|
47
|
+
`https://${org}.ingest.us.sentry.io/api/${projectId}/security/?sentry_key=${key}`
|
|
48
|
+
);
|
|
49
|
+
cspEndpoint.searchParams.set("sentry_key", key);
|
|
50
|
+
cspEndpoint.searchParams.set("sentry_env", _chunkONKAV4AGcjs.sentryEnvironment);
|
|
51
|
+
cspEndpoint.searchParams.set("sentry_release", _chunkONKAV4AGcjs.sentryRelease);
|
|
52
|
+
return {
|
|
53
|
+
dsn: match[0],
|
|
54
|
+
projectId,
|
|
55
|
+
deprecatedSecret: deprecatedSecret || void 0,
|
|
56
|
+
cspEndpoint,
|
|
57
|
+
org,
|
|
58
|
+
publicKey: match[1]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// src/internal/header-sources.ts
|
|
63
|
+
function getContentSecurityPolicy({
|
|
64
|
+
isDevelopment,
|
|
65
|
+
nonce,
|
|
66
|
+
cspReporting,
|
|
67
|
+
...args
|
|
68
|
+
}) {
|
|
69
|
+
const defaultSrc = [];
|
|
70
|
+
const config = _chunk7RKCKAACcjs.chainConfigs[_chunkADH7F47Tcjs.defaultChainId];
|
|
71
|
+
const connectionSources = [
|
|
72
|
+
// csp reporting
|
|
73
|
+
"https://*.sentry.io/",
|
|
74
|
+
"https://*.berachain.com/",
|
|
75
|
+
"https://*.berachain-staging.com/",
|
|
76
|
+
"wss://www.walletlink.org/rpc",
|
|
77
|
+
"https://*.thirdweb.com/",
|
|
78
|
+
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
79
|
+
_chunkWRTYGXJMcjs.imageBaseUrl,
|
|
80
|
+
// QUICKNODE RPCs
|
|
81
|
+
"https://*.quiknode.pro",
|
|
82
|
+
// Beranames avatar
|
|
83
|
+
"https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/",
|
|
84
|
+
_chunkWRTYGXJMcjs.goldskyBaseUrl,
|
|
85
|
+
// Subgraph queries are served by same-origin typed REST endpoints under
|
|
86
|
+
// /api/honey/* and /api/pol/* (covered by 'self'), not direct browser
|
|
87
|
+
// requests to the upstream URLs.
|
|
88
|
+
config.pol.bribeBoostApi,
|
|
89
|
+
_chunkYT7WZDGIcjs.getUriFromLink.call(void 0, config.api),
|
|
90
|
+
_chunkWRTYGXJMcjs.jsonRpcUrl,
|
|
91
|
+
_chunkWRTYGXJMcjs.publicJsonRpcUrl,
|
|
92
|
+
_chunkWRTYGXJMcjs.alchemyJsonRpcUrl,
|
|
93
|
+
"https://open-api.openocean.finance/",
|
|
94
|
+
"https://api.haiku.trade/",
|
|
95
|
+
"https://api.fly.trade/",
|
|
96
|
+
`${config.bex.aggregatorsProxyUrl}/`,
|
|
97
|
+
"wss://relay.walletconnect.com/",
|
|
98
|
+
"wss://relay.walletconnect.org/",
|
|
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
|
+
// COOKIE3
|
|
120
|
+
"https://cdn.markfi.xyz/scripts/analytics/",
|
|
121
|
+
"https://a.markfi.xyz/",
|
|
122
|
+
// PYTH
|
|
123
|
+
"https://hermes.pyth.network/v2/",
|
|
124
|
+
// PORTO WALLET
|
|
125
|
+
"https://rpc.porto.sh",
|
|
126
|
+
// external rpc urls
|
|
127
|
+
"https://api.avax.network/ext/bc/C/rpc",
|
|
128
|
+
"https://polygon-rpc.com",
|
|
129
|
+
"https://mainnet.optimism.io/",
|
|
130
|
+
"https://arb1.arbitrum.io/rpc",
|
|
131
|
+
"wss://www.walletlink.org/rpc",
|
|
132
|
+
"https://eth.merkle.io",
|
|
133
|
+
"https://mainnet.base.org/",
|
|
134
|
+
// enso api
|
|
135
|
+
"https://api.enso.finance/",
|
|
136
|
+
"wss://www.walletlink.org/rpc",
|
|
137
|
+
// backend
|
|
138
|
+
_chunkYT7WZDGIcjs.getUriFromLink.call(void 0, config.backend)
|
|
139
|
+
].concat(_nullishCoalesce(args.connectionSources, () => ( []))).filter((link) => {
|
|
140
|
+
if (!link) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
const url = _chunkYT7WZDGIcjs.getUriFromLink.call(void 0, link);
|
|
144
|
+
if (!url || url.trim() === "") {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
if (url.startsWith(_chunkWRTYGXJMcjs.goldskyBaseUrl) && url !== _chunkWRTYGXJMcjs.goldskyBaseUrl) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return true;
|
|
151
|
+
});
|
|
152
|
+
const pictureSources = [
|
|
153
|
+
_chunkWRTYGXJMcjs.imageBaseUrl,
|
|
154
|
+
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
155
|
+
"https://assets.coingecko.com/coins/images/",
|
|
156
|
+
"https://coin-images.coingecko.com/coins/images/",
|
|
157
|
+
"https://beranames-assets-berachain.s3.eu-central-003.backblazeb2.com/",
|
|
158
|
+
"https://icons.llama.fi/",
|
|
159
|
+
"https://icons.llamao.fi/",
|
|
160
|
+
"https://static.debank.com/",
|
|
161
|
+
"https://cdn.whisk.so/",
|
|
162
|
+
// bend
|
|
163
|
+
"https://cdn.morpho.org/",
|
|
164
|
+
// bend
|
|
165
|
+
"https://raw.githubusercontent.com/trustwallet/assets/",
|
|
166
|
+
// bend
|
|
167
|
+
"https://pelaguswallet.io/docs/img",
|
|
168
|
+
// POSTHOG TOOLBAR
|
|
169
|
+
"https://*.posthog.com",
|
|
170
|
+
// VERCEL TOOLBAR
|
|
171
|
+
"https://vercel.live",
|
|
172
|
+
"https://vercel.com"
|
|
173
|
+
].concat(_nullishCoalesce(args.pictureSources, () => ( []))).filter((url) => {
|
|
174
|
+
if (!url || url.trim() === "") {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
return true;
|
|
178
|
+
});
|
|
179
|
+
const frameSources = [
|
|
180
|
+
"https://verify.walletconnect.com/",
|
|
181
|
+
"https://verify.walletconnect.org/",
|
|
182
|
+
// thirdweb export pk iframe
|
|
183
|
+
"https://embedded-wallet.thirdweb.com/",
|
|
184
|
+
// POSTHOG TOOLBAR
|
|
185
|
+
"https://*.posthog.com",
|
|
186
|
+
// VERCEL TOOLBAR
|
|
187
|
+
"https://vercel.live/",
|
|
188
|
+
// PORTO WALLET
|
|
189
|
+
"https://id.porto.sh"
|
|
190
|
+
].concat(_nullishCoalesce(args.frameSources, () => ( [])));
|
|
191
|
+
const fontSources = [
|
|
192
|
+
"https://cdn.jsdelivr.net/npm/@fontsource/",
|
|
193
|
+
// POSTHOG TOOLBAR
|
|
194
|
+
"https://*.posthog.com",
|
|
195
|
+
// VERCEL TOOLBAR
|
|
196
|
+
"https://vercel.live",
|
|
197
|
+
"https://assets.vercel.com",
|
|
198
|
+
// collected by sentry (need by browsers extensions)
|
|
199
|
+
"https://fonts.gstatic.com",
|
|
200
|
+
"https://use.typekit.net/"
|
|
201
|
+
].concat(_nullishCoalesce(args.fontSources, () => ( [])));
|
|
202
|
+
const styleSources = [
|
|
203
|
+
// POSTHOG TOOLBAR
|
|
204
|
+
"https://*.posthog.com",
|
|
205
|
+
// VERCEL TOOLBAR
|
|
206
|
+
"https://vercel.live"
|
|
207
|
+
].concat(_nullishCoalesce(args.styleSources, () => ( [])));
|
|
208
|
+
let cspHeader = `
|
|
209
|
+
default-src 'self' ${defaultSrc.join(" ")};
|
|
3
210
|
base-uri 'self';
|
|
4
|
-
frame-src 'self' ${
|
|
211
|
+
frame-src 'self' ${frameSources.join(" ")};
|
|
5
212
|
frame-ancestors 'self' https://*.posthog.com;
|
|
6
|
-
script-src 'self' 'sha256-k2HGvaYkGyYZxOwKGxgE1mr06tZEDcEXNZ5mdcldK0o=' 'nonce-${
|
|
213
|
+
script-src 'self' 'sha256-k2HGvaYkGyYZxOwKGxgE1mr06tZEDcEXNZ5mdcldK0o=' 'nonce-${nonce}' https://*.posthog.com 'strict-dynamic' ${isDevelopment ? "'unsafe-eval'" : ""};
|
|
7
214
|
worker-src 'self' blob: data:;
|
|
8
|
-
font-src 'self' ${
|
|
9
|
-
style-src 'self' ${
|
|
10
|
-
img-src 'self' data: ${
|
|
11
|
-
connect-src 'self' ${
|
|
215
|
+
font-src 'self' ${fontSources.join(" ")};
|
|
216
|
+
style-src 'self' ${styleSources.join(" ")} 'unsafe-inline';
|
|
217
|
+
img-src 'self' data: ${pictureSources.join(" ")};
|
|
218
|
+
connect-src 'self' ${connectionSources.join(" ")};
|
|
12
219
|
media-src https://*.posthog.com;
|
|
13
|
-
`;
|
|
14
|
-
|
|
220
|
+
`;
|
|
221
|
+
if (cspReporting) {
|
|
222
|
+
cspHeader += `
|
|
223
|
+
report-uri ${cspReporting};
|
|
15
224
|
report-to csp-endpoint;
|
|
16
|
-
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
227
|
+
return cspHeader.replace(/\s{2,}/g, " ").trim();
|
|
228
|
+
}
|
|
229
|
+
var staticPictureSources = [
|
|
230
|
+
// Only add image delivery URL if it exists and can be processed
|
|
231
|
+
_chunkWRTYGXJMcjs.imageBaseUrl,
|
|
232
|
+
"https://raw.githubusercontent.com/berachain/metadata/",
|
|
233
|
+
"https://assets.coingecko.com/coins/images/",
|
|
234
|
+
"https://berachain.ghost.io/content/images/"
|
|
235
|
+
].filter((url) => {
|
|
236
|
+
if (!url || url.trim() === "") {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
return true;
|
|
240
|
+
});
|
|
241
|
+
function cspMiddleware({
|
|
242
|
+
response
|
|
243
|
+
}) {
|
|
244
|
+
const sentryCspEndpoint = _optionalChain([getSentryKeys, 'call', _3 => _3(), 'optionalAccess', _4 => _4.cspEndpoint]);
|
|
245
|
+
const nonce = Buffer.from(crypto.randomUUID()).toString("base64");
|
|
246
|
+
const isDevelopment = process.env.NODE_ENV === "development";
|
|
247
|
+
const headers = [
|
|
248
|
+
{
|
|
249
|
+
key: "Content-Security-Policy",
|
|
250
|
+
value: getContentSecurityPolicy({
|
|
251
|
+
isDevelopment,
|
|
252
|
+
cspReporting: _optionalChain([sentryCspEndpoint, 'optionalAccess', _5 => _5.toString, 'call', _6 => _6()]),
|
|
253
|
+
nonce
|
|
254
|
+
})
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
key: "X-Frame-Options",
|
|
258
|
+
value: "DENY"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
key: "X-Content-Type-Options",
|
|
262
|
+
value: "nosniff"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
key: "X-Nonce",
|
|
266
|
+
value: nonce
|
|
267
|
+
}
|
|
268
|
+
];
|
|
269
|
+
if (sentryCspEndpoint) {
|
|
270
|
+
headers.push({
|
|
271
|
+
key: "Reporting-To",
|
|
272
|
+
value: `{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"${sentryCspEndpoint}"}],"include_subdomains":true}"`
|
|
273
|
+
});
|
|
274
|
+
headers.push({
|
|
275
|
+
key: "Reporting-Endpoints",
|
|
276
|
+
value: `csp-endpoint="${sentryCspEndpoint}"`
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
for (const header of headers) {
|
|
280
|
+
response.headers.set(header.key, header.value);
|
|
281
|
+
}
|
|
282
|
+
return response;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
exports.cspMiddleware = cspMiddleware; exports.getContentSecurityPolicy = getContentSecurityPolicy; exports.staticPictureSources = staticPictureSources;
|