Skip to content

Commit

Permalink
fix: add wallet connect to CSP (#1865)
Browse files Browse the repository at this point in the history
  • Loading branch information
berteotti authored Aug 29, 2023
1 parent a03c08e commit bb23186
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ REACT_APP_SOCKET_API_KEY=72a5b4b0-e727-48be-8aa1-5da9d62fe635
# Default to chrome. Reference:node_modules/react-dev-utils/openBrowser.js
# BROWSER=Brave Browser
REACT_APP_STACKLY_DESIGN_VERSION=old
REACT_APP_SHOW_STACKLY_POPUP=true
REACT_APP_SHOW_STACKLY_POPUP=true
REACT_APP_WALLET_CONNECT_ID=47ba8ad6d35c9c9087a75b35360c4b3a
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ REACT_APP_FATHOM_SITE_SCRIPT_URL=https://gold-stunning.swapr.site/script.js
REACT_APP_STACKLY_DESIGN_VERSION=old
REACT_APP_SHOW_STACKLY_POPUP=true
REACT_APP_SOCKET_API_KEY=0b353e78-04e1-41ef-8bf3-61453e2ad1da
REACT_APP_WALLET_CONNECT_ID=47ba8ad6d35c9c9087a75b35360c4b3a
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<meta name="twitter:site" content="@Swapr_dapp" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'strict-dynamic' 'nonce-<%= CSP_NONCE %>' 'unsafe-inline' 'unsafe-eval'; script-src-attr 'none'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' data: ws: wss: http: https:; img-src 'self' data: blob: https:; font-src 'self' data:; media-src 'self' blob: https:; frame-src 'self' dexscreener.com blob:; object-src 'self'; base-uri 'none'"
content="default-src 'self'; script-src 'strict-dynamic' 'nonce-<%= CSP_NONCE %>' 'unsafe-inline' 'unsafe-eval'; script-src-attr 'none'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' data: ws: wss: http: https:; img-src 'self' data: blob: https:; font-src 'self' data:; media-src 'self' blob: https:; frame-src 'self' dexscreener.com verify.walletconnect.com blob:; object-src 'self'; base-uri 'none'"
/>
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<script nonce="<%= CSP_NONCE %>">
Expand Down
4 changes: 2 additions & 2 deletions src/connectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ export const [walletConnect, walletConnectHooks] = initializeConnector<WalletCon
new WalletConnect({
actions,
options: {
projectId: '47ba8ad6d35c9c9087a75b35360c4b3a',
projectId: process.env.REACT_APP_WALLET_CONNECT_ID as string,
chains: [ChainId.MAINNET],
optionalChains: [
ChainId.RINKEBY,
ChainId.ARBITRUM_ONE,
ChainId.ARBITRUM_RINKEBY,
ChainId.XDAI,
ChainId.GNOSIS,
ChainId.POLYGON,
ChainId.ARBITRUM_GOERLI,
ChainId.OPTIMISM_MAINNET,
Expand Down

0 comments on commit bb23186

Please sign in to comment.