From 96ad86b732fcb6fc0354a4c4c622fdf849f9e802 Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Mon, 13 May 2024 12:18:13 -0400 Subject: [PATCH 1/6] examples/next: move config.ts to src root so its easier to find --- examples/next/src/app/Web3Provider.tsx | 2 +- examples/next/src/app/components/Connected.tsx | 2 +- examples/next/src/{app => }/config.ts | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename examples/next/src/{app => }/config.ts (100%) diff --git a/examples/next/src/app/Web3Provider.tsx b/examples/next/src/app/Web3Provider.tsx index 2734ac09..fe8bfd57 100644 --- a/examples/next/src/app/Web3Provider.tsx +++ b/examples/next/src/app/Web3Provider.tsx @@ -6,7 +6,7 @@ import { KitWalletProvider } from '@0xsequence/kit-wallet' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { WagmiProvider } from 'wagmi' -import { wagmiConfig, kitConfig } from './config' +import { wagmiConfig, kitConfig } from '../config' const queryClient = new QueryClient() diff --git a/examples/next/src/app/components/Connected.tsx b/examples/next/src/app/components/Connected.tsx index 897534bd..45ea2a52 100644 --- a/examples/next/src/app/components/Connected.tsx +++ b/examples/next/src/app/components/Connected.tsx @@ -16,7 +16,7 @@ import { useWriteContract } from 'wagmi' -import { isDebugMode } from '../config' +import { isDebugMode } from '../../config' import { Header } from './Header' diff --git a/examples/next/src/app/config.ts b/examples/next/src/config.ts similarity index 100% rename from examples/next/src/app/config.ts rename to examples/next/src/config.ts From f15632416d37279548b28fc35640bc847c4584eb Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Mon, 13 May 2024 12:24:02 -0400 Subject: [PATCH 2/6] Remove wallet options --- examples/next/src/app/WalletOptions.tsx | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 examples/next/src/app/WalletOptions.tsx diff --git a/examples/next/src/app/WalletOptions.tsx b/examples/next/src/app/WalletOptions.tsx deleted file mode 100644 index 53856e8f..00000000 --- a/examples/next/src/app/WalletOptions.tsx +++ /dev/null @@ -1,17 +0,0 @@ -'use client' - -import { useConnect } from 'wagmi' - -export const WalletOptions = () => { - const { connectors, connect } = useConnect() - - return ( -
- {connectors.map(connector => ( - - ))} -
- ) -} From c3155e823aef552da49ecd0f98aa21d71471b31e Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Wed, 22 May 2024 12:13:16 -0400 Subject: [PATCH 3/6] packages/kit: removing unneccessary dependency to connectors --- packages/kit/package.json | 1 - .../components/KitProvider/ConnectWalletContent/index.tsx | 3 +-- packages/kit/src/types.ts | 6 +++++- pnpm-lock.yaml | 3 --- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/kit/package.json b/packages/kit/package.json index 9611b786..4ef62ff4 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -24,7 +24,6 @@ "@0xsequence/design-system": "^1.7.0", "@0xsequence/ethauth": "^0.8.1", "@0xsequence/indexer": "^1.9.26", - "@0xsequence/kit-connectors": "workspace:*", "@0xsequence/metadata": "^1.9.26", "@0xsequence/network": "^1.9.26", "@0xsequence/provider": "^1.9.26", diff --git a/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx b/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx index 1248efc8..0823314a 100644 --- a/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx +++ b/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx @@ -14,7 +14,6 @@ import { Tooltip, PINCodeInput } from '@0xsequence/design-system' -import { LogoProps } from '@0xsequence/kit-connectors' import { GoogleLogin } from '@react-oauth/google' import React, { useState, useEffect } from 'react' import { appleAuthHelpers, useScript } from 'react-apple-signin-auth' @@ -23,7 +22,7 @@ import { useConnect, useAccount } from 'wagmi' import { LocalStorageKey, defaultSignInOptions } from '../../../constants' import { useStorage, useStorageItem } from '../../../hooks/useStorage' import { useEmailAuth } from '../../../hooks/useWaasEmailAuth' -import { ExtendedConnector, KitConfig, WalletProperties } from '../../../types' +import { ExtendedConnector, KitConfig, LogoProps, WalletProperties } from '../../../types' import { isEmailValid } from '../../../utils/helpers' import { KitConnectProviderProps } from '../index' diff --git a/packages/kit/src/types.ts b/packages/kit/src/types.ts index 0473389a..eb164899 100644 --- a/packages/kit/src/types.ts +++ b/packages/kit/src/types.ts @@ -1,10 +1,14 @@ import { ETHAuthProof } from '@0xsequence/auth' -import { LogoProps } from '@0xsequence/kit-connectors' import { FunctionComponent } from 'react' import { Connector, CreateConnectorFn } from 'wagmi' import { LocalStorageKey } from './constants' +export interface LogoProps { + className?: string + style?: React.CSSProperties +} + export interface WalletProperties { id: string logoDark: FunctionComponent diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2f1fdc23..9c2cc425 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -406,9 +406,6 @@ importers: '@0xsequence/indexer': specifier: ^1.9.26 version: 1.9.26 - '@0xsequence/kit-connectors': - specifier: workspace:* - version: link:../connectors '@0xsequence/metadata': specifier: ^1.9.26 version: 1.9.26 From 1c68d6204caaaacc525df64abe5afa934a3d00d6 Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Thu, 16 May 2024 17:35:04 -0400 Subject: [PATCH 4/6] Fixing self referential imports in package/kit --- packages/kit/src/components/KitProvider/NetworkBadge.tsx | 2 +- packages/kit/src/components/KitProvider/TxnDetails/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kit/src/components/KitProvider/NetworkBadge.tsx b/packages/kit/src/components/KitProvider/NetworkBadge.tsx index f99f8aa6..f6924f37 100644 --- a/packages/kit/src/components/KitProvider/NetworkBadge.tsx +++ b/packages/kit/src/components/KitProvider/NetworkBadge.tsx @@ -1,8 +1,8 @@ import { Box, NetworkImage, Text } from '@0xsequence/design-system' -import { getNetwork, getNetworkColor, getNetworkBackgroundColor } from '@0xsequence/kit' import React from 'react' import { capitalize } from '../../utils/helpers' +import { getNetwork, getNetworkBackgroundColor, getNetworkColor } from '../../utils/networks' interface NetworkBadgeProps { chainId: number diff --git a/packages/kit/src/components/KitProvider/TxnDetails/index.tsx b/packages/kit/src/components/KitProvider/TxnDetails/index.tsx index 02d51462..7b8693aa 100644 --- a/packages/kit/src/components/KitProvider/TxnDetails/index.tsx +++ b/packages/kit/src/components/KitProvider/TxnDetails/index.tsx @@ -1,11 +1,11 @@ import { commons } from '@0xsequence/core' import { Box, Card, GradientAvatar, Skeleton, Text, TokenImage } from '@0xsequence/design-system' import { ContractType } from '@0xsequence/indexer' -import { useTokenMetadata, useBalances } from '@0xsequence/kit' import { ethers } from 'ethers' import React, { useEffect, useState } from 'react' import { useConfig } from 'wagmi' +import { useTokenMetadata, useBalances } from '../../../hooks/data' import { useAPIClient } from '../../../hooks/useAPIClient' import { compareAddress, capitalize } from '../../../utils/helpers' import { getNativeTokenInfoByChainId } from '../../../utils/tokens' From 1aca770cac08a41b36f27b705b42224693999d5e Mon Sep 17 00:00:00 2001 From: samuelea Date: Fri, 17 May 2024 16:36:56 -0400 Subject: [PATCH 5/6] remove old react-waas demo --- examples/react-waas/.eslintrc.cjs | 18 --- examples/react-waas/CHANGELOG.md | 70 --------- examples/react-waas/README.md | 1 - examples/react-waas/index.html | 13 -- examples/react-waas/package.json | 35 ----- examples/react-waas/src/App.css | 59 ------- examples/react-waas/src/App.tsx | 204 ------------------------- examples/react-waas/src/index.css | 68 --------- examples/react-waas/src/index.tsx | 71 --------- examples/react-waas/src/vite-env.d.ts | 1 - examples/react-waas/tsconfig.json | 25 --- examples/react-waas/tsconfig.node.json | 11 -- examples/react-waas/vite.config.ts | 10 -- package.json | 3 - 14 files changed, 589 deletions(-) delete mode 100644 examples/react-waas/.eslintrc.cjs delete mode 100644 examples/react-waas/CHANGELOG.md delete mode 100644 examples/react-waas/README.md delete mode 100644 examples/react-waas/index.html delete mode 100644 examples/react-waas/package.json delete mode 100644 examples/react-waas/src/App.css delete mode 100644 examples/react-waas/src/App.tsx delete mode 100644 examples/react-waas/src/index.css delete mode 100644 examples/react-waas/src/index.tsx delete mode 100644 examples/react-waas/src/vite-env.d.ts delete mode 100644 examples/react-waas/tsconfig.json delete mode 100644 examples/react-waas/tsconfig.node.json delete mode 100644 examples/react-waas/vite.config.ts diff --git a/examples/react-waas/.eslintrc.cjs b/examples/react-waas/.eslintrc.cjs deleted file mode 100644 index d6c95379..00000000 --- a/examples/react-waas/.eslintrc.cjs +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - root: true, - env: { browser: true, es2020: true }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', - ], - ignorePatterns: ['dist', '.eslintrc.cjs'], - parser: '@typescript-eslint/parser', - plugins: ['react-refresh'], - rules: { - 'react-refresh/only-export-components': [ - 'warn', - { allowConstantExport: true }, - ], - }, -} diff --git a/examples/react-waas/CHANGELOG.md b/examples/react-waas/CHANGELOG.md deleted file mode 100644 index 67858aa1..00000000 --- a/examples/react-waas/CHANGELOG.md +++ /dev/null @@ -1,70 +0,0 @@ -# @0xsequence/kit-example-react-waas - -## 0.5.1 - -### Patch Changes - -- Refactored GoogleWaasConnectButton and AppleWaasConnectButton - -- Updated dependencies []: - - @0xsequence/kit@2.6.1 - -## 0.5.0 - -### Minor Changes - -- Generalized all storage access to wagmi storage and refined exports - -### Patch Changes - -- Updated dependencies []: - - @0xsequence/kit@2.6.0 - -## 0.4.1 - -### Patch Changes - -- Updated dependencies []: - - @0xsequence/kit@2.5.1 - -## 0.4.0 - -### Minor Changes - -- Remove dependency on vanilla-extract - -### Patch Changes - -- Updated dependencies []: - - @0xsequence/kit@2.5.0 - -## 0.3.1 - -### Patch Changes - -- Fixing email login - -- Updated dependencies []: - - @0xsequence/kit@2.4.2 - -## 0.3.0 - -### Minor Changes - -- Support Next SSR - -### Patch Changes - -- Updated dependencies []: - - @0xsequence/kit@2.4.0 - -## 0.2.0 - -### Minor Changes - -- Upgraded to wagmi v2.5.20 - -### Patch Changes - -- Updated dependencies []: - - @0xsequence/kit@2.3.0 diff --git a/examples/react-waas/README.md b/examples/react-waas/README.md deleted file mode 100644 index 7825ed00..00000000 --- a/examples/react-waas/README.md +++ /dev/null @@ -1 +0,0 @@ -## react-waas diff --git a/examples/react-waas/index.html b/examples/react-waas/index.html deleted file mode 100644 index f828b817..00000000 --- a/examples/react-waas/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Vite + React + TS - - -
- - - diff --git a/examples/react-waas/package.json b/examples/react-waas/package.json deleted file mode 100644 index 64bf7b90..00000000 --- a/examples/react-waas/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@0xsequence/kit-example-react-waas", - "private": true, - "version": "0.5.1", - "type": "module", - "scripts": { - "dev": "pnpm start", - "start": "vite --port 4444", - "build": "tsc && vite build", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview", - "typecheck": "tsc --noEmit" - }, - "dependencies": { - "0xsequence": "^1.9.26", - "@0xsequence/kit": "workspace:*", - "@tanstack/react-query": "^5.32.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "viem": "^2.9.26", - "wagmi": "^2.5.20" - }, - "devDependencies": { - "@types/react": "^18.2.79", - "@types/react-dom": "^18.2.25", - "@typescript-eslint/eslint-plugin": "^7.7.1", - "@typescript-eslint/parser": "^7.7.1", - "@vitejs/plugin-react": "^4.2.1", - "eslint": "^8.57.0", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.6", - "typescript": "^5.4.5", - "vite": "^5.2.10" - } -} diff --git a/examples/react-waas/src/App.css b/examples/react-waas/src/App.css deleted file mode 100644 index f701aa09..00000000 --- a/examples/react-waas/src/App.css +++ /dev/null @@ -1,59 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 10px; - margin: 6px; - display: flex; - flex-direction: column; - gap: 10px; - align-items: center; - justify-content: center; - background: rgba(29, 32, 35, 0.5); - border-radius: 6px; - width: 100%; -} - -.container { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - width: 440px; -} - -.read-the-docs { - color: #888; -} diff --git a/examples/react-waas/src/App.tsx b/examples/react-waas/src/App.tsx deleted file mode 100644 index 97b06fff..00000000 --- a/examples/react-waas/src/App.tsx +++ /dev/null @@ -1,204 +0,0 @@ -import { sequence } from '0xsequence' -import { useOpenConnectModal, useWaasFeeOptions } from '@0xsequence/kit' -import { useEffect, useState } from 'react' -import { formatUnits } from 'viem' -import { - useAccount, - useChainId, - useDisconnect, - usePublicClient, - useSendTransaction, - useSwitchChain, - useWalletClient -} from 'wagmi' - -import './App.css' - -export const App = () => { - const { setOpenConnectModal } = useOpenConnectModal() - const { disconnect } = useDisconnect() - const { data: walletClient } = useWalletClient() - const { address, isConnected } = useAccount() - - // Switching chain - const { switchChain } = useSwitchChain() - const chainId = useChainId() - const networkForCurrentChainId = sequence.network.allNetworks.find(n => n.chainId === chainId) - - const switchNetwork = () => { - if (chainId === 421614) { - switchChain({ chainId: 42170 }) - } else { - switchChain({ chainId: 421614 }) - } - - setLastTxnDataHash(undefined) - setMessageSig(undefined) - setIsMessageValid(undefined) - } - - // Signing and verifying message - const messageToSign = 'Two roads diverged in a yellow wood' - const publicClient = usePublicClient({ chainId }) - - const [isSigningMessage, setIsSigningMessage] = useState(false) - const [messageSig, setMessageSig] = useState() - const [isMessageValid, setIsMessageValid] = useState() - - const signMessage = async () => { - if (!walletClient) { - return - } - - setMessageSig(undefined) - setIsMessageValid(undefined) - - setIsSigningMessage(true) - - try { - const message = messageToSign - - // sign - const sig = await walletClient.signMessage({ - account: address || ('' as `0x${string}`), - message - }) - console.log('address', address) - console.log('signature:', sig) - console.log('chainId in homepage', chainId) - - const [account] = await walletClient.getAddresses() - - const isValid = await publicClient?.verifyMessage({ - address: account, - message, - signature: sig - }) - - setIsSigningMessage(false) - setIsMessageValid(isValid) - setMessageSig(sig) - - console.log('isValid?', isValid) - } catch (e) { - setIsSigningMessage(false) - console.error(e) - } - } - - // Sending txn - const [lastTxnDataHash, setLastTxnDataHash] = useState() - - const { data: txnData, sendTransaction, isPending } = useSendTransaction() - const runSendTransaction = async () => { - if (!walletClient) { - return - } - - const [account] = await walletClient.getAddresses() - - sendTransaction({ to: account, value: BigInt('0'), gas: null }) - } - - useEffect(() => { - if (txnData) { - setLastTxnDataHash(txnData.hash ?? txnData) - } - }, [txnData]) - - // Fee options are required when txn is not gas sponsored (not needed on testnets) - const [pendingFeeOptionConfirmation, confirmPendingFeeOption] = useWaasFeeOptions() - - const [selectedFeeTokenAddress, setSelectedFeeTokenAddress] = useState() // option is null for native token, string for erc20 token - useEffect(() => { - if (pendingFeeOptionConfirmation) { - setSelectedFeeTokenAddress(pendingFeeOptionConfirmation.options[0].token.contractAddress) // preselect first option - } - }, [pendingFeeOptionConfirmation]) - - const confirmFeeOption = () => { - if (pendingFeeOptionConfirmation && selectedFeeTokenAddress !== undefined) { - confirmPendingFeeOption(pendingFeeOptionConfirmation.id, selectedFeeTokenAddress) - } - } - - return ( -
-
-

Vite + React + Sequence Kit with WaaS

- {!isConnected && ( -
- -
- )} - - {isConnected && ( - <> -
{isConnected &&

Wallet address: ({address})

}
- -
-

Network: {networkForCurrentChainId?.name}

- -
-
- - - {isPending &&

Transaction is pending...

} - - {networkForCurrentChainId?.blockExplorer && lastTxnDataHash && ( -
-

Transaction hash: {lastTxnDataHash}

- - - View on {networkForCurrentChainId?.name} explorer - -
- )} - - {pendingFeeOptionConfirmation && ( -
-

Select fee option

- - - -
- )} -
- -
-

Sign message

-

Message: {messageToSign}

- - - {isSigningMessage &&

Signing message...

} - - {messageSig &&

Signature: {messageSig}

} - - {isMessageValid &&

isValid: {isMessageValid.toString()}

} -
- -
- -
- - )} -
-
- ) -} diff --git a/examples/react-waas/src/index.css b/examples/react-waas/src/index.css deleted file mode 100644 index 6119ad9a..00000000 --- a/examples/react-waas/src/index.css +++ /dev/null @@ -1,68 +0,0 @@ -:root { - font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} diff --git a/examples/react-waas/src/index.tsx b/examples/react-waas/src/index.tsx deleted file mode 100644 index b515a81f..00000000 --- a/examples/react-waas/src/index.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { sequence } from '0xsequence' -import { KitConfig, KitProvider } from '@0xsequence/kit' -import { getDefaultWaasConnectors } from '@0xsequence/kit-connectors' -import { QueryClient, QueryClientProvider } from '@tanstack/react-query' -import React from 'react' -import ReactDOM from 'react-dom/client' -import { WagmiProvider, createConfig, http } from 'wagmi' -import { Chain, arbitrumNova, arbitrumSepolia, mainnet, polygon } from 'wagmi/chains' - -import { App } from './App.tsx' -import './index.css' - -const queryClient = new QueryClient() - -const chains: readonly [Chain, ...Chain[]] = [arbitrumNova as Chain, arbitrumSepolia as Chain, mainnet as Chain, polygon as Chain] - -// replace with your keys, and better to use env vars -const projectAccessKey = 'T3czhtWsTONJpbjFgAdLAuEAAAAAAAAA' -const waasConfigKey = 'eyJwcm9qZWN0SWQiOjc1LCJycGNTZXJ2ZXIiOiJodHRwczovL3dhYXMuc2VxdWVuY2UuYXBwIn0=' -const googleClientId = '603294233249-6h5saeg2uiu8akpcbar3r2aqjp6j7oem.apps.googleusercontent.com' -// const appleClientId = -// const appleRedirectURI = 'https://' + window.location.host - -const connectors = [ - ...getDefaultWaasConnectors({ - walletConnectProjectId: 'c65a6cb1aa83c4e24500130f23a437d8', - defaultChainId: 421614, - waasConfigKey, - googleClientId, - // appleClientId, - // appleRedirectURI, - appName: 'Kit Demo', - projectAccessKey - }) -] - -/* @ts-expect-error-next-line */ -const transports: Record = {} - -chains.forEach(chain => { - const network = sequence.network.findNetworkConfig(sequence.network.allNetworks, chain.id) - if (!network) return - - transports[chain.id] = http(network.rpcUrl) -}) - -const config = createConfig({ - transports, - chains, - connectors -}) - -const kitConfig: KitConfig = { - projectAccessKey, - defaultTheme: 'dark', - signIn: { - projectName: 'Kit Demo' - } -} - -ReactDOM.createRoot(document.getElementById('root')!).render( - - - - - - - - - -) diff --git a/examples/react-waas/src/vite-env.d.ts b/examples/react-waas/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2..00000000 --- a/examples/react-waas/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/react-waas/tsconfig.json b/examples/react-waas/tsconfig.json deleted file mode 100644 index a7fc6fbf..00000000 --- a/examples/react-waas/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, - - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] -} diff --git a/examples/react-waas/tsconfig.node.json b/examples/react-waas/tsconfig.node.json deleted file mode 100644 index 97ede7ee..00000000 --- a/examples/react-waas/tsconfig.node.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "skipLibCheck": true, - "module": "ESNext", - "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true, - "strict": true - }, - "include": ["vite.config.ts"] -} diff --git a/examples/react-waas/vite.config.ts b/examples/react-waas/vite.config.ts deleted file mode 100644 index 25f7b006..00000000 --- a/examples/react-waas/vite.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], - resolve: { - dedupe: ['wagmi', 'viem'] - } -}) diff --git a/package.json b/package.json index 8a88443b..81d094e1 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,6 @@ "start:react": "pnpm --filter @0xsequence/kit-example-react start", "serve:react": "pnpm --filter @0xsequence/kit-example-react serve", "build:react": "pnpm --filter @0xsequence/kit-example-react build", - "start:react-waas": "pnpm --filter @0xsequence/kit-example-react-waas start", - "serve:react-waas": "pnpm --filter @0xsequence/kit-example-react-waas serve", - "build:react-waas": "pnpm --filter @0xsequence/kit-example-react-waas build", "start:next": "pnpm --filter @0xsequence/kit-example-next dev", "serve:next": "pnpm --filter @0xsequence/kit-example-next start", "build:next": "pnpm --filter @0xsequence/kit-example-next build" From 7be20295e2459c8c6a03d1787251372cef29c67d Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Wed, 22 May 2024 13:21:55 -0400 Subject: [PATCH 6/6] Rename Web3Provider to Providers --- examples/next/src/app/{Web3Provider.tsx => Providers.tsx} | 4 ++-- examples/next/src/app/layout.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename examples/next/src/app/{Web3Provider.tsx => Providers.tsx} (89%) diff --git a/examples/next/src/app/Web3Provider.tsx b/examples/next/src/app/Providers.tsx similarity index 89% rename from examples/next/src/app/Web3Provider.tsx rename to examples/next/src/app/Providers.tsx index fe8bfd57..ccbd4667 100644 --- a/examples/next/src/app/Web3Provider.tsx +++ b/examples/next/src/app/Providers.tsx @@ -10,11 +10,11 @@ import { wagmiConfig, kitConfig } from '../config' const queryClient = new QueryClient() -export interface Web3ProviderProps { +export interface ProvidersProps { children: React.ReactNode } -export const Web3Provider = (props: Web3ProviderProps) => { +export const Providers = (props: ProvidersProps) => { const { children } = props return ( diff --git a/examples/next/src/app/layout.tsx b/examples/next/src/app/layout.tsx index d1ecdb49..378ab363 100644 --- a/examples/next/src/app/layout.tsx +++ b/examples/next/src/app/layout.tsx @@ -5,7 +5,7 @@ import { Inter } from 'next/font/google' import './globals.css' import '@0xsequence/design-system/styles.css' -import { Web3Provider } from './Web3Provider' +import { Providers } from './Providers' const inter = Inter({ subsets: ['latin'] }) @@ -23,7 +23,7 @@ export default function RootLayout({ - {children} + {children}