From 213fa817e0144f5e5ce89a0831f6172026ed8af3 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 12 Nov 2024 16:17:27 -0500 Subject: [PATCH] chore: fix tests --- apps/laboratory/next.config.mjs | 6 ++---- .../library/ethers-verify-domain-mismatch.tsx | 6 ++++++ .../src/pages/library/ethers-verify-evil.tsx | 15 +++------------ .../src/pages/library/ethers-verify-valid.tsx | 16 +++------------- .../library/wagmi-verify-domain-mismatch.tsx | 8 ++++++-- .../src/pages/library/wagmi-verify-evil.tsx | 9 --------- .../src/pages/library/wagmi-verify-valid.tsx | 10 ---------- packages/appkit/exports/constants.ts | 2 +- 8 files changed, 21 insertions(+), 51 deletions(-) diff --git a/apps/laboratory/next.config.mjs b/apps/laboratory/next.config.mjs index 9cf9c03f76..8121bbeba9 100644 --- a/apps/laboratory/next.config.mjs +++ b/apps/laboratory/next.config.mjs @@ -17,13 +17,11 @@ const cspHeader = ` img-src * 'self' data: blob: https://walletconnect.org https://walletconnect.com https://secure.walletconnect.com https://secure.walletconnect.org https://tokens-data.1inch.io https://tokens.1inch.io https://ipfs.io https://appkit-lab.reown.org; font-src 'self' https://fonts.gstatic.com; connect-src 'self' https://react-wallet.walletconnect.com https://rpc.walletconnect.com https://rpc.walletconnect.org https://relay.walletconnect.com https://relay.walletconnect.org wss://relay.walletconnect.com wss://relay.walletconnect.org https://pulse.walletconnect.com https://pulse.walletconnect.org https://api.web3modal.com https://api.web3modal.org wss://www.walletlink.org https://o1095249.ingest.sentry.io https://quote-api.jup.ag; - frame-src 'self' https://verify.walletconnect.com https://verify.walletconnect.org https://secure.walletconnect.com https://secure.walletconnect.org https://secure.reown.com https://widget.solflare.com/ ${secureSiteDomain}/; + frame-src 'self' https://verify.walletconnect.com https://verify.walletconnect.org https://secure.walletconnect.com https://secure.walletconnect.org https://secure.reown.com https://widget.solflare.com/ ${secureSiteDomain}; object-src 'none'; base-uri 'self'; form-action 'self'; - frame-ancestors ${ - process.env.NODE_ENV === 'production' ? 'none' : verifyApiNestedIframesTestOuterDomain - }; + frame-ancestors ${verifyApiNestedIframesTestOuterDomain}; report-uri https://o1095249.ingest.sentry.io/api/4505685639364608/security/?sentry_key=36ff1e79c60877fce6c0273e94a8ed69; report-to csp-endpoint ` diff --git a/apps/laboratory/src/pages/library/ethers-verify-domain-mismatch.tsx b/apps/laboratory/src/pages/library/ethers-verify-domain-mismatch.tsx index 3dcebd1d99..d3ee23ed1e 100644 --- a/apps/laboratory/src/pages/library/ethers-verify-domain-mismatch.tsx +++ b/apps/laboratory/src/pages/library/ethers-verify-domain-mismatch.tsx @@ -15,6 +15,12 @@ const modal = createAppKit({ networks: ConstantsUtil.EvmNetworks, defaultNetwork: mainnet, projectId, + metadata: { + name: "AppKit", + description: "AppKit Laboratory", + url: "https://example.com", + icons: [] + }, features: { analytics: true }, diff --git a/apps/laboratory/src/pages/library/ethers-verify-evil.tsx b/apps/laboratory/src/pages/library/ethers-verify-evil.tsx index 83208bff70..4208b635b7 100644 --- a/apps/laboratory/src/pages/library/ethers-verify-evil.tsx +++ b/apps/laboratory/src/pages/library/ethers-verify-evil.tsx @@ -1,20 +1,12 @@ -import { createAppKit } from '@reown/appkit' +import { createAppKit } from '@reown/appkit/react' +import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { EthersTests } from '../../components/Ethers/EthersTests' import { AppKitButtons } from '../../components/AppKitButtons' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' -import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { mainnet } from '@reown/appkit/networks' -const metadata = { - name: 'Evil Web3Modal', - description: 'Evil Web3Modal Laboratory', - url: 'https://malicious-app-verify-simulation.vercel.app/', - icons: ['https://avatars.githubusercontent.com/u/37784886'], - verifyUrl: '' -} - // Special project ID with https://malicious-app-verify-simulation.vercel.app/ as the verified domain and this domain is marked as a scam const projectId = '9d176efa3150a1df0a76c8c138b6b657' @@ -26,8 +18,7 @@ const modal = createAppKit({ features: { analytics: true }, - customWallets: ConstantsUtil.CustomWallets, - metadata + customWallets: ConstantsUtil.CustomWallets }) ThemeStore.setModal(modal) diff --git a/apps/laboratory/src/pages/library/ethers-verify-valid.tsx b/apps/laboratory/src/pages/library/ethers-verify-valid.tsx index a83e1c574c..3dcebd1d99 100644 --- a/apps/laboratory/src/pages/library/ethers-verify-valid.tsx +++ b/apps/laboratory/src/pages/library/ethers-verify-valid.tsx @@ -1,20 +1,11 @@ +import { createAppKit } from '@reown/appkit/react' +import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { EthersTests } from '../../components/Ethers/EthersTests' import { AppKitButtons } from '../../components/AppKitButtons' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' import { mainnet } from '@reown/appkit/networks' -import { EthersAdapter } from '@reown/appkit-adapter-ethers' -import { createAppKit } from '@reown/appkit' - -const metadata = { - name: 'Web3Modal', - description: 'Web3Modal Laboratory', - // Allow localhost - url: 'http://localhost:3000', - icons: ['https://avatars.githubusercontent.com/u/37784886'], - verifyUrl: '' -} // Special project ID with verify enabled on localhost const projectId = 'e4eae1aad4503db9966a04fd045a7e4d' @@ -27,8 +18,7 @@ const modal = createAppKit({ features: { analytics: true }, - customWallets: ConstantsUtil.CustomWallets, - metadata + customWallets: ConstantsUtil.CustomWallets }) ThemeStore.setModal(modal) diff --git a/apps/laboratory/src/pages/library/wagmi-verify-domain-mismatch.tsx b/apps/laboratory/src/pages/library/wagmi-verify-domain-mismatch.tsx index 12756c5c55..36fef12099 100644 --- a/apps/laboratory/src/pages/library/wagmi-verify-domain-mismatch.tsx +++ b/apps/laboratory/src/pages/library/wagmi-verify-domain-mismatch.tsx @@ -27,8 +27,12 @@ const modal = createAppKit({ networks, defaultNetwork: mainnet, projectId, - termsConditionsUrl: 'https://reown.com/terms-of-service', - privacyPolicyUrl: 'https://reown.com/privacy-policy' + metadata: { + name: "AppKit", + description: "AppKit Laboratory", + url: "https://example.com", + icons: [] + } }) ThemeStore.setModal(modal) diff --git a/apps/laboratory/src/pages/library/wagmi-verify-evil.tsx b/apps/laboratory/src/pages/library/wagmi-verify-evil.tsx index 98ec057022..cd37df538f 100644 --- a/apps/laboratory/src/pages/library/wagmi-verify-evil.tsx +++ b/apps/laboratory/src/pages/library/wagmi-verify-evil.tsx @@ -9,14 +9,6 @@ import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { mainnet } from '@reown/appkit/networks' -const metadata = { - name: 'Evil AppKit', - description: 'Evil AppKit Laboratory', - url: 'https://malicious-app-verify-simulation.vercel.app/', - icons: ['https://avatars.githubusercontent.com/u/37784886'], - verifyUrl: '' -} - // Special project ID with https://malicious-app-verify-simulation.vercel.app/ as the verified domain and this domain is marked as a scam const projectId = '9d176efa3150a1df0a76c8c138b6b657' @@ -35,7 +27,6 @@ const modal = createAppKit({ networks, defaultNetwork: mainnet, projectId, - metadata, termsConditionsUrl: 'https://reown.com/terms-of-service', privacyPolicyUrl: 'https://reown.com/privacy-policy' }) diff --git a/apps/laboratory/src/pages/library/wagmi-verify-valid.tsx b/apps/laboratory/src/pages/library/wagmi-verify-valid.tsx index 3aae04fe56..3605474cd2 100644 --- a/apps/laboratory/src/pages/library/wagmi-verify-valid.tsx +++ b/apps/laboratory/src/pages/library/wagmi-verify-valid.tsx @@ -9,15 +9,6 @@ import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { mainnet } from '@reown/appkit/networks' -const metadata = { - name: 'AppKit', - description: 'AppKit Laboratory', - // Allow localhost - url: 'http://localhost:3000', - icons: ['https://avatars.githubusercontent.com/u/37784886'], - verifyUrl: '' -} - // Special project ID with verify enabled on localhost const projectId = 'e4eae1aad4503db9966a04fd045a7e4d' @@ -36,7 +27,6 @@ const modal = createAppKit({ networks, projectId, defaultNetwork: mainnet, - metadata, termsConditionsUrl: 'https://reown.com/terms-of-service', privacyPolicyUrl: 'https://reown.com/privacy-policy' }) diff --git a/packages/appkit/exports/constants.ts b/packages/appkit/exports/constants.ts index ab8422f4dd..a3c6559487 100644 --- a/packages/appkit/exports/constants.ts +++ b/packages/appkit/exports/constants.ts @@ -1 +1 @@ -export const PACKAGE_VERSION = '1.3.0' +export const PACKAGE_VERSION = '1.3.2'